MantisBT: master dd4ac8a7

Author Committer Branch Timestamp Parent
Julian Fitzell master 2003-02-16 20:50 master 51f52b67
Affected Issues  0002936: SYSTEM WARNING: ob_gzhandler() used twice
Changeset

Fix issue 0002936: 'SYSTEM WARNING: ob_gzhandler() used twice'

I had to rework the compression stuff. The problem is that ob_gzhandler() can't be used on anything except the top-level output buffer (because the entire HTTP response has to be encoded). What I did was register our own handler in the ob_start() call in core.php. It always gets called and then it decides whether to call ob_gzhandler() based on the value of a global variable.

The result is that we can have nested output buffers again (though actually we end up not needing them -we just turn on compression when we want it instead of starting a new buffer) and also that error_api can disable compression again when it clears the buffer. This means that when an error is triggered on view_all_bug_page, you no longer see a blank screen.

  • bug_view_advanced_page.php:

  • bug_view_page.php:

  • view_all_bug_page.php:
    call compress_enable() instead of compress_start() and don't call compress_stop()

  • core.php: give compress_handler as the output buffering handler

  • core/compress_api.php
    (compress_start): deleted
    (compress_stop): deleted
    (compress_is_enabled): check the value of the global variable too
    (compress_handler): new function that handles the processing of the output
    buffer, compressing it if appropriate
    (compress_enable):
    (compress_disable):
    2 new functions that just set the state of the global variable

  • core/error_api.php
    (error_handler): call compress_disable() before ob_end_clear() so that the
    GZIP encoded header doesn't get sent when our data isn't gzip encoded

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1895 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9

mod - core.php Diff File
mod - view_all_bug_page.php Diff File
mod - bug_view_advanced_page.php Diff File
mod - bug_view_page.php Diff File
mod - core/error_api.php Diff File
mod - core/compress_api.php Diff File