Merge "properly stop output buffering"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 22 Feb 2013 15:36:12 +0000 (15:36 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 22 Feb 2013 15:36:12 +0000 (15:36 +0000)
1  2 
maintenance/Maintenance.php

   * @defgroup Maintenance Maintenance
   */
  
 +if( PHP_SAPI != 'cli' ) {
 +      die( "Run me from the command line please.\n" );
 +}
 +
  // Make sure we're on PHP5.3.2 or better
  if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
        // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
@@@ -517,8 -513,11 +517,11 @@@ abstract class Maintenance 
                define( 'MEDIAWIKI', true );
  
                $wgCommandLineMode = true;
                # Turn off output buffering if it's on
-               @ob_end_flush();
+               while( ob_get_level() > 0 ) {
+                       ob_end_flush();
+               }
  
                $this->validateParamsAndArgs();
        }