Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-10191

Duplicate output when output_handler is set in php.ini

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.0.9-RC1
    • 3.0.8
    • None
    • None

      Currently if the following conditions hold true:

      1. output_handler is set in php.ini to ob_gzhandler;
      2. output compression is not enabled in phpbb

      then exit_handler performs a flush() call.

      However, the way ob_gzhandler is implemented is it sets content encoding headers, collects buffered output (output buffering is implicitly turned on when output_handler is used), compresses the output and prints compressed output.

      The problem is that flush call in phpbb occurs before ob_gzhandler sets the headers, which is the root of the problem and somehow after going through msg_handler the entire page output is printed a second time.

      What should happen is conditional determining whether to use ob_flush or flush in exit_handler should look at whether output buffering is active, not at gzip_compress setting, because as explained output buffering may be turned on outside of phpbb.

            Oleg Oleg [X] (Inactive)
            Oleg Oleg [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: