• Resolved jahrat

    (@jahrat)


    I recently added your plugin to my website as I have two separate podcasts to share. The plugin apparently works fine but I keep getting the following error in my debug log.

    PHP Warning: Header may not contain more than a single header, new line detected in /…/wp-content/plugins/seriously-simple-podcasting/php/classes/controllers/class-frontend-controller.php on line 1044

    Is this an error on my settings? How do I fix this?

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter jahrat

    (@jahrat)

    Checking the debug log again today I found additional error listed.

    PHP Warning: Undefined array key 2 in /…/wp-includes/feed.php on line 484
    PHP Warning: Undefined array key 1 in /…/wp-includes/feed.php on line 494

    Not sure if this is related to the earlier warning or if this is a n additional warning.

    What is the recommendation?

    Plugin Author Serhiy Zakharchenko

    (@zahardoc)

    Hi @jahrat!

    Thank you for bringing it to our attention.
    It looks like your audio file path contains newlines in it. I’m not sure why it is happening and I couldn’t reproduce it, but please try putting this string after $file = str_replace( ' ', '%20', $file ); in …/wp-content/plugins/seriously-simple-podcasting/php/classes/controllers/class-frontend-controller.php on line 1041:

    $file = str_replace( PHP_EOL, '', $file );

    If it helps, we’ll include that code in our next plugin release.

    Regarding second warning, it goes from the WordPress core code, and I’m not sure if we can help you to fix it now. Usually, that function should not be called if you use our SSP feed template ( https://the-mcaj.org/feed/podcast/ ).

    Thread Starter jahrat

    (@jahrat)

    I added the string as requested and I have not seen the fault repeated. The other errors related to the WordPress core are still there but not the fault for your plugin.

    I will consider this closed and will continue to trouble shoot my other errors.

    Thanks.

    Plugin Author Serhiy Zakharchenko

    (@zahardoc)

    @jahrat Cool, thank you for your feedback!

    We were experiencing this same exact issue, even after the latest release with the above patch.

    I replaced the code on line 1044 and suggest it be included in the next release:

    $file = preg_replace(['/[\r\n]{2,}/','/[\r]/','/[\n]/', PHP_EOL], '', trim($file));

    This should catch all carriage returns and end of file characters that could get injected due to copy/paste into the editor.

    Additional note, it would be better if line 972 used:

    $is_url = filter_var($file, FILTER_VALIDATE_URL);

    Instead of:

    $is_url = 0 === strpos( $file, 'http' );

    This would catch the issue earlier.

    • This reply was modified 1 year, 11 months ago by psimatrix.
    Plugin Author Serhiy Zakharchenko

    (@zahardoc)

    Thank you @psimatrix !

    still this error for me with php 8.2.9

    Still getting this error – hundreds a day – can you help?

    [28-Mar-2024 14:36:24 UTC] PHP Warning: Undefined array key 2 in /home/public_html/wp-includes/feed.php on line 484
    [28-Mar-2024 14:36:24 UTC] PHP Warning: Undefined array key 1 in /home/public_html/wp-includes/feed.php on line 494

    The above fix is present in class-frontend-controller.php, but I can’t see where @psimatrix fix would go, as line 1044 is related to rss meta tag.

    Feed not showing any errors: https://www.worldturnedupsidedown.co.uk/feed/podcast/the-world-turned-upside-down/

    WordPress 6.4.3
    Seriously Simple Podcasting 3.2.0

    for incompatibility with my translation plugin I’m using php 7.4 and this issue is not present with 7.4

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘PHP Warning in Header’ is closed to new replies.