Code

Rework package configuration
[pkg-nagvis.git] / debian / patches / php5.3-deprecated-ereg.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## php5.3-deprecated-ereg.dpatch by Hendrik Frenzel <hfrenzel@scunc.net>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: changes deprecated ereg() to preg_match() for use with php >= 5.3
7 @DPATCH@
8 diff -urNad nagvis-1.4.6~/nagvis/includes/classes/GlobalMainCfg.php nagvis-1.4.6/nagvis/includes/classes/GlobalMainCfg.php
9 --- nagvis-1.4.6~/nagvis/includes/classes/GlobalMainCfg.php     2010-02-04 21:51:13.000000000 +0100
10 +++ nagvis-1.4.6/nagvis/includes/classes/GlobalMainCfg.php      2010-03-01 18:06:16.000000000 +0100
11 @@ -791,15 +791,15 @@
12                                         
13                                         // loop given elements for checking: => all given attributes valid
14                                         foreach($vars AS $key => $val) {
15 -                                               if(!ereg('^comment_',$key)) {
16 -                                                       if(ereg('^backend_', $type)) {
17 +                                               if(!preg_match('/^comment_/',$key)) {
18 +                                                       if(preg_match('/^backend_/', $type)) {
19                                                                 if(isset($this->validConfig['backend']['options'][$this->getValue($type,'backendtype')]) 
20                                                                          && is_array($this->validConfig['backend']['options'][$this->getValue($type,'backendtype')])) {
21                                                                         $arrValidConfig = array_merge($this->validConfig['backend'], $this->validConfig['backend']['options'][$this->getValue($type,'backendtype')]);
22                                                                 } else {
23                                                                         $arrValidConfig = $this->validConfig['backend'];
24                                                                 }
25 -                                                       } elseif(ereg('^rotation_', $type)) {
26 +                                                       } elseif(preg_match('/^rotation_/', $type)) {
27                                                                 $arrValidConfig = $this->validConfig['rotation'];
28                                                         } else {
29                                                                 $arrValidConfig = $this->validConfig[$type];
30 @@ -821,7 +821,7 @@
31                                                                 return FALSE;
32                                                         } else {
33                                                                 // Workaround to get the configured string back
34 -                                                               if(ereg('^rotation_', $type) && $key == 'maps') {
35 +                                                               if(preg_match('/^rotation_/', $type) && $key == 'maps') {
36                                                                         foreach($val AS $intId => $arrStep) {
37                                                                                 if(isset($arrStep['label']) && $arrStep['label'] != '') {
38                                                                                         $label = $arrStep['label'].':';
39 diff -urNad nagvis-1.4.6~/wui/form_handler.php nagvis-1.4.6/wui/form_handler.php
40 --- nagvis-1.4.6~/wui/form_handler.php  2010-02-04 21:51:13.000000000 +0100
41 +++ nagvis-1.4.6/wui/form_handler.php   2010-03-01 18:06:39.000000000 +0100
42 @@ -252,7 +252,7 @@
43                         // is status for this map there?
44                         $file = file($CORE->MAINCFG->getValue('paths', 'mapcfg').'autobackup.status');
45                         foreach($file AS $key => $val) {
46 -                               if(ereg("^".$mapname."=",$val)) {
47 +                               if(preg_match("/^".$mapname."=/",$val)) {
48                                         // $arr[1] is value
49                                         $arr = explode('=',$val);
50