[Svn] r4404 - trunk/roundcubemail/program/include

trac at roundcube.net trac at roundcube.net
Wed Jan 12 11:26:32 CET 2011


Author: alec
Date: 2011-01-12 04:26:32 -0600 (Wed, 12 Jan 2011)
New Revision: 4404

Modified:
   trunk/roundcubemail/program/include/rcube_template.php
Log:
- Remove some empty lines from output of template conditions


Modified: trunk/roundcubemail/program/include/rcube_template.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_template.php	2011-01-12 08:13:40 UTC (rev 4403)
+++ trunk/roundcubemail/program/include/rcube_template.php	2011-01-12 10:26:32 UTC (rev 4404)
@@ -526,7 +526,7 @@
      */
     private function parse_conditions($input)
     {
-        $matches = preg_split('/<roundcube:(if|elseif|else|endif)\s+([^>]+)>/is', $input, 2, PREG_SPLIT_DELIM_CAPTURE);
+        $matches = preg_split('/<roundcube:(if|elseif|else|endif)\s+([^>]+)>\n?/is', $input, 2, PREG_SPLIT_DELIM_CAPTURE);
         if ($matches && count($matches) == 4) {
             if (preg_match('/^(else|endif)$/i', $matches[1])) {
                 return $matches[0] . $this->parse_conditions($matches[3]);
@@ -534,10 +534,10 @@
             $attrib = parse_attrib_string($matches[2]);
             if (isset($attrib['condition'])) {
                 $condmet = $this->check_condition($attrib['condition']);
-                $submatches = preg_split('/<roundcube:(elseif|else|endif)\s+([^>]+)>/is', $matches[3], 2, PREG_SPLIT_DELIM_CAPTURE);
+                $submatches = preg_split('/<roundcube:(elseif|else|endif)\s+([^>]+)>\n?/is', $matches[3], 2, PREG_SPLIT_DELIM_CAPTURE);
                 if ($condmet) {
                     $result = $submatches[0];
-                    $result.= ($submatches[1] != 'endif' ? preg_replace('/.*<roundcube:endif\s+[^>]+>/Uis', '', $submatches[3], 1) : $submatches[3]);
+                    $result.= ($submatches[1] != 'endif' ? preg_replace('/.*<roundcube:endif\s+[^>]+>\n?/Uis', '', $submatches[3], 1) : $submatches[3]);
                 }
                 else {
                     $result = "<roundcube:$submatches[1] $submatches[2]>" . $submatches[3];

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list