#! /bin/sh /usr/share/dpatch/dpatch-run ## php5.3-deprecated-ereg.dpatch by Hendrik Frenzel ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: changes deprecated ereg() to preg_match() for use with php >= 5.3 @DPATCH@ diff -urNad nagvis-1.4.6~/nagvis/includes/classes/GlobalMainCfg.php nagvis-1.4.6/nagvis/includes/classes/GlobalMainCfg.php --- nagvis-1.4.6~/nagvis/includes/classes/GlobalMainCfg.php 2010-02-04 21:51:13.000000000 +0100 +++ nagvis-1.4.6/nagvis/includes/classes/GlobalMainCfg.php 2010-03-01 18:06:16.000000000 +0100 @@ -791,15 +791,15 @@ // loop given elements for checking: => all given attributes valid foreach($vars AS $key => $val) { - if(!ereg('^comment_',$key)) { - if(ereg('^backend_', $type)) { + if(!preg_match('/^comment_/',$key)) { + if(preg_match('/^backend_/', $type)) { if(isset($this->validConfig['backend']['options'][$this->getValue($type,'backendtype')]) && is_array($this->validConfig['backend']['options'][$this->getValue($type,'backendtype')])) { $arrValidConfig = array_merge($this->validConfig['backend'], $this->validConfig['backend']['options'][$this->getValue($type,'backendtype')]); } else { $arrValidConfig = $this->validConfig['backend']; } - } elseif(ereg('^rotation_', $type)) { + } elseif(preg_match('/^rotation_/', $type)) { $arrValidConfig = $this->validConfig['rotation']; } else { $arrValidConfig = $this->validConfig[$type]; @@ -821,7 +821,7 @@ return FALSE; } else { // Workaround to get the configured string back - if(ereg('^rotation_', $type) && $key == 'maps') { + if(preg_match('/^rotation_/', $type) && $key == 'maps') { foreach($val AS $intId => $arrStep) { if(isset($arrStep['label']) && $arrStep['label'] != '') { $label = $arrStep['label'].':'; diff -urNad nagvis-1.4.6~/wui/form_handler.php nagvis-1.4.6/wui/form_handler.php --- nagvis-1.4.6~/wui/form_handler.php 2010-02-04 21:51:13.000000000 +0100 +++ nagvis-1.4.6/wui/form_handler.php 2010-03-01 18:06:39.000000000 +0100 @@ -252,7 +252,7 @@ // is status for this map there? $file = file($CORE->MAINCFG->getValue('paths', 'mapcfg').'autobackup.status'); foreach($file AS $key => $val) { - if(ereg("^".$mapname."=",$val)) { + if(preg_match("/^".$mapname."=/",$val)) { // $arr[1] is value $arr = explode('=',$val);