diff --git a/NEWS b/NEWS index 53312692..75806073 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - moved strip from smarty core to plugin (Monte) - moved config_load from smarty core to plugin (Monte) - added &$repeat-paramter to block-functions (messju) - enabled hex-constants in function.math.php (messju) diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 37e47940..fdc1d763 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1281,7 +1281,7 @@ class Smarty * @param string $scope */ function config_load($file, $section = null, $scope = 'global') - { + { require_once($this->_get_plugin_filepath('function', 'config_load')); smarty_function_config_load(array('file' => $file, 'section' => $section, 'scope' => $scope), $this); } diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index ae530619..6e92b196 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -307,26 +307,6 @@ class Smarty_Compiler extends Smarty { } $template_compiled .= $text_blocks[$i]; - /* Reformat data between 'strip' and '/strip' tags, removing spaces, tabs and newlines. */ - if (preg_match_all("!{$ldq}strip{$rdq}.*?{$ldq}/strip{$rdq}!s", $template_compiled, $_match)) { - $strip_tags = $_match[0]; - $_strip_search = array( - '%([^\\\\]\?>)\n%', // remove newlines after PHP close tags - "!{$ldq}/?strip{$rdq}|[\t ]+$|^[\t ]+!m", // remove leading/trailing space chars - '%[\r\n]+%m', // remove CRs and newlines - '%([^\\\\]\?>)%'); // replace newlines after PHP close tags - $_strip_replace = array( - '\\1', - '', - '', - '\\1' . "\n"); - $strip_tags_modified = preg_replace($_strip_search, $_strip_replace, $strip_tags); - for ($i = 0, $for_max = count($strip_tags); $i < $for_max; $i++) - $template_compiled = preg_replace("!{$ldq}strip{$rdq}.*?{$ldq}/strip{$rdq}!s", - $this->quote_replace($strip_tags_modified[$i]), - $template_compiled, 1); - } - // remove \n from the end of the file, if any if ($template_compiled{strlen($template_compiled) - 1} == "\n" ) { $template_compiled = substr($template_compiled, 0, -1); @@ -474,10 +454,6 @@ class Smarty_Compiler extends Smarty { else return ""; - case 'strip': - case '/strip': - return $this->left_delimiter.$tag_command.$this->right_delimiter; - case 'literal': list (,$literal_block) = each($this->_literal_blocks); $this->_current_line_no += substr_count($literal_block, "\n"); diff --git a/libs/plugins/block.textformat.php b/libs/plugins/block.textformat.php index 055ce82d..88101381 100644 --- a/libs/plugins/block.textformat.php +++ b/libs/plugins/block.textformat.php @@ -70,9 +70,8 @@ function smarty_block_textformat($params, $content, &$this) if($assign != null) { $this->assign($assign,$output); } else { - echo $output; + return $output; } - //echo $content; } /* vim: set expandtab: */