Gettext plugin enabling internationalization in Smarty Package files. Smarty-gettext is a module that provides gettext support to Smarty, the popular PHP template engine.
I would like to see the following small improvements to the switch statement in block.t.php:
add the case 'no'. i got the options from the switch statement rather than reading the notes at the top so it is not obvious about using the no case
add // This is the default case (set above) to the 'html' case so it is easier to know that this is the default one because usually you have a 'default' case in these statements
switch ($escape) {
case 'html':
// This is the default case (set above)
$text = nl2br(htmlspecialchars($text));
break;
case 'javascript':
case 'js':
// javascript escape
$text = strtr($text, array('\\' => '\\\\', "'" => "\\'", '"' => '\\"', "\r" => '\\r', "\n" => '\\n', '</' => '<\/'));
break;
case 'url':
// url escape
$text = urlencode($text);
break;
case 'no':
// no escaping
break;
}
I would like to see the following small improvements to the switch statement in
block.t.php
:case 'no'
. i got the options from the switch statement rather than reading the notes at the top so it is not obvious about using theno case
// This is the default case (set above)
to the'html' case
so it is easier to know that this is the default one because usually you have a'default'
case in these statements