From e657d50e47f7beb72a4706ed20785abbfe83d779 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 25 Jul 2011 20:11:00 +0000 Subject: [PATCH] Make Chad happy ;) --- maintenance/Maintenance.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 075b121f79..7be3b3d80d 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -139,14 +139,15 @@ abstract class Maintenance { */ public static function shouldExecute() { $bt = debug_backtrace(); - if ( count( $bt ) < 2 ) { + $count = count( $bt ); + if ( $count < 2 ) { return false; // sanity } if ( $bt[0]['class'] !== 'Maintenance' || $bt[0]['function'] !== 'shouldExecute' ) { return false; // last call should be to this function } - $includeFuncs = array( 'require_once', 'require', 'include', 'include_once' ); - for( $i=1; $i < count( $bt ); $i++ ) { + $includeFuncs = array( 'require_once', 'require', 'include' ); + for( $i=1; $i < $count; $i++ ) { if ( !in_array( $bt[$i]['function'], $includeFuncs ) ) { return false; // previous calls should all be "requires" } -- 2.20.1