[geeklog-cvs] geeklog: Catch errors (e.g. new config elements when the templat...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Mon Feb 15 05:00:45 EST 2010


changeset 7723:37141ece518b
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/37141ece518b
user: Dirk Haun <dirk at haun-online.de>
date: Mon Feb 15 10:18:46 2010 +0100
description:
Catch errors (e.g. new config elements when the templates haven't been updated)

diffstat:

 system/classes/template.class.php |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r a387ff3c56bf -r 37141ece518b system/classes/template.class.php
--- a/system/classes/template.class.php	Sun Feb 14 20:15:17 2010 +0100
+++ b/system/classes/template.class.php	Mon Feb 15 10:18:46 2010 +0100
@@ -306,7 +306,10 @@
 
     $str = $this->get_var($parent);
     $reg = "/[ \t]*<!--\s+BEGIN $varname\s+-->\s*?\n?(\s*.*?\n?)\s*<!--\s+END $varname\s+-->\s*?\n?/sm";
-    preg_match_all($reg, $str, $m);
+    $matches = preg_match_all($reg, $str, $m);
+    if (($matches === false) || ($matches == 0)) {
+        return false;
+    }
     $str = str_replace($m[0][0], '{' . $name . '}', $str);
     $this->set_var($varname, $m[1][0]);
     $this->set_var($parent, $str);



More information about the geeklog-cvs mailing list