From 043a0a320744d0f5f4214898210edd8a907b8030 Mon Sep 17 00:00:00 2001
From: fantu <fantu@ispconfig3>
Date: Tue, 23 Dec 2008 03:12:18 -0500
Subject: [PATCH] replace function deprecated in php 5.3

---
 server/lib/classes/tpl.inc.php                    |    2 +-
 server/lib/classes/tpl_cache.inc.php              |    4 ++--
 interface/lib/classes/tpl_cache.inc.php           |    2 +-
 server/lib/classes/file.inc.php                   |    4 ++--
 server/mods-available/monitor_core_module.inc.php |    4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/interface/lib/classes/tpl_cache.inc.php b/interface/lib/classes/tpl_cache.inc.php
index 49c5e5d..18e7d38 100644
--- a/interface/lib/classes/tpl_cache.inc.php
+++ b/interface/lib/classes/tpl_cache.inc.php
@@ -161,7 +161,7 @@
         $filepath = dirname($file);
         if (is_dir($filepath)) return true;
 
-        $dirs = split('[\\/]', $filepath);
+        $dirs = preg_split('/[\\/]/', $filepath);
         $currpath;
         foreach ($dirs as $dir) {
             $currpath .= $dir .'/';
diff --git a/server/lib/classes/file.inc.php b/server/lib/classes/file.inc.php
index 67a973c..ba84c59 100644
--- a/server/lib/classes/file.inc.php
+++ b/server/lib/classes/file.inc.php
@@ -300,13 +300,13 @@
            return $passed;
        }
        if (is_string($exts)) {
-           if (eregi("\.". $exts ."$", $filename)) {
+           if (preg_match("/\.". $exts ."$/i", $filename)) {
                            $passed = TRUE;
                return $passed;
            }
        } else if (is_array($exts)) {
            foreach ($exts as $theExt) {
-               if (eregi("\.". $theExt ."$", $filename)) {
+               if (preg_match("/\.". $theExt ."$/i", $filename)) {
                    $passed = TRUE;
                    return $passed;
                }
diff --git a/server/lib/classes/tpl.inc.php b/server/lib/classes/tpl.inc.php
index f4b4063..9a0b212 100644
--- a/server/lib/classes/tpl.inc.php
+++ b/server/lib/classes/tpl.inc.php
@@ -1193,7 +1193,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;
                 break;
diff --git a/server/lib/classes/tpl_cache.inc.php b/server/lib/classes/tpl_cache.inc.php
index a4c6eec..18e7d38 100644
--- a/server/lib/classes/tpl_cache.inc.php
+++ b/server/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;
     }
@@ -161,7 +161,7 @@
         $filepath = dirname($file);
         if (is_dir($filepath)) return true;
 
-        $dirs = split('[\\/]', $filepath);
+        $dirs = preg_split('/[\\/]/', $filepath);
         $currpath;
         foreach ($dirs as $dir) {
             $currpath .= $dir .'/';
diff --git a/server/mods-available/monitor_core_module.inc.php b/server/mods-available/monitor_core_module.inc.php
index e85e172..7a886fa 100644
--- a/server/mods-available/monitor_core_module.inc.php
+++ b/server/mods-available/monitor_core_module.inc.php
@@ -262,7 +262,7 @@
         $memInfo = explode("\n", $miData);
 
         foreach($memInfo as $line){
-            $part = split(":", $line);
+            $part = preg_split("/:/", $line);
             $key = trim($part[0]);
             $tmp = explode(" ", trim($part[1]));
             $value = 0;
@@ -312,7 +312,7 @@
         $cpuInfo = explode("\n", $cpuData);
 
         foreach($cpuInfo as $line){
-            $part = split(":", $line);
+            $part = preg_split("/:/", $line);
             $key = trim($part[0]);
             $value = trim($part[1]);
             $data[$key] = $value;

--
Gitblit v1.9.1