• Resolved Dalton Rooney

    (@daltonrooney)


    I don’t know if the plugin supports 3.1 yet, I’m sure there’s still some testing to do. I get the following error on my single post page when I activate the plugin:

    Warning]: Header may not contain more than a single header, new line detected. in /home/user/public_html/website/wordpress/wp-includes/link-template.php on line 2435

    Thanks for any insight you can provide. I’ll deactivate it for now.

    Dalton

    https://www.ads-software.com/extend/plugins/bitly-shortlinks/

Viewing 9 replies - 16 through 24 (of 24 total)
  • … I deactivate the plugin and reactivated it and the problem was gone. [shrug]

    We also get the error. Any chance you’ll fix it soon and release an upgrade?

    The problem is that bit.ly sends a bad character back from the API call. Not entirely sure which one, but it’s fixed by changing one line of the plugin file. Easy ??

    Change line 21 of the bitly.php file from:

    $short = $resp['body'];
    …to…

    $short = ereg_replace("/\n\r|\r\n|\n|\r/", "", $resp['body']);

    Cheers,

    -Alister

    https://about.me/alicam

    Testing blogologist’s fix… so far, so good… but then, I didn’t see the error consistently.

    Staze,

    My mod can’t break it. It will only remove any CR or LF or combo, if found.

    Cheers,

    Alister

    didn’t think it would.

    the change does indeed seem to have fixed the issue. Thanks for the detective work. Hopefully Yoast will integrate this, or something similar, into his codebase.

    @blogologist Thanks for the fix!

    I implemented a similar, but simpler fix to the one blogologist suggested, doing this instead:

    $short = trim($resp['body']);

    this is similar to what joostdevalk suggested, but on the creation end (when getting it from the API) as oppposed to the retrieval end (when getting it from the WP database).

    using trim will also deal with other stray whitespace characters besides CR/LF.

    Plugin Author Joost de Valk

    (@joostdevalk)

    Should be fixed in 0.2, just released.

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘[Plugin: Bit.ly Shortlinks] Error in header’ is closed to new replies.