diff --git a/contrib/smarty/plugins/block.t.php b/contrib/smarty/plugins/block.t.php index ca7382aebd602f7453c43141e33d1176c2db1a30..39ad2ebaf731c6a5c97710903bb9f14b41b2e17c 100644 --- a/contrib/smarty/plugins/block.t.php +++ b/contrib/smarty/plugins/block.t.php @@ -26,7 +26,7 @@ * @author Sagi Bashari <sagi@boom.org.il> * @copyright 2004-2005 Sagi Bashari */ - + /** * Replaces arguments in a string with their values. * Arguments are represented by % followed by their number. @@ -42,7 +42,7 @@ function smarty_gettext_strarg($str) for ($i=1; $i < func_num_args(); $i++) { $arg = func_get_arg($i); - + if (is_array($arg)) { foreach ($arg as $aarg) { $tr['%'.++$p] = $aarg; @@ -51,7 +51,7 @@ function smarty_gettext_strarg($str) $tr['%'.++$p] = $arg; } } - + return strtr($str, $tr); } @@ -60,7 +60,7 @@ function smarty_gettext_strarg($str) * * The block content is the text that should be translated. * - * Any parameter that is sent to the function will be represented as %n in the translation text, + * Any parameter that is sent to the function will be represented as %n in the translation text, * where n is 1 for the first parameter. The following parameters are reserved: * - escape - sets escape mode: * - 'html' for HTML escaping, this is the default. @@ -72,26 +72,29 @@ function smarty_gettext_strarg($str) */ function smarty_block_t($params, $text, &$smarty) { + if($text === NULL) { + return; + } $text = stripslashes($text); - + // set escape mode if (isset($params['escape'])) { $escape = $params['escape']; unset($params['escape']); } - + // set plural version if (isset($params['plural'])) { $plural = $params['plural']; unset($params['plural']); - + // set count if (isset($params['count'])) { $count = $params['count']; unset($params['count']); } } - + // use plural if required parameters are set if (isset($count) && isset($plural)) { $text = ngettext($text, $plural, $count); @@ -119,7 +122,7 @@ function smarty_block_t($params, $text, &$smarty) break; } } - + return $text; }