5 * @subpackage plugins
\r
9 * Smarty {strip}{/strip} block plugin
\r
11 * Type: block function<br>
\r
13 * Purpose: strip unwanted white space from text<br>
\r
14 * @link http://smarty.php.net/manual/en/language.function.strip.php {strip}
\r
15 * (Smarty online manual)
\r
16 * @param array unused, no parameters for this block
\r
17 * @param string content of {strip}{/strip} tags
\r
18 * @param Smarty clever method emulation
\r
19 * @return string $content stripped of whitespace
\r
21 function smarty_block_strip($params, $content, &$this)
\r
23 /* Reformat data between 'strip' and '/strip' tags, removing spaces, tabs and newlines. */
\r
24 $_strip_search = array(
\r
25 "![\t ]+$|^[\t ]+!m", // remove leading/trailing space chars
\r
26 '%[\r\n]+%m'); // remove CRs and newlines
\r
27 $_strip_replace = array(
\r
30 return preg_replace($_strip_search, $_strip_replace, $content);
\r
33 /* vim: set expandtab: */
\r