From: Roan Kattouw Date: Wed, 17 Jun 2009 11:01:11 +0000 (+0000) Subject: Self-revert r52011 per CR comments X-Git-Tag: 1.31.0-rc.0~41328 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=f3892257db2f12088db8a59ba7d7d244b0ed1701;p=lhc%2Fweb%2Fwiklou.git Self-revert r52011 per CR comments --- 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; -}