• Resolved Musculacus

    (@musculacus)


    Hi,
    I have a lot of problems with unwanted output after the update. Sometimes I use my own PHP scripts to extend or to add new functionality to my websites and for that I include wp-load.php to be able to use some wordpress functions etc. Until the 4.9 update everything worked fine. Since than, the inclusion of wp-load.php outputs 2 new line characters (line feed – 0A). I found that out after my cronjobs started to have output, (I get an email if a cronjob outputs anything like an error or something). Now I get, apparently empty emails, every time the cronjob runs.
    For example in a new file:
    echo 'output_start'; $parse_uri = explode('wp-content', $_SERVER['SCRIPT_FILENAME']); require_once( $parse_uri[0] . 'wp-load.php' ); echo 'output_end';
    echoes as output_start output_end
    If I comment out the require_once method I get output_startoutput_end as expected.

    This new behavior brakes the functionality if you use something like ZipArchive because by the output to the browser it pushes this two characters in front of the zip file and makes the archive unreadable.

    Is there something I could do? Because until the output is repaired part of the functionality of my site is gone. Thanks for your help.

    Greetings,
    Manuel

Viewing 3 replies - 1 through 3 (of 3 total)
  • Very possibly these unwanted newlines have crept into some of the files. These problems can be very subtle and difficult to find.

    Note for the sake of this discussion <EOF> is the “end of file”, it is not a character or anything, it just indicates where in the file the data ends.
    Say that a .php script file previously had a final line of:
    ?><EOF>
    but in an edit is inadvertently changed to:

    ?>
    <EOF>

    with a newline after the close php phrase. The difference is very difficult to find.

    Please examine your files such as wp-load.php and also your theme files for this problem.
    This same problem is sometimes seen as “headers already sent”.

    Thread Starter Musculacus

    (@musculacus)

    Hi,
    thank you for your answer but I don’t know how this will help me or others further. wp-load.php loads wordpress, plugins and theme functions as far as I know. I looked up my theme for some unwanted output and is clean, it worked with no problems until the update. behavior started after the update, so I would think that those two new line characters crept in the wordpress update.

    Thanks,
    Manuel

    Thread Starter Musculacus

    (@musculacus)

    Hi Mitchel,

    thanks a lot for your help pushing me in the wright direction. It was a plugin that had two new lines after the closing ?> at the end of the file.

    Thanks again,
    Manuel

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unwanted output after update’ is closed to new replies.