Module

Community
Support

Bjorn Borresen does not actively monitor this forum
(but you can still get help from other EE users).

EE 1
EE 2
Bitly for EE

Back to this add-on's main page
View Other Add-ons From Bjorn Borresen

     

You must be logged in to post.

Line break after Bitly tag

General

kevin332
kevin332

First of all, thanks for a great time-saving addon. I’ve just come across one minor hiccup that’s easily fixed.

The text files returned by bit.ly seem to come with a blank 2nd line which causes the module tag to output with a line break. To avoid this, I added a maxlen of 20 to the @file_get_contents line of the module and manually edited all the existing entries in my database. I suppose trimming linebreaks would have been the more elegant solution. I just didn’t know what the best method would be.

Indranil
# 1
Indranil

Just add this after the if($short_url) { in function _shorten_url().

$short_url = str_replace(”\n”,’‘,$short_url);

And you’re good to go. Good catch :)