1
0
Fork 0

Fix escaping

pull/4980/head
Jordi Boggiano 2016-02-29 18:46:21 +00:00
parent 8cfbe7023d
commit 4207a33ccf
1 changed files with 3 additions and 3 deletions

View File

@ -172,9 +172,9 @@ class PluginManager
$path = $classLoader->findFile($class); $path = $classLoader->findFile($class);
$code = file_get_contents($path); $code = file_get_contents($path);
$code = preg_replace('{^((?:final\s+)?(?:\s*))class\s+(\S+)}mi', '$1class $2_composer_tmp'.self::$classCounter, $code); $code = preg_replace('{^((?:final\s+)?(?:\s*))class\s+(\S+)}mi', '$1class $2_composer_tmp'.self::$classCounter, $code);
$code = str_replace('__FILE__', "'".str_replace(array('\\', "'"), array('\\\\', "\\'"), $path)."'", $code); $code = str_replace('__FILE__', var_export($path, true), $code);
$code = str_replace('__DIR__', "'".str_replace(array('\\', "'"), array('\\\\', "\\'"), dirname($path))."'", $code); $code = str_replace('__DIR__', var_export(dirname($path), true), $code);
$code = str_replace('__CLASS__', "'".str_replace(array('\\', "'"), array('\\\\', "\\'"), $class)."'", $code); $code = str_replace('__CLASS__', var_export($class, true), $code);
eval('?>'.$code); eval('?>'.$code);
$class .= '_composer_tmp'.self::$classCounter; $class .= '_composer_tmp'.self::$classCounter;
self::$classCounter++; self::$classCounter++;