Skip to content

Commit

Permalink
Enable PHPjs template for test and define escapeHtml used in the temp…
Browse files Browse the repository at this point in the history
…late.

We have disabled time date functions since we don't have very working version of strftime
  • Loading branch information
Uma committed Dec 7, 2014
1 parent 6557f5b commit edd5516
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions test/js/test-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function getData(){
'textWithHTMLEntities': 'Germans use "mlauts" and pay in €uro',
'testPath': path.normalize(__dirname + '/../templates'),
'testClassObj': new TestClassObj,
'escapeHtml': '<span style="color:red;"><i><b>foo</b></i></span>',
};
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/test-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ process('insert');
process('mailto');
process('math');
process('modifiers');
//process('phpjs');
process('phpjs');
process('plugins');
process('rldelim');
process('setfilter');
Expand Down
1 change: 1 addition & 0 deletions test/php/test-common.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
$smarty->assign('textWithHTML','<span style="color:red;"><i><b>foo</b></i></span>');
$smarty->assign('textWithHTMLEntities', 'Germans use &quot;mlauts&quot; and pay in &euro;uro');
$smarty->assign('testPath', dirname(__DIR__).'/templates');
$smarty->assign('escapeHtml', '<span style="color:red;"><i><b>foo</b></i></span>');

$smarty->assign(
'books',
Expand Down
8 changes: 5 additions & 3 deletions test/templates/phpjs.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@


{'&\'<>'|escape:htmlall}

{'<b>text_to_replace</b>'|replace:'text_to_replace':'replaced'|escape:htmlall}


{'url&#$_ -+='|escape:url}

{'abcd/url&#$_ -+=/efgh'|escape:urlpathinfo}
Expand All @@ -28,7 +30,7 @@
{"<a\"b'c/>"|escape:javascript}

{'billgates@microsoft.com, stevejobs@apple.com'|escape:mail}

{*
{$time = 1314697269}
{$time|date_format}
{$time|date_format:"%D"}
Expand All @@ -39,7 +41,7 @@
{"6/3/1976"|date_format:'%A, %B %e, %Y'}
{"6/3/1976 13:13:13"|date_format:'%H:%M %A, %B %e, %Y'}
{"19760603131313"|date_format:'%H:%M %A, %B %e, %Y'} //mysql timestamp format of YYYYMMDDHHMMSS


*}
---------- escape HTML --------------------
[{$escapeHtml}]

0 comments on commit edd5516

Please sign in to comment.