diff --git a/common/framework/parsers/template/TemplateParser_v2.php b/common/framework/parsers/template/TemplateParser_v2.php
index 108075f27..24cf085fc 100644
--- a/common/framework/parsers/template/TemplateParser_v2.php
+++ b/common/framework/parsers/template/TemplateParser_v2.php
@@ -784,7 +784,9 @@ class TemplateParser_v2
$escape_option = $filter;
break;
case 'escapejs':
+ case 'js':
$str = "escape_js({$str})";
+ $escape_option = 'noescape';
break;
case 'json':
$str = "json_encode({$str}, \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES)";
diff --git a/modules/admin/controllers/maintenance/Cleanup.php b/modules/admin/controllers/maintenance/Cleanup.php
index 87a0422c1..26595408f 100644
--- a/modules/admin/controllers/maintenance/Cleanup.php
+++ b/modules/admin/controllers/maintenance/Cleanup.php
@@ -361,6 +361,8 @@ class Cleanup extends Base
'modules/spamfilter/spamfilter.lib.php' => 'deleted',
'modules/spamfilter/ruleset/' => 'deleted',
'phpDoc/' => 'deleted:xe',
+ 'tests/unit/classes/template/' => 'deleted',
+ 'tests/unit/classes/TemplateHandlerTest.php' => 'deleted',
'tools/dbxml_validator/' => 'deleted:xe',
'tools/korea_ip_ranges/' => 'deleted',
'tools/phpDoc/' => 'deleted',
diff --git a/tests/unit/classes/template/css/style.css b/tests/_data/template/css/style.css
similarity index 100%
rename from tests/unit/classes/template/css/style.css
rename to tests/_data/template/css/style.css
diff --git a/tests/unit/classes/template/sample.html b/tests/_data/template/sample.html
similarity index 100%
rename from tests/unit/classes/template/sample.html
rename to tests/_data/template/sample.html
diff --git a/tests/unit/classes/TemplateHandlerTest.php b/tests/unit/framework/parsers/TemplateParserV1Test.php
similarity index 90%
rename from tests/unit/classes/TemplateHandlerTest.php
rename to tests/unit/framework/parsers/TemplateParserV1Test.php
index c0d0151a2..03b75336e 100644
--- a/tests/unit/classes/TemplateHandlerTest.php
+++ b/tests/unit/framework/parsers/TemplateParserV1Test.php
@@ -1,13 +1,13 @@
baseurl = '/' . basename(dirname(dirname(dirname(__DIR__)))) . '/';
+ $this->baseurl = '/' . basename(dirname(dirname(dirname(dirname(__DIR__))))) . '/';
}
public function testParse()
@@ -101,42 +101,42 @@ class TemplateHandlerTest extends \Codeception\TestCase\Test
// #include
array(
'
This is another dummy
',
- '?>compile(\'tests/unit/classes/template\',\'sample.html\') ?>This is another dummy
'
+ '?>compile(\'tests/_data/template\',\'sample.html\') ?>This is another dummy
'
),
//
array(
'This is another dummy
',
- '?>compile(\'tests/unit/classes\',\'sample.html\') ?>This is another dummy
'
+ '?>compile(\'tests/_data\',\'sample.html\') ?>This is another dummy
'
),
//
array(
- '',
+ '',
'?>'
),
//
array(
'',
- '?>'
+ '?>'
),
//
array(
'',
- '?>'
+ '?>'
),
//
array(
- '',
+ '',
'?>compile(); ?>'
),
//
array(
'',
- '?>'
+ '?>'
),
//
array(
'',
- '?>'
+ '?>'
),
// comment
array(
@@ -151,11 +151,11 @@ class TemplateHandlerTest extends \Codeception\TestCase\Test
// relative path1
array(
'
',
- '?>
'
+ '?>
'
),
// relative path2
array(
- '
',
+ '
',
'?>
'
),
// error case
@@ -211,12 +211,12 @@ class TemplateHandlerTest extends \Codeception\TestCase\Test
// issue 512 - ignores