From f3892257db2f12088db8a59ba7d7d244b0ed1701 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 17 Jun 2009 11:01:11 +0000 Subject: [PATCH] Self-revert r52011 per CR comments --- includes/GlobalFunctions.php | 140 ----------------------------------- 1 file changed, 140 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index ca149e5ad3..20f21b4b33 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3152,143 +3152,3 @@ function wfObjectToArray( $object, $recursive = true ) { return $array; } - -/** - * Safe equivalent of eval() that parses a statement of the form - * $varname = array( 'constant' => 'constant', ... ); or - * $varname = 'constant'; or - * $varname = 123; - * and refuses to execute anything. - * - * @return True on success ($varname set globally), false on failue - */ -function wfParsePHP( $php ) { - $tokens = token_get_all( " - if ( @$token[0] == T_WHITESPACE ) - $token = array_shift( $tokens ); - //die("3"); - array_unshift( $tokens, $token ); - //var_dump($tokens);die(); - $val = wfParsePHP_recursive( $tokens, $recGood ); - //var_dump($val);var_dump($tokens);die(); - if ( !$recGood ) - return $isGood = false; - $token = array_shift( $tokens ); - } - - if ( is_null( $key ) ) - $varvalue[] = $val; - else - $varvalue[$key] = $val; - - if ( @$token[0] == T_WHITESPACE ) - $token = array_shift( $tokens ); // discard whitespace - //var_dump($token);var_dump($tokens);die(); - if ( $token == ')' ) - break; - else if ( $token != ',' ) - return $isGood = false; - $first = false; - } - break; - default: - return $isGood = false; - } - return $varvalue; -} -- 2.20.1