Fix escaping
parent
8cfbe7023d
commit
4207a33ccf
|
@ -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++;
|
||||||
|
|
Loading…
Reference in New Issue