mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-12 05:22:35 +09:00
Fixed a tempalte bug that the engine parses javascript code blocks as php echo syntax
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9547 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
82f117e32b
commit
c105bbbfa2
2 changed files with 10 additions and 3 deletions
|
|
@ -379,6 +379,8 @@
|
||||||
// {@ ... } or {$var} or {func(...)}
|
// {@ ... } or {$var} or {func(...)}
|
||||||
if($m[1])
|
if($m[1])
|
||||||
{
|
{
|
||||||
|
if(preg_match('@^(\w+)\(@', $m[1], $mm) && !function_exists($mm[1])) return $m[0];
|
||||||
|
|
||||||
$echo = 'echo ';
|
$echo = 'echo ';
|
||||||
if($m[1]{0} == '@') {
|
if($m[1]{0} == '@') {
|
||||||
$echo = '';
|
$echo = '';
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ class TemplateHandlerTest extends PHPUnit_Framework_TestCase
|
||||||
// <load target="style.css">
|
// <load target="style.css">
|
||||||
array(
|
array(
|
||||||
'<dummy /><load target="css/style.css" /><dummy />',
|
'<dummy /><load target="css/style.css" /><dummy />',
|
||||||
'<dummy /><!--#Meta:tests/classes/template/css/style.css--><?php $__tmp=array(\'tests/classes/template/css/style.css\',\'\',\'\',\'\',\'\',\'\',\'\');Context::loadFile($__tmp);unset($__tmp); ?><dummy />'
|
'<dummy /><!--#Meta:tests/classes/template/css/style.css--><?php $__tmp=array(\'tests/classes/template/css/style.css\',\'\',\'\',\'\');Context::loadFile($__tmp,\'\',\'\',\'\');unset($__tmp); ?><dummy />'
|
||||||
),
|
),
|
||||||
// <unload target="style.css">
|
// <unload target="style.css">
|
||||||
array(
|
array(
|
||||||
|
|
@ -132,7 +132,7 @@ class TemplateHandlerTest extends PHPUnit_Framework_TestCase
|
||||||
// <!--%import("../script.js",type="body")-->
|
// <!--%import("../script.js",type="body")-->
|
||||||
array(
|
array(
|
||||||
'<dummy /><!--%import("../script.js",type="body")--><dummy />',
|
'<dummy /><!--%import("../script.js",type="body")--><dummy />',
|
||||||
'<dummy /><!--#Meta:tests/classes/script.js--><?php $__tmp=array(\'tests/classes/script.js\',\'body\',\'\',\'\',\'\',\'\',\'\');Context::loadFile($__tmp);unset($__tmp); ?><dummy />'
|
'<dummy /><!--#Meta:tests/classes/script.js--><?php $__tmp=array(\'tests/classes/script.js\',\'body\',\'\',\'\');Context::loadFile($__tmp,\'\',\'\',\'\');unset($__tmp); ?><dummy />'
|
||||||
),
|
),
|
||||||
// <!--%unload("../script.js",type="body")-->
|
// <!--%unload("../script.js",type="body")-->
|
||||||
array(
|
array(
|
||||||
|
|
@ -174,10 +174,15 @@ class TemplateHandlerTest extends PHPUnit_Framework_TestCase
|
||||||
'<script type="text/javascript">var json = {hello:"world"};</script>',
|
'<script type="text/javascript">var json = {hello:"world"};</script>',
|
||||||
'<script type="text/javascript">var json = {hello:"world"};</script>'
|
'<script type="text/javascript">var json = {hello:"world"};</script>'
|
||||||
),
|
),
|
||||||
|
// error case - inline javascript
|
||||||
|
array(
|
||||||
|
'<form onsubmit="jQuery(this).find(\'input\').each(function(){if(this.title==this.value)this.value=\'\';}); return procFilter(this, insert_comment)"></form>',
|
||||||
|
'<form onsubmit="jQuery(this).find(\'input\').each(function(){if(this.title==this.value)this.value=\'\';}); return procFilter(this, insert_comment)"><input type="hidden" name="error_return_url" value="<?php echo getRequestUriByServerEnviroment() ?>" /><input type="hidden" name="act" value="<?php echo $act ?>"><input type="hidden" name="mid" value="<?php echo $mid ?>"><input type="hidden" name="vid" value="<?php echo $vid ?>"></form>'
|
||||||
|
),
|
||||||
// issue 103
|
// issue 103
|
||||||
array(
|
array(
|
||||||
'<load target="http://aaa.com/aaa.js" />',
|
'<load target="http://aaa.com/aaa.js" />',
|
||||||
'<!--#Meta:http://aaa.com/aaa.js--><?php $__tmp=array(\'http://aaa.com/aaa.js\',\'\',\'\',\'\',\'\',\'\',\'\');Context::loadFile($__tmp);unset($__tmp); ?>'
|
'<!--#Meta:http://aaa.com/aaa.js--><?php $__tmp=array(\'http://aaa.com/aaa.js\',\'\',\'\',\'\');Context::loadFile($__tmp,\'\',\'\',\'\');unset($__tmp); ?>'
|
||||||
),
|
),
|
||||||
// issue 135
|
// issue 135
|
||||||
array(
|
array(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue