Skip to content

Commit 043a0a3

Browse files
author
fantu
committed
replace function deprecated in php 5.3
1 parent d4417cd commit 043a0a3

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

interface/lib/classes/tpl_cache.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function _prepareDirs($file) {
161161
$filepath = dirname($file);
162162
if (is_dir($filepath)) return true;
163163

164-
$dirs = split('[\\/]', $filepath);
164+
$dirs = preg_split('/[\\/]/', $filepath);
165165
$currpath;
166166
foreach ($dirs as $dir) {
167167
$currpath .= $dir .'/';

server/lib/classes/file.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,13 @@ function checkFileExtension($filename, $exts, $ext_save = 1){
300300
return $passed;
301301
}
302302
if (is_string($exts)) {
303-
if (eregi("\.". $exts ."$", $filename)) {
303+
if (preg_match("/\.". $exts ."$/i", $filename)) {
304304
$passed = TRUE;
305305
return $passed;
306306
}
307307
} else if (is_array($exts)) {
308308
foreach ($exts as $theExt) {
309-
if (eregi("\.". $theExt ."$", $filename)) {
309+
if (preg_match("/\.". $theExt ."$/i", $filename)) {
310310
$passed = TRUE;
311311
return $passed;
312312
}

server/lib/classes/tpl.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ function _parseVar ($wholetag, $tag, $varname, $escape, $format, $namespace) {
11931193

11941194
switch (strtolower($this->OPTIONS['UNKNOWNS'])) {
11951195
case 'comment':
1196-
$comment = addcslashes('<!-- unknown variable '.ereg_replace('<!--|-->', '', $wholetag).'//-->', '"');
1196+
$comment = addcslashes('<!-- unknown variable '.preg_replace('/<!--|-->/', '', $wholetag).'//-->', '"');
11971197
$retstr .= ' else { print("'.$comment.'"); $this->_setUnknown("'.$varname.'"); }';
11981198
return $retstr;
11991199
break;

server/lib/classes/tpl_cache.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function setCacheLifeTime($int = null) {
8282
* @return boolean
8383
*/
8484
function setCacheExtension($str = null) {
85-
if ($str == null || !ereg('^[a-z0-9]+$', strtolower($str))) return false;
85+
if ($str == null || !preg_match('/^[a-z0-9]+$/', strtolower($str))) return false;
8686
$this->OPTIONS['CACHE_EXTENSION'] = strtolower($str);
8787
return true;
8888
}
@@ -161,7 +161,7 @@ function _prepareDirs($file) {
161161
$filepath = dirname($file);
162162
if (is_dir($filepath)) return true;
163163

164-
$dirs = split('[\\/]', $filepath);
164+
$dirs = preg_split('/[\\/]/', $filepath);
165165
$currpath;
166166
foreach ($dirs as $dir) {
167167
$currpath .= $dir .'/';

server/mods-available/monitor_core_module.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ function monitorMemUsage()
262262
$memInfo = explode("\n", $miData);
263263

264264
foreach($memInfo as $line){
265-
$part = split(":", $line);
265+
$part = preg_split("/:/", $line);
266266
$key = trim($part[0]);
267267
$tmp = explode(" ", trim($part[1]));
268268
$value = 0;
@@ -312,7 +312,7 @@ function monitorCpu()
312312
$cpuInfo = explode("\n", $cpuData);
313313

314314
foreach($cpuInfo as $line){
315-
$part = split(":", $line);
315+
$part = preg_split("/:/", $line);
316316
$key = trim($part[0]);
317317
$value = trim($part[1]);
318318
$data[$key] = $value;

0 commit comments

Comments
 (0)