mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
issue 696: TemplateHandler now supports eval()
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9952 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
05cd0d720d
commit
d25f1cf768
2 changed files with 6 additions and 1 deletions
|
|
@ -565,7 +565,7 @@ class TemplateHandler {
|
|||
**/
|
||||
function _replaceVar($php) {
|
||||
if(!strlen($php)) return '';
|
||||
return preg_replace('@(?<!::|\\\\|\')\$([a-z]|_[a-z0-9])@i', '\$__Context->$1', $php);
|
||||
return preg_replace('@(?<!::|\\\\|(?<!eval\()\')\$([a-z]|_[a-z0-9])@i', '\$__Context->$1', $php);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -227,6 +227,11 @@ class TemplateHandlerTest extends PHPUnit_Framework_TestCase
|
|||
'<img src="../myxe/xe/img.png" />',
|
||||
'<img src="/xe/tests/classes/myxe/xe/img.png" />'
|
||||
),
|
||||
// issue 696
|
||||
array(
|
||||
'{@ eval(\'$val = $document_srl;\')}',
|
||||
'<?php eval(\'$__Context->val = $__Context->document_srl;\') ?>'
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue