]> git.sur5r.net Git - contagged/blobdiff - inc/smarty/plugins/outputfilter.trimwhitespace.php
Upgrade smarty from 2.6.18 to 2.6.30
[contagged] / inc / smarty / plugins / outputfilter.trimwhitespace.php
index 97b0d21e8495185671a190b90db9c426a73482a1..739fa39b021a36fe24d8b39efee9363f1aab8cc1 100644 (file)
 function smarty_outputfilter_trimwhitespace($source, &$smarty)
 {
     // Pull out the script blocks
-    preg_match_all("!<script[^>]+>.*?</script>!is", $source, $match);
+    preg_match_all("!<script[^>]*?>.*?</script>!is", $source, $match);
     $_script_blocks = $match[0];
-    $source = preg_replace("!<script[^>]+>.*?</script>!is",
+    $source = preg_replace("!<script[^>]*?>.*?</script>!is",
                            '@@@SMARTY:TRIM:SCRIPT@@@', $source);
 
     // Pull out the pre blocks
-    preg_match_all("!<pre>.*?</pre>!is", $source, $match);
+    preg_match_all("!<pre[^>]*?>.*?</pre>!is", $source, $match);
     $_pre_blocks = $match[0];
-    $source = preg_replace("!<pre>.*?</pre>!is",
+    $source = preg_replace("!<pre[^>]*?>.*?</pre>!is",
                            '@@@SMARTY:TRIM:PRE@@@', $source);
-
+    
     // Pull out the textarea blocks
-    preg_match_all("!<textarea[^>]+>.*?</textarea>!is", $source, $match);
+    preg_match_all("!<textarea[^>]*?>.*?</textarea>!is", $source, $match);
     $_textarea_blocks = $match[0];
-    $source = preg_replace("!<textarea[^>]+>.*?</textarea>!is",
+    $source = preg_replace("!<textarea[^>]*?>.*?</textarea>!is",
                            '@@@SMARTY:TRIM:TEXTAREA@@@', $source);
 
     // remove all leading spaces, tabs and carriage returns NOT