Avoid fatal error with profiler in Maintenance.php
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 12 Jan 2015 20:05:17 +0000 (12:05 -0800)
committerUmherirrender <umherirrender_de.wp@web.de>
Fri, 16 Jan 2015 19:21:28 +0000 (19:21 +0000)
Error Message: "Fatal error: Class name must be a valid object or a string"

Change-Id: Ia21f4d2c45aaaa12a270dd0fda7274008736a899

maintenance/Maintenance.php

index 4b07d2f..9b98b20 100644 (file)
@@ -604,7 +604,7 @@ abstract class Maintenance {
                global $wgProfiler;
 
                $output = $this->getOption( 'profiler' );
-               if ( $output && is_array( $wgProfiler ) ) {
+               if ( $output && is_array( $wgProfiler ) && isset( $wgProfiler['class'] ) ) {
                        $class = $wgProfiler['class'];
                        $profiler = new $class(
                                array( 'sampling' => 1, 'output' => $output ) + $wgProfiler