mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
add javascript escape parameter to escape modifier
This commit is contained in:
10
NEWS
10
NEWS
@@ -1,11 +1,13 @@
|
||||
- add javascript parameter to escape modifier (Monte)
|
||||
- added correct line numbers to syntax error messages
|
||||
in compiler (Monte)
|
||||
- added support for modifiers to function calls (Monte)
|
||||
- support return value for custom functions (Monte)
|
||||
- can access constants via $smarty.const.FOO (Monte)
|
||||
- cleaned up regex code in compiler (Monte)
|
||||
- can now pass modifiers to static content,
|
||||
among other minor syntax features (monte)
|
||||
- fix up regex code in compiler, make much more flexible
|
||||
(Monte)
|
||||
- can now pass modifiers to static content (Monte)
|
||||
- fix up regex code in compiler, more flexible and
|
||||
maintainable (Monte)
|
||||
- added support for object method access (Monte)
|
||||
- added day_value_format to html_select_date (Marcus
|
||||
Bointon, Monte)
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<style-specification id="docbook-smarty-html" use="docbook">
|
||||
<style-specification-body>
|
||||
|
||||
(define %html-ext% ".html")
|
||||
(define %html-ext% ".php")
|
||||
|
||||
&html-common.dsl;
|
||||
&common.dsl;
|
||||
|
@@ -37,6 +37,10 @@ function smarty_modifier_escape($string, $esc_type = 'html')
|
||||
}
|
||||
return $return;
|
||||
|
||||
case 'javascript':
|
||||
// escape quotes and backslashes and newlines
|
||||
return str_replace(array('\\','\'',"\r","\n"), array("\\\\", "\\'",'\r','\r'), $string);
|
||||
|
||||
default:
|
||||
return $string;
|
||||
}
|
||||
|
@@ -37,6 +37,10 @@ function smarty_modifier_escape($string, $esc_type = 'html')
|
||||
}
|
||||
return $return;
|
||||
|
||||
case 'javascript':
|
||||
// escape quotes and backslashes and newlines
|
||||
return str_replace(array('\\','\'',"\r","\n"), array("\\\\", "\\'",'\r','\r'), $string);
|
||||
|
||||
default:
|
||||
return $string;
|
||||
}
|
||||
|
Reference in New Issue
Block a user