Index: trunk/phase3/maintenance/Maintenance.php |
— | — | @@ -139,14 +139,15 @@ |
140 | 140 | */ |
141 | 141 | public static function shouldExecute() { |
142 | 142 | $bt = debug_backtrace(); |
143 | | - if ( count( $bt ) < 2 ) { |
| 143 | + $count = count( $bt ); |
| 144 | + if ( $count < 2 ) { |
144 | 145 | return false; // sanity |
145 | 146 | } |
146 | 147 | if ( $bt[0]['class'] !== 'Maintenance' || $bt[0]['function'] !== 'shouldExecute' ) { |
147 | 148 | return false; // last call should be to this function |
148 | 149 | } |
149 | | - $includeFuncs = array( 'require_once', 'require', 'include', 'include_once' ); |
150 | | - for( $i=1; $i < count( $bt ); $i++ ) { |
| 150 | + $includeFuncs = array( 'require_once', 'require', 'include' ); |
| 151 | + for( $i=1; $i < $count; $i++ ) { |
151 | 152 | if ( !in_array( $bt[$i]['function'], $includeFuncs ) ) { |
152 | 153 | return false; // previous calls should all be "requires" |
153 | 154 | } |