issue 2135 occur header script bug when using '$'

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.2@11109 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
chschy 2012-08-28 09:53:38 +00:00
parent 6d40f3317f
commit 5c90ee1e1d

View file

@ -482,7 +482,11 @@
$layout_config = $oModuleModel->getModulePartConfig('layout', $layout_srl);
$header_script = trim($layout_config->header_script);
if($header_script) $buff .= sprintf(' $layout_info->header_script = "%s"; ', str_replace('"','\\"',$header_script));
if($header_script)
{
$header_script = str_replace('"','\\"',$header_script);
$buff .= sprintf(' $layout_info->header_script = "%s"; ', str_replace('$','\$',$header_script));
}
$buff = '<?php if(!defined("__ZBXE__")) exit(); '.$buff.' ?>';
FileHandler::writeFile($cache_file, $buff);