mirror of
https://github.com/smarty-php/smarty.git
synced 2026-04-21 08:58:58 +02:00
- update for PHP 5.4 compatibility
- reformat source to PSR-2 standard
This commit is contained in:
@@ -53,17 +53,17 @@ function smarty_block_textformat($params, $content, $template, &$repeat)
|
||||
case 'indent_char':
|
||||
case 'wrap_char':
|
||||
case 'assign':
|
||||
$$_key = (string)$_val;
|
||||
$$_key = (string) $_val;
|
||||
break;
|
||||
|
||||
case 'indent':
|
||||
case 'indent_first':
|
||||
case 'wrap':
|
||||
$$_key = (int)$_val;
|
||||
$$_key = (int) $_val;
|
||||
break;
|
||||
|
||||
case 'wrap_cut':
|
||||
$$_key = (bool)$_val;
|
||||
$$_key = (bool) $_val;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -78,7 +78,6 @@ function smarty_block_textformat($params, $content, $template, &$repeat)
|
||||
$_paragraphs = preg_split('![\r\n]{2}!', $content);
|
||||
$_output = '';
|
||||
|
||||
|
||||
foreach ($_paragraphs as &$_paragraph) {
|
||||
if (!$_paragraph) {
|
||||
continue;
|
||||
@@ -102,12 +101,10 @@ function smarty_block_textformat($params, $content, $template, &$repeat)
|
||||
}
|
||||
}
|
||||
$_output = implode($wrap_char . $wrap_char, $_paragraphs);
|
||||
|
||||
|
||||
if ($assign) {
|
||||
$template->assign($assign, $_output);
|
||||
} else {
|
||||
return $_output;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user