From 059c4216d00218e7e2cb1f33b6f8b809a7db9917 Mon Sep 17 00:00:00 2001
From: fantu <fantu@ispconfig3>
Date: Mon, 22 Dec 2008 05:05:27 -0500
Subject: [PATCH] replace ereg how is deprecated in php 5.3 and removed in php 6

---
 interface/lib/classes/tpl.inc.php       |    2 +-
 interface/lib/classes/tpl_cache.inc.php |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/interface/lib/classes/tpl.inc.php b/interface/lib/classes/tpl.inc.php
index 9b2e751..e935240 100644
--- a/interface/lib/classes/tpl.inc.php
+++ b/interface/lib/classes/tpl.inc.php
@@ -1095,7 +1095,7 @@
 
             switch (strtolower($this->OPTIONS['UNKNOWNS'])) {
                 case 'comment':
-                    $comment = addcslashes('<!-- unknown variable '.ereg_replace('<!--|-->', '', $wholetag).'//-->', '"');
+                    $comment = addcslashes('<!-- unknown variable '.preg_replace('/<!--|-->/', '', $wholetag).'//-->', '"');
                     $retstr .= ' else { print("'.$comment.'"); $this->_setUnknown("'.$varname.'"); }';
                     return $retstr;
 
diff --git a/interface/lib/classes/tpl_cache.inc.php b/interface/lib/classes/tpl_cache.inc.php
index a4c6eec..49c5e5d 100644
--- a/interface/lib/classes/tpl_cache.inc.php
+++ b/interface/lib/classes/tpl_cache.inc.php
@@ -82,7 +82,7 @@
      * @return boolean
      */
     function setCacheExtension($str = null) {
-        if ($str == null || !ereg('^[a-z0-9]+$', strtolower($str))) return false;
+        if ($str == null || !preg_match('/^[a-z0-9]+$/', strtolower($str))) return false;
         $this->OPTIONS['CACHE_EXTENSION'] = strtolower($str);
         return true;
     }

--
Gitblit v1.9.1