From 58c4ae9c79383c1d541f00ed7f8abb43d1099a5a Mon Sep 17 00:00:00 2001 From: Platonides Date: Thu, 27 Oct 2011 21:18:01 +0000 Subject: [PATCH] Convert the string to single quoted and manually escape it. http://us.php.net/manual/en/language.types.string.php addslashes() is convenient, but this way we have no legitimate usage, and it's easier to have it banned everywhere. --- tests/phpunit/includes/parser/MediaWikiParserTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/includes/parser/MediaWikiParserTest.php b/tests/phpunit/includes/parser/MediaWikiParserTest.php index 83203b682f..e25c3fdd0b 100644 --- a/tests/phpunit/includes/parser/MediaWikiParserTest.php +++ b/tests/phpunit/includes/parser/MediaWikiParserTest.php @@ -24,7 +24,7 @@ class MediaWikiParserTest { */ $className = str_replace( '.', '_', ucfirst( basename( $filename, '.txt' ) ) ); - eval( "/** @group Database\n@group Parser\n*/ class $className extends NewParserTest { protected \$file = \"" . addslashes( $filename ) . "\"; } " ); + eval( "/** @group Database\n@group Parser\n*/ class $className extends NewParserTest { protected \$file = '" . strtr( $filename, array( "'" => "\\'", '\\' => '\\\\' ) ) . "'; } " ); $parserTester = new $className( $testsName ); $suite->addTestSuite( new ReflectionClass ( $parserTester ) ); -- 2.20.1