Support » Plugin: Shortlinks » [Plugin: Shortlinks] Error in header

  • Resolved Dalton Rooney


    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.


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 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'];

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



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


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



    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


    Should be fixed in 0.2, just released.

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