Index: /trunk/include/smarty/NEWS
===================================================================
--- /trunk/include/smarty/NEWS	(revision 2537)
+++ /trunk/include/smarty/NEWS	(revision 2538)
@@ -1,2 +1,14 @@
+Version 2.6.20 (Aug 15th, 2008)
+-------------------------------
+
+- fix cache tag bug when multiple cache tags on a page (mankyd,
+  mohrt)
+- fix /e tag checking when using arrays with regex_replace
+  (mohrt)
+- fix that function results can be used with condition like "is even" in 
+  {if} tags (U.Tews)
+- fix handling of non-empty <pre>-tags and empty <textarea>- and
+  <script>-tags (Spuerhund, messju)
+
 Version 2.6.19 (Feb 11th, 2008)
 -------------------------------
Index: /trunk/include/smarty/README
===================================================================
--- /trunk/include/smarty/README	(revision 2537)
+++ /trunk/include/smarty/README	(revision 2538)
@@ -3,5 +3,5 @@
     Smarty - the PHP compiling template engine
 
-VERSION: 2.6.19
+VERSION: 2.6.20
 
 AUTHORS:
Index: /trunk/include/smarty/libs/Config_File.class.php
===================================================================
--- /trunk/include/smarty/libs/Config_File.class.php	(revision 2537)
+++ /trunk/include/smarty/libs/Config_File.class.php	(revision 2538)
@@ -19,5 +19,5 @@
  *
  * @link http://smarty.php.net/
- * @version 2.6.19
+ * @version 2.6.20
  * @copyright Copyright: 2001-2005 New Digital Group, Inc.
  * @author Andrei Zmievski <andrei@php.net>
@@ -26,5 +26,5 @@
  */
 
-/* $Id$ */
+/* $Id: Config_File.class.php 2702 2007-03-08 19:11:22Z mohrt $ */
 
 /**
Index: /trunk/include/smarty/libs/Smarty.class.php
===================================================================
--- /trunk/include/smarty/libs/Smarty.class.php	(revision 2537)
+++ /trunk/include/smarty/libs/Smarty.class.php	(revision 2538)
@@ -28,8 +28,8 @@
  * @author Andrei Zmievski <andrei@php.net>
  * @package Smarty
- * @version 2.6.19
+ * @version 2.6.20
  */
 
-/* $Id$ */
+/* $Id: Smarty.class.php 2722 2007-06-18 14:29:00Z danilo $ */
 
 /**
@@ -465,5 +465,5 @@
      * @var string
      */
-    var $_version              = '2.6.19';
+    var $_version              = '2.6.20';
 
     /**
@@ -1058,5 +1058,5 @@
             // var non-existant, return valid reference
             $_tmp = null;
-            return $_tmp;
+            return $_tmp;   
         }
     }
@@ -1117,5 +1117,5 @@
     {
         static $_cache_info = array();
-
+        
         $_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(isset($this->error_reporting)
                ? $this->error_reporting : error_reporting() & ~E_NOTICE);
@@ -1941,8 +1941,8 @@
         return eval($code);
     }
-
+    
     /**
      * Extracts the filter name from the given callback
-     *
+     * 
      * @param callback $function
      * @return string
@@ -1959,5 +1959,5 @@
 		}
 	}
-
+    
     /**#@-*/
 
Index: /trunk/include/smarty/libs/Smarty_Compiler.class.php
===================================================================
--- /trunk/include/smarty/libs/Smarty_Compiler.class.php	(revision 2537)
+++ /trunk/include/smarty/libs/Smarty_Compiler.class.php	(revision 2538)
@@ -22,10 +22,10 @@
  * @author Monte Ohrt <monte at ohrt dot com>
  * @author Andrei Zmievski <andrei@php.net>
- * @version 2.6.19
+ * @version 2.6.20
  * @copyright 2001-2005 New Digital Group, Inc.
  * @package Smarty
  */
 
-/* $Id$ */
+/* $Id: Smarty_Compiler.class.php 2773 2008-08-12 18:17:51Z Uwe.Tews $ */
 
 /**
@@ -1364,7 +1364,12 @@
                        expression. The start of the expression is on the stack.
                        Otherwise, we operate on the last encountered token. */
-                    if ($tokens[$i-1] == ')')
+                    if ($tokens[$i-1] == ')') {
                         $is_arg_start = array_pop($is_arg_stack);
-                    else
+                        if ($is_arg_start != 0) {
+                            if (preg_match('~^' . $this->_func_regexp . '$~', $tokens[$is_arg_start-1])) {
+                                $is_arg_start--;
+                            } 
+                        } 
+                    } else
                         $is_arg_start = $i-1;
                     /* Construct the argument for 'is' expression, so it knows
Index: /trunk/include/smarty/libs/internals/core.process_compiled_include.php
===================================================================
--- /trunk/include/smarty/libs/internals/core.process_compiled_include.php	(revision 2537)
+++ /trunk/include/smarty/libs/internals/core.process_compiled_include.php	(revision 2538)
@@ -26,5 +26,5 @@
     }
 
-    foreach ($smarty->_cache_serials as $_include_file_path=>$_cache_serial) {
+    foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) {
         $_return = preg_replace_callback('!(\{nocache\:('.$_cache_serial.')#(\d+)\})!s',
                                          array(&$smarty, '_process_compiled_include_callback'),
Index: /trunk/include/smarty/libs/plugins/modifier.regex_replace.php
===================================================================
--- /trunk/include/smarty/libs/plugins/modifier.regex_replace.php	(revision 2537)
+++ /trunk/include/smarty/libs/plugins/modifier.regex_replace.php	(revision 2538)
@@ -23,4 +23,16 @@
 function smarty_modifier_regex_replace($string, $search, $replace)
 {
+    if(is_array($search)) {
+      foreach($search as $idx => $s)
+        $search[$idx] = _smarty_regex_replace_check($s);
+    } else {
+      $search = _smarty_regex_replace_check($search);
+    }       
+
+    return preg_replace($search, $replace, $string);
+}
+
+function _smarty_regex_replace_check($search)
+{
     if (($pos = strpos($search,"\0")) !== false)
       $search = substr($search,0,$pos);
@@ -29,6 +41,5 @@
         $search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]);
     }
-       
-    return preg_replace($search, $replace, $string);
+    return $search;
 }
 
Index: /trunk/include/smarty/libs/plugins/outputfilter.trimwhitespace.php
===================================================================
--- /trunk/include/smarty/libs/plugins/outputfilter.trimwhitespace.php	(revision 2537)
+++ /trunk/include/smarty/libs/plugins/outputfilter.trimwhitespace.php	(revision 2538)
@@ -29,19 +29,19 @@
 {
     // 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);
 
