diff --git a/library/smarty/libs/plugins/outputfilter.trimwhitespace.php b/library/smarty/libs/plugins/outputfilter.trimwhitespace.php new file mode 100644 --- /dev/null +++ b/library/smarty/libs/plugins/outputfilter.trimwhitespace.php @@ -0,0 +1,89 @@ +.*?#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { + foreach ($matches as $match) { + $store[] = $match[0][0]; + $_length = strlen($match[0][0]); + $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@'; + $source = substr_replace($source, $replace, $match[0][1] - $_offset, $_length); + + $_offset += $_length - strlen($replace); + $_store++; + } + } + + // Strip all HTML-Comments + // yes, even the ones in