Index: trunk/phase3/tests/parser/parserTestsParserHook.php |
— | — | @@ -28,12 +28,12 @@ |
29 | 29 | class ParserTestParserHook { |
30 | 30 | |
31 | 31 | static function setup( &$parser ) { |
32 | | - $parser->setHook( 'tag', array( __CLASS__, 'hook' ) ); |
| 32 | + $parser->setHook( 'tag', array( __CLASS__, 'dumpHook' ) ); |
33 | 33 | |
34 | 34 | return true; |
35 | 35 | } |
36 | 36 | |
37 | | - static function hook( $in, $argv ) { |
| 37 | + static function dumpHook( $in, $argv ) { |
38 | 38 | ob_start(); |
39 | 39 | var_dump( |
40 | 40 | $in, |
Index: trunk/tools/code-utils/check-vars.php |
— | — | @@ -94,6 +94,9 @@ |
95 | 95 | 'session_unregister' => 'Deprecated since PHP 5.3.0.', |
96 | 96 | 'session_is_registered' => 'Deprecated since PHP 5.3.0.', |
97 | 97 | 'set_magic_quotes_runtime' => 'Deprecated since PHP 5.3.0.', |
| 98 | + |
| 99 | + 'var_dump' => 'Debugging function.', //r81671#c13996 |
| 100 | + //'print_r' => 'Debugging function if second parameter is not true.', |
98 | 101 | ); |
99 | 102 | |
100 | 103 | protected $generateDeprecatedList = false; |
— | — | @@ -721,6 +724,10 @@ |
722 | 725 | } |
723 | 726 | |
724 | 727 | if ( isset( self::$poisonedFunctions[ strtolower($token[1]) ] ) ) { |
| 728 | + if ( $token[1] == 'var_dump' && ( substr( $this->mFunction, 0, 4 ) == 'dump' ) || basename( $this->mFilename ) == 'ApiFormatDump.php' ) { |
| 729 | + // Allow var_dump if the function purpose is really to dump contents |
| 730 | + return; |
| 731 | + } |
725 | 732 | $this->warning( "Poisoned function {$token[1]} called from {$this->mFunction} in line {$token[2]}: " . self::$poisonedFunctions[strtolower($token[1])] ); |
726 | 733 | return; |
727 | 734 | } |