Module

Archived
Forum
(read-only)

Bitly for EE

ExpressionEngine 2

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

     

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 :)