Commit 043a0a32 authored by fantu's avatar fantu

replace function deprecated in php 5.3

parent d4417cdb
......@@ -161,7 +161,7 @@ class tplc extends tpl {
$filepath = dirname($file);
if (is_dir($filepath)) return true;
$dirs = split('[\\/]', $filepath);
$dirs = preg_split('/[\\/]/', $filepath);
$currpath;
foreach ($dirs as $dir) {
$currpath .= $dir .'/';
......
......@@ -300,13 +300,13 @@ class file{
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;
}
......
......@@ -1193,7 +1193,7 @@ if (!defined('vlibTemplateClassLoaded')) {
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;
......
......@@ -82,7 +82,7 @@ class tplc extends tpl {
* @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 @@ class tplc extends tpl {
$filepath = dirname($file);
if (is_dir($filepath)) return true;
$dirs = split('[\\/]', $filepath);
$dirs = preg_split('/[\\/]/', $filepath);
$currpath;
foreach ($dirs as $dir) {
$currpath .= $dir .'/';
......
......@@ -262,7 +262,7 @@ class monitor_core_module {
$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 @@ class monitor_core_module {
$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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment