diff --git a/GPL_LIB/Smarty/libs/Smarty.class.php b/GPL_LIB/Smarty/libs/Smarty.class.php index a66380f1213df11394614be803f1ee92ddd19d38..a5603dc4355a4f33593fcc7f1ac81bd30c205893 100644 --- a/GPL_LIB/Smarty/libs/Smarty.class.php +++ b/GPL_LIB/Smarty/libs/Smarty.class.php @@ -1617,7 +1617,7 @@ class Smarty function _parse_resource_name(&$params) { - // split tpl_path by the first colon + // preg_split tpl_path by the first colon $_resource_name_parts = explode(':', $params['resource_name'], 2); if (count($_resource_name_parts) == 1) { @@ -1744,7 +1744,7 @@ class Smarty if(isset($auto_id)) { // make auto_id safe for directory names $auto_id = str_replace('%7C',$_compile_dir_sep,(urlencode($auto_id))); - // split into separate directories + // preg_split into separate directories $_return .= $auto_id . $_compile_dir_sep; } diff --git a/GPL_LIB/Smarty/libs/Smarty_Compiler.class.php b/GPL_LIB/Smarty/libs/Smarty_Compiler.class.php index 06dc44bf7987c587ff0d00adcaade06ef41ec461..5fc8f0bcb534f84ef9c83e191bef7bb508ecceb1 100644 --- a/GPL_LIB/Smarty/libs/Smarty_Compiler.class.php +++ b/GPL_LIB/Smarty/libs/Smarty_Compiler.class.php @@ -272,8 +272,8 @@ class Smarty_Compiler extends Smarty { /* Gather all template tags. */ preg_match_all("~{$ldq}\s*(.*?)\s*{$rdq}~s", $source_content, $_match); $template_tags = $_match[1]; - /* Split content by template tags to obtain non-template content. */ - $text_blocks = preg_split("~{$ldq}.*?{$rdq}~s", $source_content); + /* preg_split content by template tags to obtain non-template content. */ + $text_blocks = preg_preg_split("~{$ldq}.*?{$rdq}~s", $source_content); /* loop through text blocks */ for ($curr_tb = 0, $for_max = count($text_blocks); $curr_tb < $for_max; $curr_tb++) { @@ -438,7 +438,7 @@ class Smarty_Compiler extends Smarty { if (substr($template_tag, 0, 1) == '*' && substr($template_tag, -1) == '*') return ''; - /* Split tag into two three parts: command, command modifiers and the arguments. */ + /* preg_split tag into two three parts: command, command modifiers and the arguments. */ if(! preg_match('~^(?:(' . $this->_num_const_regexp . '|' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '|\/?' . $this->_reg_obj_regexp . '|\/?' . $this->_func_regexp . ')(' . $this->_mod_regexp . '*)) (?:\s+(.*))?$ @@ -1706,7 +1706,7 @@ class Smarty_Compiler extends Smarty { function _parse_var($var_expr) { $_has_math = false; - $_math_vars = preg_split('~('.$this->_dvar_math_regexp.'|'.$this->_qstr_regexp.')~', $var_expr, -1, PREG_SPLIT_DELIM_CAPTURE); + $_math_vars = preg_preg_split('~('.$this->_dvar_math_regexp.'|'.$this->_qstr_regexp.')~', $var_expr, -1, PREG_preg_split_DELIM_CAPTURE); if(count($_math_vars) > 1) { $_first_var = ""; diff --git a/GPL_LIB/Smarty/libs/internals/core.assign_smarty_interface.php b/GPL_LIB/Smarty/libs/internals/core.assign_smarty_interface.php index 2266ff425068b9326a4718f1b21aa8d52433eab1..5056ca02e1cbc9a572cf4a1e572d019524f8b85e 100644 --- a/GPL_LIB/Smarty/libs/internals/core.assign_smarty_interface.php +++ b/GPL_LIB/Smarty/libs/internals/core.assign_smarty_interface.php @@ -28,7 +28,7 @@ function smarty_core_assign_smarty_interface($params, &$smarty) $_smarty_vars_request = array(); - foreach (preg_split('!!', strtolower($smarty->request_vars_order)) as $_c) { + foreach (preg_preg_split('!!', strtolower($smarty->request_vars_order)) as $_c) { if (isset($_globals_map[$_c])) { $_smarty_vars_request = array_merge($_smarty_vars_request, $GLOBALS[$_globals_map[$_c]]); } diff --git a/GPL_LIB/Smarty/libs/internals/core.create_dir_structure.php b/GPL_LIB/Smarty/libs/internals/core.create_dir_structure.php index abc2850c1debd3f245099b88ad2aab25b69150e2..06b695c931e3bc28607fa8f64ec3f03d2a686a34 100644 --- a/GPL_LIB/Smarty/libs/internals/core.create_dir_structure.php +++ b/GPL_LIB/Smarty/libs/internals/core.create_dir_structure.php @@ -21,7 +21,7 @@ function smarty_core_create_dir_structure($params, &$smarty) if (DIRECTORY_SEPARATOR=='/') { /* unix-style paths */ $_dir = $params['dir']; - $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY); + $_dir_parts = preg_preg_split('!/+!', $_dir, -1, PREG_preg_split_NO_EMPTY); $_new_dir = (substr($_dir, 0, 1)=='/') ? '/' : getcwd().'/'; if($_use_open_basedir = !empty($_open_basedir_ini)) { $_open_basedirs = explode(':', $_open_basedir_ini); @@ -30,7 +30,7 @@ function smarty_core_create_dir_structure($params, &$smarty) } else { /* other-style paths */ $_dir = str_replace('\\','/', $params['dir']); - $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY); + $_dir_parts = preg_preg_split('!/+!', $_dir, -1, PREG_preg_split_NO_EMPTY); if (preg_match('!^((//)|([a-zA-Z]:/))!', $_dir, $_root_dir)) { /* leading "//" for network volume, or "[letter]:/" for full path */ $_new_dir = $_root_dir[1]; diff --git a/GPL_LIB/Smarty/libs/internals/core.write_cache_file.php b/GPL_LIB/Smarty/libs/internals/core.write_cache_file.php index 4cf3601d5e0884c437ebc6a4f5b28bf23e1ff206..d142701154c3ec1ec3c561cd5a334ac1adb5275d 100644 --- a/GPL_LIB/Smarty/libs/internals/core.write_cache_file.php +++ b/GPL_LIB/Smarty/libs/internals/core.write_cache_file.php @@ -39,7 +39,7 @@ function smarty_core_write_cache_file($params, &$smarty) // smarty_core_process_compiled_includes() on a cache-read $match_count = count($match[0]); - $results = preg_split('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!', $params['results'], -1, PREG_SPLIT_DELIM_CAPTURE); + $results = preg_preg_split('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!', $params['results'], -1, PREG_preg_split_DELIM_CAPTURE); $level = 0; $j = 0; diff --git a/GPL_LIB/Smarty/libs/plugins/block.textformat.php b/GPL_LIB/Smarty/libs/plugins/block.textformat.php index d06474db32f806894180f94c1ab8eef8392330fc..41697bff33f6c73befc7fd6c5fa7ba6da73de7dc 100644 --- a/GPL_LIB/Smarty/libs/plugins/block.textformat.php +++ b/GPL_LIB/Smarty/libs/plugins/block.textformat.php @@ -71,8 +71,8 @@ function smarty_block_textformat($params, $content, &$smarty) $wrap = 72; } - // split into paragraphs - $_paragraphs = preg_split('![\r\n][\r\n]!',$content); + // preg_split into paragraphs + $_paragraphs = preg_preg_split('![\r\n][\r\n]!',$content); $_output = ''; for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) { diff --git a/GPL_LIB/Smarty/libs/plugins/function.fetch.php b/GPL_LIB/Smarty/libs/plugins/function.fetch.php index c8f345b90344d885799978eaa03a08c33c2847aa..0539ddabc6431864d6bfa20c207a6ecfedd224e5 100644 --- a/GPL_LIB/Smarty/libs/plugins/function.fetch.php +++ b/GPL_LIB/Smarty/libs/plugins/function.fetch.php @@ -181,12 +181,12 @@ function smarty_function_fetch($params, &$smarty) $content .= fgets($fp,4096); } fclose($fp); - $csplit = split("\r\n\r\n",$content,2); + $cpreg_split = preg_split("\r\n\r\n",$content,2); - $content = $csplit[1]; + $content = $cpreg_split[1]; if(!empty($params['assign_headers'])) { - $smarty->assign($params['assign_headers'],split("\r\n",$csplit[0])); + $smarty->assign($params['assign_headers'],preg_split("\r\n",$cpreg_split[0])); } } } else { diff --git a/GPL_LIB/Smarty/libs/plugins/function.html_select_date.php b/GPL_LIB/Smarty/libs/plugins/function.html_select_date.php index 16ada704c3f0b74ce238be0ad749a8df62efb847..ca1215d0803e42707bafca8d67a319131a0df11f 100644 --- a/GPL_LIB/Smarty/libs/plugins/function.html_select_date.php +++ b/GPL_LIB/Smarty/libs/plugins/function.html_select_date.php @@ -145,7 +145,7 @@ function smarty_function_html_select_date($params, &$smarty) // strftime to make yyyy-mm-dd $time = strftime('%Y-%m-%d', smarty_make_timestamp($time)); } - // Now split this in pieces, which later can be used to set the select + // Now preg_split this in pieces, which later can be used to set the select $time = explode("-", $time); // make syntax "+N" or "-N" work with start_year and end_year diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.count_paragraphs.php b/GPL_LIB/Smarty/libs/plugins/modifier.count_paragraphs.php index 8a8bef65d1181298b7ee3dd12626e33b16407a32..ce3078b8da52777f66863401b1f0e34ee8cc30d3 100644 --- a/GPL_LIB/Smarty/libs/plugins/modifier.count_paragraphs.php +++ b/GPL_LIB/Smarty/libs/plugins/modifier.count_paragraphs.php @@ -21,7 +21,7 @@ function smarty_modifier_count_paragraphs($string) { // count \r or \n characters - return count(preg_split('/[\r\n]+/', $string)); + return count(preg_preg_split('/[\r\n]+/', $string)); } /* vim: set expandtab: */ diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.count_words.php b/GPL_LIB/Smarty/libs/plugins/modifier.count_words.php index 8e006e88f1278e48d4931a5165e3a43b84b8c2d6..495a24d003145bc3aa0e869ea565d2da137502c2 100644 --- a/GPL_LIB/Smarty/libs/plugins/modifier.count_words.php +++ b/GPL_LIB/Smarty/libs/plugins/modifier.count_words.php @@ -20,10 +20,10 @@ */ function smarty_modifier_count_words($string) { - // split text by ' ',\r,\n,\f,\t - $split_array = preg_split('/\s+/',$string); + // preg_split text by ' ',\r,\n,\f,\t + $preg_split_array = preg_preg_split('/\s+/',$string); // count matches that contain alphanumerics - $word_count = preg_grep('/[a-zA-Z0-9\\x80-\\xff]/', $split_array); + $word_count = preg_grep('/[a-zA-Z0-9\\x80-\\xff]/', $preg_split_array); return count($word_count); } diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.spacify.php b/GPL_LIB/Smarty/libs/plugins/modifier.spacify.php index ab386d23086fea7e67698bd7755e1cf717e4f33a..0de7b7ce019782e302707a1ffab22853279546f7 100644 --- a/GPL_LIB/Smarty/libs/plugins/modifier.spacify.php +++ b/GPL_LIB/Smarty/libs/plugins/modifier.spacify.php @@ -22,7 +22,7 @@ function smarty_modifier_spacify($string, $spacify_char = ' ') { return implode($spacify_char, - preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY)); + preg_preg_split('//', $string, -1, PREG_preg_split_NO_EMPTY)); } /* vim: set expandtab: */ diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.truncate.php b/GPL_LIB/Smarty/libs/plugins/modifier.truncate.php index 56647cae36d4dd3d3ac7772cf5eb6e6be89253fb..30adb357a44720086b0665436627874be1697ee2 100644 --- a/GPL_LIB/Smarty/libs/plugins/modifier.truncate.php +++ b/GPL_LIB/Smarty/libs/plugins/modifier.truncate.php @@ -12,7 +12,7 @@ * Type: modifier<br /> * Name: truncate<br /> * Purpose: Truncate a string to a certain length if necessary, - * optionally splitting in the middle of a word, and + * optionally preg_splitting in the middle of a word, and * appending the $etc string or inserting $etc into the middle. * @link http://smarty.php.net/manual/en/language.modifier.truncate.php * truncate (Smarty online manual) diff --git a/cron/centAcl.php b/cron/centAcl.php index a6a91b7cca3179f251210ee1fc8af6e272755a7b..0d890365bc0100c9a2064290f5079e51574ef3da 100644 --- a/cron/centAcl.php +++ b/cron/centAcl.php @@ -587,7 +587,7 @@ if ($str != "") { $str .= ', '; } - $id_tmp = split(",", $t); + $id_tmp = preg_split(",", $t); $str .= "('".$host."', '".addslashes($desc)."', '".$id_tmp[0]."' , '".$id_tmp[1]."' , ".$acl_group_id.") "; $i++; if ($i >= 1000) { diff --git a/libinstall/check_pear.php b/libinstall/check_pear.php index b4e83b3f9e39126c1816fcc5f5a7b11d09631e55..ad70d96e9ffd23fc4bdb60cc8b8959eec127d083 100755 --- a/libinstall/check_pear.php +++ b/libinstall/check_pear.php @@ -46,7 +46,7 @@ function get_list($file) { $packages = array(); $fd = fopen($file, 'r'); while ($line = fgets($fd)) { - list($name, $version, $status) = split('::', trim($line)); + list($name, $version, $status) = preg_split('::', trim($line)); $package = array('name' => $name, 'version' => $version); if ($status) { $package['status'] = $status; diff --git a/www/class/centreon.class.php b/www/class/centreon.class.php index aaf29689bab4e9bb4e66bdafebbde6824a7bce3a..37cd6bdf19563c9102d8c5937bf6878a331a1dde 100644 --- a/www/class/centreon.class.php +++ b/www/class/centreon.class.php @@ -225,7 +225,7 @@ class Centreon { $DBRESULT = $pearDB->query("SELECT illegal_object_name_chars FROM cfg_nagios"); while ($data = $DBRESULT->fetchRow()) { - $tab = str_split(html_entity_decode($data['illegal_object_name_chars'], ENT_QUOTES, "UTF-8")); + $tab = str_preg_split(html_entity_decode($data['illegal_object_name_chars'], ENT_QUOTES, "UTF-8")); foreach ($tab as $char) { $name = str_replace($char, "", $name); } diff --git a/www/class/centreonDowntime.class.php b/www/class/centreonDowntime.class.php index 1e923b01ced29184113ba36608d455f9d22772b6..bc2c6b08e95284d7fbc0ba05f979c361e5c0f2b7 100644 --- a/www/class/centreonDowntime.class.php +++ b/www/class/centreonDowntime.class.php @@ -200,7 +200,7 @@ class CentreonDowntime $days = $row['dtp_day_of_week']; /* Make a array if the cycle is all */ if ($row['dtp_month_cycle'] == 'all') { - $days = split(',', $days); + $days = preg_split(',', $days); } $start_time = substr($row['dtp_start_time'], 0, strrpos($row['dtp_start_time'], ':')); $end_time = substr($row['dtp_end_time'], 0, strrpos($row['dtp_end_time'], ':')); @@ -209,7 +209,7 @@ class CentreonDowntime 'end_time' => $end_time, 'day_of_week' => $days, 'month_cycle' => $row['dtp_month_cycle'], - 'day_of_month' => split(',', $row['dtp_day_of_month']), + 'day_of_month' => preg_split(',', $row['dtp_day_of_month']), 'fixed' => $row['dtp_fixed'], 'duration' => $row['dtp_duration'] ); diff --git a/www/class/centreonExternalCommand.class.php b/www/class/centreonExternalCommand.class.php index 658dc47639265ef867009fe34c53000f42716e15..e71f29757a53bd491176ea592444b95072853505 100644 --- a/www/class/centreonExternalCommand.class.php +++ b/www/class/centreonExternalCommand.class.php @@ -290,7 +290,7 @@ class CentreonExternalCommand { */ public function DeleteDowntime($type, $hosts = array()){ foreach ($hosts as $key => $value) { - $res = split(";", $key); + $res = preg_split(";", $key); $poller_id = $this->getPollerID($res[0]); $this->set_process_command("DEL_".$type."_DOWNTIME;".$res[1], $poller_id); } @@ -303,9 +303,9 @@ class CentreonExternalCommand { * @param string $string */ private function getDate($string) { - $res = preg_split("/ /", $string); - $res3 = preg_split("/\//", $res[0]); - $res4 = preg_split("/:/", $res[1]); + $res = preg_preg_split("/ /", $string); + $res3 = preg_preg_split("/\//", $res[0]); + $res4 = preg_preg_split("/:/", $res[1]); $end_time = mktime($res4[0], $res4[1], "0", $res3[1], $res3[2], $res3[0]); unset($res); return $end_time; diff --git a/www/class/centreonGraph.class.php b/www/class/centreonGraph.class.php index f7826688f459aa8e318da97f093b8bf5cf61c873..9e967783ef282ecff549c43f6c802c81429db799 100644 --- a/www/class/centreonGraph.class.php +++ b/www/class/centreonGraph.class.php @@ -308,7 +308,7 @@ class CentreonGraph { foreach( $this->metricsEnabled as $l_id ) { if ( preg_match("/^v/",$l_id) ) { $l_vmEnabled[] = $l_id; - + } else { $l_rmEnabled[] = $l_id; } @@ -322,7 +322,7 @@ class CentreonGraph { $l_vselector = "vmetric_id IN (".implode(",", array_map(array("CentreonGraph", "vquote"), $l_vmEnabled)).")"; $this->_log("initCurveList with selector [virtual]= ".$l_vselector); } - + } else { /* Full Image */ $l_rselector = "index_id = '".$this->index."'"; @@ -335,7 +335,7 @@ class CentreonGraph { $DBRESULT = $this->DBC->query("SELECT host_id, service_id, metric_id, metric_name, unit_name, warn, crit FROM metrics AS m, index_data AS i WHERE index_id = id AND ".$l_rselector." AND m.hidden = '0' ORDER BY m.metric_name"); while ($rmetric = $DBRESULT->fetchRow()){ $this->mlist[$rmetric["metric_id"]] = $this->mpointer[0]++; - $this->rmetrics[] = $rmetric; + $this->rmetrics[] = $rmetric; } $DBRESULT->free(); } @@ -710,7 +710,7 @@ class CentreonGraph { /* * Graph is based on a module check point */ - $tab = split("_", $this->indexData["service_description"]); + $tab = preg_split("_", $this->indexData["service_description"]); $DBRESULT = $this->DB->query("SELECT graph_id FROM meta_service WHERE meta_id = '".$tab[1]."'"); $tempRes = $DBRESULT->fetchRow(); $DBRESULT->free(); @@ -809,7 +809,7 @@ class CentreonGraph { $fond = imagecolorallocate($image,0xEF,0xF2,0xFB); $textcolor = imagecolorallocate($image, 0, 0, 255); // imagestring($image, 5, 0, 0, "Session: ".$_GET['session_id']."svc_id: ".$_GET["index"], $textcolor); - + /* * Send Header */ @@ -929,7 +929,7 @@ class CentreonGraph { $commandLine .= " ".$arg." "; } - $commandLine = ereg_replace("(\\\$|`)", "", $commandLine); + $commandLine = preg_replace("/(\\\$|`)/", "", $commandLine); if ($this->GMT->used()) $commandLine = "export TZ='CMT".$this->GMT->getMyGMTForRRD()."' ; ".$commandLine; @@ -1017,7 +1017,7 @@ class CentreonGraph { } private function subsRPN($rpn, $vname, $suffix = NULL) { - $l_list = split(",",$rpn); + $l_list = preg_split(",",$rpn); $l_rpn = ""; $l_err = 0; foreach( $l_list as $l_m) { @@ -1063,7 +1063,7 @@ class CentreonGraph { $l_indd = $l_poqy->fetchRow(); $l_poqy->free(); /* Check for real or virtual metric(s) in the RPN function */ - $l_mlist = split(",",$l_vmetric["rpn_function"]); + $l_mlist = preg_split(",",$l_vmetric["rpn_function"]); foreach ( $l_mlist as $l_mnane ) { /* Check for a real metric */ $l_poqy = $this->DBC->query("SELECT host_id, service_id, metric_id, metric_name, unit_name, warn, crit FROM metrics AS m, index_data as i WHERE index_id = id AND index_id = '".$l_vmetric["index_id"]."' AND metric_name = '".$l_mnane."'"); diff --git a/www/class/centreonHost.class.php b/www/class/centreonHost.class.php index 65725efd8a5e085f3578b129de42f041d9ef8d28..02fe6b1662a34ff660774a8b6569d32d5492c285 100644 --- a/www/class/centreonHost.class.php +++ b/www/class/centreonHost.class.php @@ -116,7 +116,7 @@ public function checkIllegalChar($host_name, $poller_id = null) { $DBRESULT = $this->DB->query("SELECT illegal_object_name_chars FROM cfg_nagios"); while ($data = $DBRESULT->fetchRow()) { - $tab = str_split(html_entity_decode($data['illegal_object_name_chars'], ENT_QUOTES, "UTF-8")); + $tab = str_preg_split(html_entity_decode($data['illegal_object_name_chars'], ENT_QUOTES, "UTF-8")); foreach ($tab as $char) { $host_name = str_replace($char, "", $host_name); } diff --git a/www/class/centreonMedia.class.php b/www/class/centreonMedia.class.php index 329273760560f10b9bac56bbbb7ff2fa9e2ab5c8..ba17a8e04a0645a32a19003069228244ad08052e 100644 --- a/www/class/centreonMedia.class.php +++ b/www/class/centreonMedia.class.php @@ -75,7 +75,7 @@ class CentreonMedia function getImageId($imagename, $dirname = null) { if (!isset($dirname)) { - $tab = split("/", $imagename); + $tab = preg_split("/", $imagename); isset($tab[0]) ? $dirname = $tab[0] : $dirname = null; isset($tab[1]) ? $imagename = $tab[1] : $imagename = null; } diff --git a/www/class/centreonService.class.php b/www/class/centreonService.class.php index c77d86a1deef985ecb61f49453375b7dd1250a65..4b2fb455a138462c5ad61702239b582b217c8632 100644 --- a/www/class/centreonService.class.php +++ b/www/class/centreonService.class.php @@ -109,7 +109,7 @@ public function checkIllegalChar($name) { $DBRESULT = $this->DB->query("SELECT illegal_object_name_chars FROM cfg_nagios"); while ($data = $DBRESULT->fetchRow()) { - $tab = str_split(html_entity_decode($data['illegal_object_name_chars'], ENT_QUOTES, "UTF-8")); + $tab = str_preg_split(html_entity_decode($data['illegal_object_name_chars'], ENT_QUOTES, "UTF-8")); foreach ($tab as $char) { $name = str_replace($char, "", $name); } diff --git a/www/class/centreonSession.class.php b/www/class/centreonSession.class.php index 2036b8d8ee52a9a3675bb50cb835914bae53c9d4..596b524ab3c33dc95579d6eeb1aee03a0efcdcd5 100644 --- a/www/class/centreonSession.class.php +++ b/www/class/centreonSession.class.php @@ -67,11 +67,13 @@ class CentreonSession } function unregister_var($register_var) { - session_unregister($register_var); + unset($_SESSION[$register_var]); } function register_var($register_var) { - session_register($register_var); + if (!isset($_SESSION[$register_var])) { + $_SESSION[$register_var] = $$register_var; + } } function checkSession($session_id, $pearDB) { diff --git a/www/header.php b/www/header.php index 7aee45658d2ddfcd3da45a5c113201edc97fc5f3..74694e1c4809a3abb285c221f64ffe7573c5af53 100644 --- a/www/header.php +++ b/www/header.php @@ -126,7 +126,7 @@ $p = NULL; } if (isset($root_menu["topology_url_opt"])) { - $tab = split("\=", $root_menu["topology_url_opt"]); + $tab = preg_split("\=", $root_menu["topology_url_opt"]); if (isset($tab[1])) { $o = $tab[1]; } diff --git a/www/include/Administration/corePerformance/getStats.php b/www/include/Administration/corePerformance/getStats.php index 89adf8ed4f0210bdcc361c677fdde9f9769756a4..97b5f1fe0d8872cf694db3b900747d2dd64fd64b 100644 --- a/www/include/Administration/corePerformance/getStats.php +++ b/www/include/Administration/corePerformance/getStats.php @@ -55,7 +55,7 @@ } foreach ($_GET as $key => $get){ - $tab = split(';', $_GET[$key]); + $tab = preg_split(';', $_GET[$key]); $_GET[$key] = $tab[0]; if (function_exists("filter_var")){ $_GET[$key] = filter_var($_GET[$key], FILTER_SANITIZE_SPECIAL_CHARS); @@ -76,7 +76,7 @@ */ function escape_command($command) { - return ereg_replace("(\\\$|`)", "", $command); + return preg_replace("/(\\\$|`)/", "", $command); } require_once "@CENTREON_ETC@/centreon.conf.php"; diff --git a/www/include/common/XmlTree/GetXmlTree.php b/www/include/common/XmlTree/GetXmlTree.php index 87a694fd596f02638d207b3772757d8a8c5df8a4..2617ea828652f7272cd753d06f7d576c6ac268ff 100644 --- a/www/include/common/XmlTree/GetXmlTree.php +++ b/www/include/common/XmlTree/GetXmlTree.php @@ -138,7 +138,7 @@ */ $data = getMyServiceGroupActivateServices($id); foreach ($data as $key => $value){ - $tab_value = split("_", $key); + $tab_value = preg_split("_", $key); $host_name = getMyHostName($tab_value[0]); $service_description = getMyServiceName($tab_value[1], $tab_value[0]); $buffer->startElement("item"); @@ -154,7 +154,7 @@ /* * get services for host */ - $tab_id = split('_', $id); + $tab_id = preg_split('_', $id); $id = $tab_id[0]; $services = getMyHostActiveServices($id); foreach ($services as $svc_id => $svc_name) { @@ -347,14 +347,14 @@ $buffer->startElement("tree"); $buffer->writeAttribute("id", "1"); - $tab_id = split(",",$url_var); + $tab_id = preg_split(",",$url_var); foreach ($tab_id as $openid) { $type = substr($openid, 0, 2); $id = substr($openid, 3, strlen($openid)); $buffer->writeElement("id", $id); - $id_full = split('_', $id); + $id_full = preg_split('_', $id); $id = $id_full[0]; if ($type == "HH") { @@ -457,7 +457,7 @@ */ if($host_open){ $services = getMyHostServices($host_id); - foreach($services as $svc_id => $svc_name) {//$tab_id = split(",",$openid); + foreach($services as $svc_id => $svc_name) {//$tab_id = preg_split(",",$openid); $buffer->startElement("item"); if (isset($svcs_selected[$svc_id])) $buffer->writeAttribute("checked", "1"); diff --git a/www/include/common/common-Func.php b/www/include/common/common-Func.php index bd40d7a5228da9f0ccd36fe6ba7b31f460bee91e..6bf57f7833a532e5b47850147381ab4326268291 100644 --- a/www/include/common/common-Func.php +++ b/www/include/common/common-Func.php @@ -1570,7 +1570,7 @@ if ($handle = opendir($chemintotal)) { while ($file = readdir($handle)) if (!is_dir("$chemintotal/$file") && strcmp($file, "index.php") && strcmp($file, "index.html") && strcmp($file, "index.ihtml")) { - $tab = split('\.', $file); + $tab = preg_split('\.', $file); $langs .= "-".$tab[0] . " "; } closedir($handle); @@ -1769,7 +1769,7 @@ function purgeVar($myVar){ $myVar = str_replace("\'", '', $myVar); $myVar = str_replace("\"", '', $myVar); - $tab_myVar = split(";", $myVar); + $tab_myVar = preg_split(";", $myVar); $mhost = $tab_myVar[0]; unset($tab_myVar); return $myVar; diff --git a/www/include/common/javascript/codebase/dhtmlxtree.php b/www/include/common/javascript/codebase/dhtmlxtree.php index 49ce0f49fde77fa8d2d6fbe0a2bfd3de3f4abf8a..bc5c344bfe06ba6e8c4408155b5e7e5021c178ab 100644 --- a/www/include/common/javascript/codebase/dhtmlxtree.php +++ b/www/include/common/javascript/codebase/dhtmlxtree.php @@ -62,13 +62,13 @@ function xmlPointer(data){this.d=data};xmlPointer.prototype={text:function(){if return escape(str);break}};dhtmlXTreeObject.prototype._drawNewTr=function(htmlObject,node) {var tr =document.createElement('tr');var td1=document.createElement('td');var td2=document.createElement('td');td1.appendChild(document.createTextNode(" "));td2.colSpan=3;td2.appendChild(htmlObject);tr.appendChild(td1);tr.appendChild(td2);return tr};dhtmlXTreeObject.prototype.loadXMLString=function(xmlString,afterCall){var that=this;if (!this.parsCount)this.callEvent("onXLS",[that,null]);this.xmlstate=1;if (afterCall)this.XMLLoader.waitCall=afterCall;this.XMLLoader.loadXMLString(xmlString)};dhtmlXTreeObject.prototype.loadXML=function(file,afterCall){if (this._datamode && this._datamode!="xml")return this["load"+this._datamode.toUpperCase()](file,afterCall);var that=this;if (!this.parsCount)this.callEvent("onXLS",[that,this._ld_id]);this._ld_id=null;this.xmlstate=1;this.XMLLoader=new dtmlXMLLoaderObject(this._parseXMLTree,this,true,this.no_cashe);if (afterCall)this.XMLLoader.waitCall=afterCall;this.XMLLoader.loadXML(file)};dhtmlXTreeObject.prototype._attachChildNode=function(parentObject,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,childs,beforeNode,afterNode){if (beforeNode && beforeNode.parentObject)parentObject=beforeNode.parentObject;if (((parentObject.XMLload==0)&&(this.XMLsource))&&(!this.XMLloadingWarning)) {parentObject.XMLload=1;this._loadDynXML(parentObject.id)};var Count=parentObject.childsCount;var Nodes=parentObject.childNodes;if (afterNode){if (afterNode.tr.previousSibling.previousSibling){beforeNode=afterNode.tr.previousSibling.nodem}else - optionStr=optionStr.replace("TOP","")+",TOP"};if (beforeNode){var ik,jk;for (ik=0;ik<Count;ik++)if (Nodes[ik]==beforeNode){for (jk=Count;jk!=ik;jk--)Nodes[1+jk]=Nodes[jk];break};ik++;Count=ik};if (optionStr){var tempStr=optionStr.split(",");for (var i=0;i<tempStr.length;i++){switch(tempStr[i]) + optionStr=optionStr.replace("TOP","")+",TOP"};if (beforeNode){var ik,jk;for (ik=0;ik<Count;ik++)if (Nodes[ik]==beforeNode){for (jk=Count;jk!=ik;jk--)Nodes[1+jk]=Nodes[jk];break};ik++;Count=ik};if (optionStr){var tempStr=optionStr.preg_split(",");for (var i=0;i<tempStr.length;i++){switch(tempStr[i]) {case "TOP": if (parentObject.childsCount>0){beforeNode=new Object;beforeNode.tr=parentObject.childNodes[0].tr.previousSibling};parentObject._has_top=true;for (ik=Count;ik>0;ik--)Nodes[ik]=Nodes[ik-1];Count=0;break}}};var n;if (!(n=this._idpull[itemId])|| n.span!=-1){n=Nodes[Count]=new dhtmlXTreeItemObject(itemId,itemText,parentObject,this,null,1);itemId = Nodes[Count].id;parentObject.childsCount++};if(!n.htmlNode){n.label=itemText;n.htmlNode=this._createItem((this.checkBoxOff?1:0),n);n.htmlNode.objBelong=n};if(image1)n.images[0]=image1;if(image2)n.images[1]=image2;if(image3)n.images[2]=image3;var tr=this._drawNewTr(n.htmlNode);if ((this.XMLloadingWarning)||(this._hAdI)) n.htmlNode.parentNode.parentNode.style.display="none";if ((beforeNode)&&(beforeNode.tr.nextSibling)) parentObject.htmlNode.childNodes[0].insertBefore(tr,beforeNode.tr.nextSibling);else if (this.parsingOn==parentObject.id){this.parsedArray[this.parsedArray.length]=tr}else parentObject.htmlNode.childNodes[0].appendChild(tr);if ((beforeNode)&&(!beforeNode.span)) beforeNode=null;if (this.XMLsource)if ((childs)&&(childs!=0)) n.XMLload=0;else n.XMLload=1;n.tr=tr;tr.nodem=n;if (parentObject.itemId==0)tr.childNodes[0].className="hiddenRow";if ((parentObject._r_logic)||(this._frbtr)) - this._setSrc(n.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.imPath+this.radioArray[0]);if (optionStr){var tempStr=optionStr.split(",");for (var i=0;i<tempStr.length;i++){switch(tempStr[i]) + this._setSrc(n.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.imPath+this.radioArray[0]);if (optionStr){var tempStr=optionStr.preg_split(",");for (var i=0;i<tempStr.length;i++){switch(tempStr[i]) {case "SELECT": this.selectItem(itemId,false);break;case "CALL": this.selectItem(itemId,true);break;case "CHILD": n.XMLload=0;break;case "CHECKED": if (this.XMLloadingWarning)this.setCheckList+=this.dlmtr+itemId;else this.setCheck(itemId,1);break;case "HCHECKED": @@ -84,7 +84,7 @@ function xmlPointer(data){this.d=data};xmlPointer.prototype={text:function(){if };dhtmlXTreeObject.prototype._parse=function(p,parentId,level,start){if (this._srnd && !this.parentObject.offsetHeight){var self=this;return window.setTimeout(function(){self._parse(p,parentId,level,start)},100)};if (!p.exists()) return;this.skipLock=true;this.parsCount=this.parsCount?(this.parsCount+1):1;this.XMLloadingWarning=1;this.nodeAskingCall="";if (!parentId){parentId=p.get("id");if (p.get("radio")) this.htmlNode._r_logic=true;this.parsingOn=parentId;this.parsedArray=new Array();this.setCheckList=""};var temp=this._globalIdStorageFind(parentId);if (!temp)return dhtmlxError.throwError("DataStructure","XML reffers to not existing parent");if ((temp.childsCount)&&(!start)&&(!this._edsbps)&&(!temp._has_top)) var preNode=temp.childNodes[temp.childsCount-1];else - var preNode=0;this.npl=0;p.each("item",function(c,i){temp.XMLload=1;if ((this._epgps)&&(this._epgpsC==this.npl)){this._setNextPageSign(temp,this.npl+1*(start||0),level,node);return -1};this._parseItem(c,temp,preNode);this.npl++},this,start);if (!level){p.each("userdata",function(u){this.setUserData(p.get("id"),u.get("name"),u.content())},this);temp.XMLload=1;if (this.waitUpdateXML){this.waitUpdateXML=false;for (var i=temp.childsCount-1;i>=0;i--)if (temp.childNodes[i]._dmark)this.deleteItem(temp.childNodes[i].id)};var parsedNodeTop=this._globalIdStorageFind(this.parsingOn);for (var i=0;i<this.parsedArray.length;i++)temp.htmlNode.childNodes[0].appendChild(this.parsedArray[i]);this.lastLoadedXMLId=parentId;this.XMLloadingWarning=0;var chArr=this.setCheckList.split(this.dlmtr);for (var n=0;n<chArr.length;n++)if (chArr[n])this.setCheck(chArr[n],1);if ((this.XMLsource)&&(this.tscheck)&&(this.smcheck)&&(temp.id!=this.rootId)){if (temp.checkstate===0)this._setSubChecked(0,temp);else if (temp.checkstate===1)this._setSubChecked(1,temp)};if (this.onXLE)this.onXLE(this,parentId);this._redrawFrom(this,null,start) + var preNode=0;this.npl=0;p.each("item",function(c,i){temp.XMLload=1;if ((this._epgps)&&(this._epgpsC==this.npl)){this._setNextPageSign(temp,this.npl+1*(start||0),level,node);return -1};this._parseItem(c,temp,preNode);this.npl++},this,start);if (!level){p.each("userdata",function(u){this.setUserData(p.get("id"),u.get("name"),u.content())},this);temp.XMLload=1;if (this.waitUpdateXML){this.waitUpdateXML=false;for (var i=temp.childsCount-1;i>=0;i--)if (temp.childNodes[i]._dmark)this.deleteItem(temp.childNodes[i].id)};var parsedNodeTop=this._globalIdStorageFind(this.parsingOn);for (var i=0;i<this.parsedArray.length;i++)temp.htmlNode.childNodes[0].appendChild(this.parsedArray[i]);this.lastLoadedXMLId=parentId;this.XMLloadingWarning=0;var chArr=this.setCheckList.preg_split(this.dlmtr);for (var n=0;n<chArr.length;n++)if (chArr[n])this.setCheck(chArr[n],1);if ((this.XMLsource)&&(this.tscheck)&&(this.smcheck)&&(temp.id!=this.rootId)){if (temp.checkstate===0)this._setSubChecked(0,temp);else if (temp.checkstate===1)this._setSubChecked(1,temp)};if (this.onXLE)this.onXLE(this,parentId);this._redrawFrom(this,null,start) if (p.get("order")&& p.get("order")!="none") @@ -175,7 +175,7 @@ function xmlPointer(data){this.d=data};xmlPointer.prototype={text:function(){if this.dADTempOff=true;this.dragAndDropOff=convertStringToBoolean(mode);if (this.dragAndDropOff)this.dragger.addDragLanding(this.allTree,this);if (arguments.length>1)this._ddronr=(!convertStringToBoolean(rmode))};dhtmlXTreeObject.prototype._setMove=function(htmlNode,x,y){if (htmlNode.parentObject.span){var a1=getAbsoluteTop(htmlNode);var a2=getAbsoluteTop(this.allTree);this.dadmodec=this.dadmode;this.dadmodefix=0;var zN=htmlNode.parentObject.span;zN.className+=" dragAndDropRow";this._lastMark=zN}};dhtmlXTreeObject.prototype._autoScroll=function(node,a1,a2){if (this.autoScroll){if (node){a1=getAbsoluteTop(node);a2=getAbsoluteTop(this.allTree)};if ( (a1-a2-parseInt(this.allTree.scrollTop))>(parseInt(this.allTree.offsetHeight)-50) ) this.allTree.scrollTop=parseInt(this.allTree.scrollTop)+20;if ( (a1-a2)<(parseInt(this.allTree.scrollTop)+30) ) this.allTree.scrollTop=parseInt(this.allTree.scrollTop)-20}};dhtmlXTreeObject.prototype._createDragNode=function(htmlObject,e){if (!this.dADTempOff)return null;var obj=htmlObject.parentObject;if (!obj.i_sel)this._selectItem(obj,e);var dragSpan=document.createElement('div');var text=new Array();if (this._itim_dg)for (var i=0;i<this._selected.length;i++)text[i]="<table cellspacing='0' cellpadding='0'><tr><td><img width='18px' height='18px' src='"+this._getSrc(this._selected[i].span.parentNode.previousSibling.childNodes[0])+"'></td><td>"+this._selected[i].span.innerHTML+"</td></tr><table>";else - text=this.getSelectedItemText().split(this.dlmtr);dragSpan.innerHTML=text.join("");dragSpan.style.position="absolute";dragSpan.className="dragSpanDiv";this._dragged=(new Array()).concat(this._selected);return dragSpan};dhtmlXTreeObject.prototype._focusNode=function(item){var z=getAbsoluteTop(item.htmlNode)-getAbsoluteTop(this.allTree);if ((z>(this.allTree.scrollTop+this.allTree.offsetHeight-30))||(z<this.allTree.scrollTop)) + text=this.getSelectedItemText().preg_split(this.dlmtr);dragSpan.innerHTML=text.join("");dragSpan.style.position="absolute";dragSpan.className="dragSpanDiv";this._dragged=(new Array()).concat(this._selected);return dragSpan};dhtmlXTreeObject.prototype._focusNode=function(item){var z=getAbsoluteTop(item.htmlNode)-getAbsoluteTop(this.allTree);if ((z>(this.allTree.scrollTop+this.allTree.offsetHeight-30))||(z<this.allTree.scrollTop)) this.allTree.scrollTop=z};dhtmlXTreeObject.prototype._preventNsDrag=function(e){if ((e)&&(e.preventDefault)) {e.preventDefault();return false};return false};dhtmlXTreeObject.prototype._drag=function(sourceHtmlObject,dhtmlObject,targetHtmlObject){if (this._autoOpenTimer)clearTimeout(this._autoOpenTimer);if (!targetHtmlObject.parentObject){targetHtmlObject=this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];this.dadmodec=0};this._clearMove();var z=sourceHtmlObject.parentObject.treeNod;if ((z)&&(z._clearMove)) z._clearMove("");if ((!this.dragMove)||(this.dragMove())) {if ((!z)||(!z._clearMove)||(!z._dragged)) var col=new Array(sourceHtmlObject.parentObject);else var col=z._dragged;var trg=targetHtmlObject.parentObject;for (var i=0;i<col.length;i++){var newID=this._moveNode(col[i],trg);if ((this.dadmodec)&&(newID!==false)) trg=this._globalIdStorageFind(newID,true,true);if ((newID)&&(!this._sADnD)) this.selectItem(newID,0,1)}};if (z)z._dragged=new Array()};dhtmlXTreeObject.prototype._dragIn=function(htmlObject,shtmlObject,x,y){if (!this.dADTempOff)return 0;var fobj=shtmlObject.parentObject;var tobj=htmlObject.parentObject;if ((!tobj)&&(this._ddronr)) return;if (!this.callEvent("onDragIn",[fobj.id,tobj?tobj.id:null,fobj.treeNod,this])) return 0;if (!tobj)this.allTree.className+=" selectionBox";else @@ -205,7 +205,7 @@ function xmlPointer(data){this.d=data};xmlPointer.prototype={text:function(){if {this.dhx_SeverCatcherPath="";this.attachEvent = function(original, catcher, CallObj) {if (this._onEventSet && this._onEventSet[original])this._onEventSet[original].apply(this,[]);CallObj = CallObj||this;original = 'ev_'+original;if ( ( !this[original] )|| ( !this[original].addEvent ) ) {var z = new this.eventCatcher(CallObj);z.addEvent( this[original] );this[original] = z};return ( original + ':' + this[original].addEvent(catcher) )};this.callEvent=function(name,a){if (this["ev_"+name])return this["ev_"+name].apply(this,a);return true};this.checkEvent=function(name){if (this["ev_"+name])return true;return false};this.eventCatcher = function(obj) {var dhx_catch = new Array();var m_obj = obj;var func_server = function(catcher,rpc) - {catcher = catcher.split(":");var postVar="";var postVar2="";var target=catcher[1];if (catcher[1]=="rpc"){postVar='<\?xml version="1.0"?><methodCall><methodName>'+catcher[2]+'</methodName><params>';postVar2="</params></methodCall>";target=rpc};var z = function() {var loader = new dtmlXMLLoaderObject( null, window, false );var request=postVar;if (postVar2){for (var i=0;i<arguments.length;i++)request += "<param><value><string>"+(arguments[i]?arguments[i].toString():"")+"</string></value></param>";request+=postVar2}else + {catcher = catcher.preg_split(":");var postVar="";var postVar2="";var target=catcher[1];if (catcher[1]=="rpc"){postVar='<\?xml version="1.0"?><methodCall><methodName>'+catcher[2]+'</methodName><params>';postVar2="</params></methodCall>";target=rpc};var z = function() {var loader = new dtmlXMLLoaderObject( null, window, false );var request=postVar;if (postVar2){for (var i=0;i<arguments.length;i++)request += "<param><value><string>"+(arguments[i]?arguments[i].toString():"")+"</string></value></param>";request+=postVar2}else for (var i=0;i<arguments.length;i++)request += ( '&arg'+i+'='+escape(arguments[i]));loader.loadXML( target, true, request,postVar2?true:false);try{if (postVar2){var dt=loader.doXPath("//methodResponse/params/param/value/string");return convertStringToBoolean(dt[0].firstChild.data)}else return convertStringToBoolean(loader.xmlDoc.responseText)}catch(e){dhtmlxError.throwError("rpcError",loader.xmlDoc.responseText);return false}};return z};var z = function() {if (dhx_catch)var res=true;for (var i=0;i<dhx_catch.length;i++){if (dhx_catch[i] != null){var zr = dhx_catch[i].apply( m_obj, arguments );res = res && zr}};return res};z.addEvent = function(ev) {if ( typeof(ev)!= "function" ) @@ -213,7 +213,7 @@ function xmlPointer(data){this.d=data};xmlPointer.prototype={text:function(){if ev = new func_server(ev,m_obj.rpcServer);else ev = eval(ev);if (ev)return dhx_catch.push( ev ) - 1;return false};z.removeEvent = function(id) {dhx_catch[id] = null};return z};this.detachEvent = function(id) - {if (id != false){var list = id.split(':');this[ list[0] ].removeEvent( list[1] )}}};//(c)dhtmlx ltd. www.dhtmlx.com + {if (id != false){var list = id.preg_split(':');this[ list[0] ].removeEvent( list[1] )}}};//(c)dhtmlx ltd. www.dhtmlx.com //v.1.6 build 71114 /* diff --git a/www/include/configuration/configDowntime/json.php b/www/include/configuration/configDowntime/json.php index 229799b8b1ad29a2e334bed14fd93cc83064559e..37a9d056e0c07930d0794e51f9c5eccc761e1363 100644 --- a/www/include/configuration/configDowntime/json.php +++ b/www/include/configuration/configDowntime/json.php @@ -654,7 +654,7 @@ class Services_JSON // OR we've reached the end of the character list $slice = substr($chrs, $top['where'], ($c - $top['where'])); array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false)); - //print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); + //print("Found preg_split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); if (reset($stk) == SERVICES_JSON_IN_ARR) { // we are in an array, so just push an element onto the stack diff --git a/www/include/configuration/configGenerate/DB-Func.php b/www/include/configuration/configGenerate/DB-Func.php index c06eac53b41b4bba7c775761f70c8293e1a26a28..9e62a911411739b0ed7f14cd35ae9f91b5f86f7d 100644 --- a/www/include/configuration/configGenerate/DB-Func.php +++ b/www/include/configuration/configGenerate/DB-Func.php @@ -110,7 +110,7 @@ function ComputeGMTTime($day, $daybefore, $dayafter, $gmt, $conf) { global $PeriodBefore, $PeriodAfter, $Period; - $tabPeriod = split(",", $conf); + $tabPeriod = preg_split(",", $conf); foreach ($tabPeriod as $period) { /* * Match hours diff --git a/www/include/configuration/configGenerate/formGenerateFiles.php b/www/include/configuration/configGenerate/formGenerateFiles.php index ce064709543ad43db083c4c178d67ee9ab9d1ee5..0973a7ef41d23b300a90aa6e4bffb8e7f7f32489 100644 --- a/www/include/configuration/configGenerate/formGenerateFiles.php +++ b/www/include/configuration/configGenerate/formGenerateFiles.php @@ -240,7 +240,7 @@ $msg_debug[$host['id']] = str_replace ("Total Errors: 0", "<font color='green'>Total Errors: 0</font>", $msg_debug[$host['id']]); $msg_debug[$host['id']] = str_replace ("<br />License:", " - License:", $msg_debug[$host['id']]); - $lines = split("<br />", $msg_debug[$host['id']]); + $lines = preg_split("<br />", $msg_debug[$host['id']]); $msg_debug[$host['id']] = ""; $i = 0; foreach ($lines as $line) { diff --git a/www/include/configuration/configGenerate/genEscalations.php b/www/include/configuration/configGenerate/genEscalations.php index c1d40b698e22031e63b06fdc2367e5f75e2af07c..4701de23a930da4a3cc92ffa15a09ebf199cd9b2 100644 --- a/www/include/configuration/configGenerate/genEscalations.php +++ b/www/include/configuration/configGenerate/genEscalations.php @@ -327,7 +327,7 @@ if (isset($gbArr[5][$sg["sg_id"]]) && isset($generatedSG[$sg["sg_id"]])) { $services = getMyServiceGroupActivateServices($sg["sg_id"]); foreach ($services as $key => $desc){ - $tmptab = split("_", $key); + $tmptab = preg_split("_", $key); $host_location = getMyHostFieldOnHost($tmptab[0], "host_location"); if (!isset($hosts[$host_location])) $hosts[$host_location] = array(); @@ -347,7 +347,7 @@ foreach ($value as $host){ if (isset($host) && count($host)) foreach ($host as $ids => $escalation) { - $tabHS = split("_", $ids); + $tabHS = preg_split("_", $ids); if (isset($host_instance[$tabHS[0]]) && isset($hostGenerated[$host_id])) { $host = array(); $strDef = ""; diff --git a/www/include/configuration/configGenerate/xml/generateFiles.php b/www/include/configuration/configGenerate/xml/generateFiles.php index 50e796f8d2963a251c5dbec9fe5d16b8aaa0607f..ca60d6b622c68524d8859dffc4591c7e4284c7e5 100644 --- a/www/include/configuration/configGenerate/xml/generateFiles.php +++ b/www/include/configuration/configGenerate/xml/generateFiles.php @@ -29,7 +29,7 @@ function printDebug($xml) $msg_debug[$host['id']] = str_replace ("Total Errors: 0", "<font color='green'>Total Errors: 0</font>", $msg_debug[$host['id']]); $msg_debug[$host['id']] = str_replace ("<br />License:", " - License:", $msg_debug[$host['id']]); - $lines = split("<br />", $msg_debug[$host['id']]); + $lines = preg_split("<br />", $msg_debug[$host['id']]); $msg_debug[$host['id']] = ""; $i = 0; foreach ($lines as $line) { diff --git a/www/include/configuration/configNagios/comments.php b/www/include/configuration/configNagios/comments.php index b7bd76181ead50499ca7b52a1585d17a94eea5f0..117e43d4e1b4316520c0714ce8b77ed514f88d82 100644 --- a/www/include/configuration/configNagios/comments.php +++ b/www/include/configuration/configNagios/comments.php @@ -41,7 +41,7 @@ $nagios_comment = array(); $nagios_comment["log_file"] = "This is the main log file where service and host events are logged for historical purposes. This should be the first option specified in the config file!!!"; $nagios_comment["cfg_file"]=" This is the configuration file in which you define hosts, host groups, contacts, contact groups, services, etc. I guess it would " - . "be better called an object definition file, but for historical reasons it isn\'t. You can split object definitions into several " + . "be better called an object definition file, but for historical reasons it isn\'t. You can preg_split object definitions into several " . "different config files by using multiple cfg_file statements here. Nagios will read and process all the config files you define. " . "This can be very useful if you want to keep command definitions separate from host and contact definitions... " . "Plugin commands (service and host check commands) Arguments are likely to change between different releases of the " diff --git a/www/include/configuration/configObject/command/DB-Func.php b/www/include/configuration/configObject/command/DB-Func.php index 3b30a185ef70311f4dad2b6b72900e46acdea879..d64ea85f2b98d024d99a82f95bd7e4ff58b75992 100644 --- a/www/include/configuration/configObject/command/DB-Func.php +++ b/www/include/configuration/configObject/command/DB-Func.php @@ -147,7 +147,7 @@ $ret = array(); $ret = $form->getSubmitValues(); - set_magic_quotes_runtime(1); + //set_magic_quotes_runtime(1); $ret["command_name"] = $oreon->checkIllegalChar($ret["command_name"]); @@ -183,7 +183,7 @@ if (!count($ret)) { $ret = $form->getSubmitValues(); } - set_magic_quotes_runtime(1); + //set_magic_quotes_runtime(1); $ret["command_name"] = $oreon->checkIllegalChar($ret["command_name"]); @@ -247,9 +247,9 @@ $pearDB->query("DELETE FROM `command_arg_description` WHERE cmd_id = '".$cmd_id."'"); $query = "INSERT INTO `command_arg_description` (cmd_id, macro_name, macro_description) VALUES "; if (isset($ret['listOfArg']) && $ret['listOfArg']) { - $tab1 = split("\n", $ret['listOfArg']); + $tab1 = preg_split("\n", $ret['listOfArg']); foreach ($tab1 as $key => $value) { - $tab2 = split(" : ", $value, 2); + $tab2 = preg_split(" : ", $value, 2); $query .= "('" . $pearDB->escape($cmd_id) . "', '" . $pearDB->escape($tab2[0]) . "', '" .$pearDB->escape($tab2[1]). "'),"; } $query = trim($query, ","); diff --git a/www/include/configuration/configObject/command/formArguments.php b/www/include/configuration/configObject/command/formArguments.php index 1b2b91f42b7544ec0083f7a70d990b971936512c..b73da78a8fb58986a64f380f9c67a494c0d00d6c 100644 --- a/www/include/configuration/configObject/command/formArguments.php +++ b/www/include/configuration/configObject/command/formArguments.php @@ -56,9 +56,9 @@ } if (isset($_GET['textArea']) && $_GET['textArea']) { - $tab = split(";;;", $_GET['textArea']); + $tab = preg_split(";;;", $_GET['textArea']); foreach ($tab as $key=>$value) { - $tab2 = split(" : ", $value, 2); + $tab2 = preg_split(" : ", $value, 2); $index = str_replace("ARG", "", $tab2[0]); if (isset($tab2[0]) && $tab2[0]) $args[$index] = $tab2[1]; diff --git a/www/include/configuration/configObject/command/minPlayCommand.php b/www/include/configuration/configObject/command/minPlayCommand.php index 0e93d6dd6a9f98df2024936f5563d8a34336152f..15b5e60d0747320eb00e6816e78776374016aa1a 100644 --- a/www/include/configuration/configObject/command/minPlayCommand.php +++ b/www/include/configuration/configObject/command/minPlayCommand.php @@ -45,7 +45,7 @@ $error_msg = ""; $command = $_GET["command_line"]; $example = $_GET["command_example"]; - $args = split("!", $example); + $args = preg_split("!", $example); for ($i = 0; $i < count($args); $i++) $args[$i] = escapeshellarg ($args[$i]); @@ -104,8 +104,8 @@ } else { $command = $resource_def; $command = str_replace('@DOLLAR@', '$', $command); - $splitter = split(";", $command); - $command = $splitter[0]; + $preg_splitter = preg_split(";", $command); + $command = $preg_splitter[0]; $stdout = array(); unset($stdout); diff --git a/www/include/configuration/configObject/host/DB-Func.php b/www/include/configuration/configObject/host/DB-Func.php index d7e6208fdb779d7941d6b353468ea4121878194e..8f66247405cf3060b6e6e3d654b5bfcabf68fc3e 100644 --- a/www/include/configuration/configObject/host/DB-Func.php +++ b/www/include/configuration/configObject/host/DB-Func.php @@ -589,7 +589,7 @@ if (isset($ret["use"]) && $ret["use"]){ $already_stored = array(); - $tplTab = split(",", $ret["use"]); + $tplTab = preg_split(",", $ret["use"]); $j = 0; foreach ($tplTab as $val) { $tplId = getMyHostID($val); @@ -1069,7 +1069,7 @@ elseif (isset($ret["use"]) && $ret["use"]) { $already_stored = array(); - $tplTab = split(",", $ret["use"]); + $tplTab = preg_split(",", $ret["use"]); $j = 0; $DBRES = $pearDB->query("DELETE FROM `host_template_relation` WHERE `host_host_id` = '".$host_id."'"); foreach ($tplTab as $val) { diff --git a/www/include/configuration/configObject/service/xml/argumentsXml.php b/www/include/configuration/configObject/service/xml/argumentsXml.php index 0f5ebc3d0fe8be5246a73c5cd7649b6b9f14a3b1..93ac730f15e04f4749dcd20a6249412989d23f41 100644 --- a/www/include/configuration/configObject/service/xml/argumentsXml.php +++ b/www/include/configuration/configObject/service/xml/argumentsXml.php @@ -102,7 +102,7 @@ foreach ($matches[1] as $key => $value) { $argTab[$value] = $value; } - $exampleTab = split('!', $row2['command_example']); + $exampleTab = preg_split('!', $row2['command_example']); if (is_array($exampleTab)) { foreach ($exampleTab as $key => $value) { $nbTmp = $key; @@ -119,7 +119,7 @@ $res3 = $db->query($query3); if ($res3->numRows()) { $row3 = $res3->fetchRow(); - $valueTab = split('!', $row3['command_command_id_arg']); + $valueTab = preg_split('!', $row3['command_command_id_arg']); if (is_array($valueTab)) { foreach($valueTab as $key => $value) { $nbTmp = $key; diff --git a/www/include/configuration/configObject/servicegroup/DB-Func.php b/www/include/configuration/configObject/servicegroup/DB-Func.php index 0921d3a7e6e37815a149bd660352fff02daa6ae9..4ea8e6eff9c4e7242e01c31f5c42c89f6c79d352 100644 --- a/www/include/configuration/configObject/servicegroup/DB-Func.php +++ b/www/include/configuration/configObject/servicegroup/DB-Func.php @@ -214,14 +214,14 @@ isset($ret["sg_hServices"]) ? $ret = $ret["sg_hServices"] : $ret = $form->getSubmitValue("sg_hServices"); for ($i = 0; $i < count($ret); $i++) { if (isset($ret[$i]) && $ret[$i]){ - $t = split("\-", $ret[$i]); + $t = preg_split("\-", $ret[$i]); $rq = "INSERT INTO servicegroup_relation (host_host_id, service_service_id, servicegroup_sg_id) VALUES ('".$t[0]."', '".$t[1]."', '".$sg_id."')"; $DBRESULT = $pearDB->query($rq); } } isset($ret["sg_hgServices"]) ? $ret = $ret["sg_hgServices"] : $ret = $form->getSubmitValue("sg_hgServices"); for ($i = 0; $i < count($ret); $i++) { - $t = split("\-", $ret[$i]); + $t = preg_split("\-", $ret[$i]); $rq = "INSERT INTO servicegroup_relation (hostgroup_hg_id, service_service_id, servicegroup_sg_id) VALUES ('".$t[0]."', '".$t[1]."', '".$sg_id."')"; $DBRESULT = $pearDB->query($rq); } diff --git a/www/include/configuration/configObject/timeperiod/DB-Func.php b/www/include/configuration/configObject/timeperiod/DB-Func.php index 9348cb26c261e93d9573ac37c9cc698c34a1c6c9..68de30669d8f90c34ef982e6b059f89fa9827bf0 100644 --- a/www/include/configuration/configObject/timeperiod/DB-Func.php +++ b/www/include/configuration/configObject/timeperiod/DB-Func.php @@ -318,7 +318,7 @@ return true; } else { if (strstr($hourString, ",")) { - $tab1 = split(",", $hourString); + $tab1 = preg_split(",", $hourString); for ($i = 0 ; isset($tab1[$i]) ; $i++) { if (preg_match("/([0-9]*):([0-9]*)-([0-9]*):([0-9]*)/", $tab1[$i], $str)) { if ($str[1] > 24 || $str[3] > 24) diff --git a/www/include/doc/getImage.php b/www/include/doc/getImage.php index 3bc8c828f56c0a16a2ea80ef8fb86a706db58306..c5d47eb7dd358a621d470522e49a8cc0fb957173 100644 --- a/www/include/doc/getImage.php +++ b/www/include/doc/getImage.php @@ -46,7 +46,7 @@ $version = htmlentities($_GET["version"], ENT_QUOTES, "UTF-8"); } - $tab_images = split("/", $img); + $tab_images = preg_split("/", $img); foreach ($tab_images as $value) $image = $value; diff --git a/www/include/doc/index.php b/www/include/doc/index.php index bda4332cd597c933644e078f318b3c3427aacc6d..e3ca1e9956e1031914846d8c3be719693e65a987 100644 --- a/www/include/doc/index.php +++ b/www/include/doc/index.php @@ -54,7 +54,7 @@ if (strstr($page, "http:")) header("Location: $page"); - $tab_pages = split("/", $page); + $tab_pages = preg_split("/", $page); foreach ($tab_pages as $value) $page = $value; diff --git a/www/include/eventLogs/GetXmlLog.php b/www/include/eventLogs/GetXmlLog.php index 8ad5ce296a4befabfeb38554fc951ea0c9ca9a2d..f18935b92e4edc191b77cacc63d601f141b79e2f 100644 --- a/www/include/eventLogs/GetXmlLog.php +++ b/www/include/eventLogs/GetXmlLog.php @@ -386,7 +386,7 @@ * If multi checked */ if ($multi == 1) { - $tab_id = split(",", $openid); + $tab_id = preg_split(",", $openid); $tab_host_name = array(); $tab_svc = array(); /* @@ -397,7 +397,7 @@ $flag_already_call = 0; foreach ($tab_id as $openid) { - $tab_tmp = split("_", $openid); + $tab_tmp = preg_split("_", $openid); if (isset($tab_tmp[1])) $id = $tab_tmp[1]; if (isset($tab_tmp[2])) { @@ -416,8 +416,8 @@ } else if ($type == 'ST'){ $services = getMyServiceGroupServices($id); foreach ($services as $svc_id => $svc_name) { - $tab_tmp = split("_", $svc_id); - $tab = split(":", $svc_name); + $tab_tmp = preg_split("_", $svc_id); + $tab = preg_split(":", $svc_name); $host_name = $tab[3]; $svc_name = $tab[0]; if ((($is_admin) || (!$is_admin && isset($lca["LcaHost"][$host_name]) && isset($lca["LcaHost"][$host_name][$svc_name])))) { diff --git a/www/include/eventLogs/XmlTree/GetXmlTree.php b/www/include/eventLogs/XmlTree/GetXmlTree.php index bb6317d6ca5fd005ad782ed6b8a4bc6a912e407d..cfc141e299b369f1d68ac2498255d59bee8b478c 100644 --- a/www/include/eventLogs/XmlTree/GetXmlTree.php +++ b/www/include/eventLogs/XmlTree/GetXmlTree.php @@ -291,7 +291,7 @@ */ $data = getMyServiceGroupActivateServicesSearch($id, $search_service); foreach ($data as $key => $value) { - $tab_value = split("_", $key); + $tab_value = preg_split("_", $key); $host_name = $hostCache[$tab_value[0]]; $service_description = $serviceCache[$tab_value[1]]; $buffer->startElement("item"); @@ -307,7 +307,7 @@ /* * get services for host */ - $tab_id = split('_', $id); + $tab_id = preg_split('_', $id); $id = $tab_id[0]; $services = getMyHostActiveServices($id, $search_service); foreach ($services as $svc_id => $svc_name) { @@ -531,12 +531,12 @@ $buffer->startElement("tree"); $buffer->writeAttribute("id", "1"); - $tab_id = split(",",$url_var); + $tab_id = preg_split(",",$url_var); foreach ($tab_id as $openid) { $type = substr($openid, 0, 2); $id = substr($openid, 3, strlen($openid)); - $id_full = split('_', $id); + $id_full = preg_split('_', $id); $id = $id_full[0]; if ($type == "HH") { diff --git a/www/include/eventLogs/viewLog.php b/www/include/eventLogs/viewLog.php index 4714fb4463c41b0eaea0df6d803e558d12f25c85..4bf536457cd582db6a8321faae5dccc77bdf7fd1 100644 --- a/www/include/eventLogs/viewLog.php +++ b/www/include/eventLogs/viewLog.php @@ -151,9 +151,9 @@ */ if (isset($_POST["svc_id"])) { $id = ""; - $services = split(",", $_POST["svc_id"]); + $services = preg_split(",", $_POST["svc_id"]); foreach ($services as $str) { - $buf_svc = split(";", $str); + $buf_svc = preg_split(";", $str); $id .= "HS_" . getMyServiceID($buf_svc[1], getMyHostID($buf_svc[0])).","; } } diff --git a/www/include/monitoring/comments/common-Func.php b/www/include/monitoring/comments/common-Func.php index 0644409718fc0ea7fc5b49b1be61660c7683a017..5cc148b6687c22475090562600bffc583c03bbca 100644 --- a/www/include/monitoring/comments/common-Func.php +++ b/www/include/monitoring/comments/common-Func.php @@ -42,7 +42,7 @@ global $oreon, $_GET, $pearDB; foreach ($hosts as $key => $value) { - $res = split(";", $key); + $res = preg_split(";", $key); write_command(" DEL_".$type."_COMMENT;".$res[1]."\n", GetMyHostPoller($pearDB, $res[0])); } } diff --git a/www/include/monitoring/downtime/AddHostDowntime.php b/www/include/monitoring/downtime/AddHostDowntime.php index cb9dbbe0b4c35f9a957331951e0d78fceacd3c80..de40a450e55a5d47aacdfd3de3db7619576c3bba 100644 --- a/www/include/monitoring/downtime/AddHostDowntime.php +++ b/www/include/monitoring/downtime/AddHostDowntime.php @@ -177,7 +177,7 @@ */ $hg = new CentreonHostgroups($pearDB); $hostlist = $hg->getHostGroupHosts($_POST['hostgroup_id']); - $host_acl_id = preg_split('/,/', $hostStr); + $host_acl_id = preg_preg_split('/,/', $hostStr); foreach ($hostlist as $host_id) { if ($oreon->user->access->admin || in_array($host_id, $host_acl_id)) { $ecObj->AddHostDowntime($host_id, $_POST["comment"], $_POST["start"], $_POST["end"], $_POST["persistant"], $duration, $dt_w_services); diff --git a/www/include/monitoring/external_cmd/extcmd.php b/www/include/monitoring/external_cmd/extcmd.php index 7468297c30d4da7b76a2ea7638ef95a1d3453787..52b9ed7446566c6c7f361048bb2d36479eacf2a6 100644 --- a/www/include/monitoring/external_cmd/extcmd.php +++ b/www/include/monitoring/external_cmd/extcmd.php @@ -56,7 +56,7 @@ $cmd = str_replace("'", "'", $cmd); $cmd = str_replace("\n", "<br>", $cmd); - $informations = split(";", $key); + $informations = preg_split(";", $key); if ($poller && isPollerLocalhost($pearDB, $poller)) { $str = "echo '[" . time() . "]" . $cmd . "\n' >> " . $centreon->Nagioscfg["command_file"]; } else if (isHostLocalhost($pearDB, $informations[0])) { @@ -81,7 +81,7 @@ $cmd = str_replace("'", "'", $cmd); $cmd = str_replace("\n", "<br>", $cmd); - $informations = split(";", $key); + $informations = preg_split(";", $key); if ($poller && isPollerLocalhost($pearDB, $poller)) { $str = "[" . time() . "]" . $cmd . "\n"; $destination = $oreon->Nagioscfg["command_file"]; diff --git a/www/include/monitoring/external_cmd/functions.php b/www/include/monitoring/external_cmd/functions.php index b4ba978a03c668c5a235d463ab5d01a6c8508cfb..1efd4dd8d92acddfe27112ac2145764c9463a296 100644 --- a/www/include/monitoring/external_cmd/functions.php +++ b/www/include/monitoring/external_cmd/functions.php @@ -69,7 +69,7 @@ if ($actions == true || $is_admin) { $tab_forced = array("0" => "", "1" => "_FORCED"); - $tab_data = split(";", $arg); + $tab_data = preg_split(";", $arg); $flg = send_cmd(" SCHEDULE".$tab_forced[$forced]."_SVC_CHECK;". urldecode($tab_data[0]) . ";" . urldecode($tab_data[1]) . ";" . time(), GetMyHostPoller($pearDB, urldecode($tab_data[0]))); return $flg; } @@ -146,7 +146,7 @@ $actions = $oreon->user->access->checkAction("service_checks"); if ($actions == true || $is_admin) { - $tab_data = split(";", $arg); + $tab_data = preg_split(";", $arg); $flg = send_cmd(" " . $tab[$type] . "_SVC_CHECK;". urldecode($tab_data["0"]) .";".urldecode($tab_data["1"]), GetMyHostPoller($pearDB, urldecode($tab_data["0"]))); return $flg; } @@ -162,7 +162,7 @@ $actions = $oreon->user->access->checkAction("service_passive_checks"); if ($actions == true || $is_admin) { - $tab_data = split(";", $arg); + $tab_data = preg_split(";", $arg); $flg = send_cmd(" " . $tab[$type] . "_PASSIVE_SVC_CHECKS;". urldecode($tab_data[0]) . ";". urldecode($tab_data[1]), GetMyHostPoller($pearDB, urldecode($tab_data["0"]))); return $flg; } @@ -178,7 +178,7 @@ $actions = $oreon->user->access->checkAction("service_notifications"); if ($actions == true || $is_admin) { - $tab_data = split(";", $arg); + $tab_data = preg_split(";", $arg); $flg = send_cmd(" " . $tab[$type] . "_SVC_NOTIFICATIONS;". urldecode($tab_data[0]) . ";". urldecode($tab_data[1]), GetMyHostPoller($pearDB, urldecode($tab_data["0"]))); return $flg; } @@ -194,7 +194,7 @@ $actions = $oreon->user->access->checkAction("service_event_handler"); if ($actions == true || $is_admin) { - $tab_data = split(";", $arg); + $tab_data = preg_split(";", $arg); $flg = send_cmd(" " . $tab[$type] . "_SVC_EVENT_HANDLER;". urldecode($tab_data[0]) .";".urldecode($tab_data[1]), GetMyHostPoller($pearDB, urldecode($tab_data["0"]))); return $flg; } @@ -210,7 +210,7 @@ $actions = $oreon->user->access->checkAction("host_event_handler"); if ($actions == true || $is_admin) { - $tab_data = split(";", $arg); + $tab_data = preg_split(";", $arg); $flg = send_cmd(" " . $tab[$type] . "_HOST_EVENT_HANDLER;". urldecode($arg), GetMyHostPoller($pearDB, urldecode($arg))); return $flg; } @@ -226,7 +226,7 @@ $actions = $oreon->user->access->checkAction("service_flap_detection"); if ($actions == true || $is_admin) { - $tab_data = split(";", $arg); + $tab_data = preg_split(";", $arg); $flg = send_cmd(" " . $tab[$type] . "_SVC_FLAP_DETECTION;". urldecode($tab_data[0]) .";".urldecode($tab_data[1]), GetMyHostPoller($pearDB, urldecode($tab_data[0]))); return $flg; } @@ -242,7 +242,7 @@ $actions = $oreon->user->access->checkAction("host_flap_detection"); if ($actions == true || $is_admin) { - $tab_data = split(";", $arg); + $tab_data = preg_split(";", $arg); $flg = send_cmd(" " . $tab[$type] . "_HOST_FLAP_DETECTION;". urldecode($arg), GetMyHostPoller($pearDB, urldecode($arg))); return $flg; } @@ -254,7 +254,7 @@ */ function notifi_host_hostgroup($arg, $type){ global $pearDB, $tab, $is_admin; - $tab_data = split(";", $arg); + $tab_data = preg_split(";", $arg); $flg = send_cmd(" " . $tab[$type] . "_HOST_NOTIFICATIONS;". urldecode($tab_data[0]), GetMyHostPoller($pearDB, urldecode($tab_data[0]))); return $flg; } @@ -406,7 +406,7 @@ if ($actions == true || $is_admin) { $comment = "Service Auto Acknowledge by ".$oreon->user->alias."\n"; - $ressource = split(";", $key); + $ressource = preg_split(";", $key); $flg = send_cmd(" ACKNOWLEDGE_SVC_PROBLEM;".urldecode($ressource[0]).";".urldecode($ressource[1]).";1;1;1;".$oreon->user->alias.";".$comment, GetMyHostPoller($pearDB, urldecode($ressource[0]))); return $flg; } @@ -419,7 +419,7 @@ if ($actions == true || $is_admin) { $comment = "Service Auto Acknowledge by ".$oreon->user->alias."\n"; - $ressource = split(";", $key); + $ressource = preg_split(";", $key); $flg = send_cmd(" REMOVE_SVC_ACKNOWLEDGEMENT;".urldecode($ressource[0]).";".urldecode($ressource[1]), GetMyHostPoller($pearDB, urldecode($ressource[0]))); return $flg; } @@ -436,7 +436,7 @@ if ($actions == true || $is_admin) { $comment = "Host Auto Acknowledge by ".$oreon->user->alias."\n"; - $ressource = split(";", $key); + $ressource = preg_split(";", $key); $flg = send_cmd(" ACKNOWLEDGE_HOST_PROBLEM;".urldecode($ressource[0]).";1;1;1;".$oreon->user->alias.";".$comment, GetMyHostPoller($pearDB, urldecode($ressource[0]))); return $flg; } @@ -449,7 +449,7 @@ if ($actions == true || $is_admin) { $comment = "Host Auto Acknowledge by ".$oreon->user->alias."\n"; - $ressource = split(";", $key); + $ressource = preg_split(";", $key); $flg = send_cmd(" REMOVE_HOST_ACKNOWLEDGEMENT;".urldecode($ressource[0]), GetMyHostPoller($pearDB, urldecode($ressource[0]))); return $flg; } @@ -465,7 +465,7 @@ $actions = $oreon->user->access->checkAction("host_notifications"); if ($actions == true || $is_admin) { - $ressource = split(";", $key); + $ressource = preg_split(";", $key); $flg = send_cmd(" ENABLE_SVC_NOTIFICATIONS;".urldecode($ressource[0]).";".urldecode($ressource[1]), GetMyHostPoller($pearDB, urldecode($ressource[0]))); return $flg; } @@ -477,7 +477,7 @@ $actions = $oreon->user->access->checkAction("service_notifications"); if ($actions == true || $is_admin) { - $ressource = split(";", $key); + $ressource = preg_split(";", $key); $flg = send_cmd(" DISABLE_SVC_NOTIFICATIONS;".urldecode($ressource[0]).";".urldecode($ressource[1]), GetMyHostPoller($pearDB, urldecode($ressource[0]))); return $flg; } @@ -493,7 +493,7 @@ $actions = $oreon->user->access->checkAction("host_notifications"); if ($actions == true || $is_admin) { - $ressource = split(";", $key); + $ressource = preg_split(";", $key); $flg = send_cmd(" ENABLE_HOST_NOTIFICATIONS;".urldecode($ressource[0]), GetMyHostPoller($pearDB, urldecode($ressource[0]))); return $flg; } @@ -505,7 +505,7 @@ $actions = $oreon->user->access->checkAction("host_notifications"); if ($actions == true || $is_admin) { - $ressource = split(";", $key); + $ressource = preg_split(";", $key); $flg = send_cmd(" DISABLE_HOST_NOTIFICATIONS;".urldecode($ressource[0]), GetMyHostPoller($pearDB, urldecode($ressource[0]))); return $flg; } @@ -521,7 +521,7 @@ $actions = $oreon->user->access->checkAction("service_checks"); if ($actions == true || $is_admin) { - $ressource = split(";", $key); + $ressource = preg_split(";", $key); $flg = send_cmd(" ENABLE_SVC_CHECK;".urldecode($ressource[0]).";".urldecode($ressource[1]), GetMyHostPoller($pearDB, urldecode($ressource[0]))); return $flg; } @@ -533,7 +533,7 @@ $actions = $oreon->user->access->checkAction("service_checks"); if ($actions == true || $is_admin) { - $ressource = split(";", $key); + $ressource = preg_split(";", $key); $flg = send_cmd(" DISABLE_SVC_CHECK;".urldecode($ressource[0]).";".urldecode($ressource[1]), GetMyHostPoller($pearDB, urldecode($ressource[0]))); return $flg; } @@ -549,7 +549,7 @@ $actions = $oreon->user->access->checkAction("host_checks"); if ($actions == true || $is_admin) { - $ressource = split(";", $key); + $ressource = preg_split(";", $key); $flg = send_cmd(" ENABLE_HOST_CHECK;".urldecode($ressource[0]), GetMyHostPoller($pearDB, urldecode($ressource[0]))); return $flg; } @@ -563,7 +563,7 @@ if ($actions == true || $is_admin) { global $pearDB,$tab, $is_admin; - $ressource = split(";", $key); + $ressource = preg_split(";", $key); $flg = send_cmd(" DISABLE_HOST_CHECK;".urldecode($ressource[0]), GetMyHostPoller($pearDB, urldecode($ressource[0]))); return $flg; } diff --git a/www/include/monitoring/external_cmd/functionsPopup.php b/www/include/monitoring/external_cmd/functionsPopup.php index d55f06f3511ccdf8cf9f5febe98a8750bed3ce9f..ad34fc9a8b3fa2a709d96ac24fd09787cab20290 100644 --- a/www/include/monitoring/external_cmd/functionsPopup.php +++ b/www/include/monitoring/external_cmd/functionsPopup.php @@ -27,7 +27,7 @@ global $oreon, $key, $pearDB; $str = NULL; - $informations = split(";", $key); + $informations = preg_split(";", $key); if ($poller && isPollerLocalhost($pearDB, $poller)) $str = "echo '[" . time() . "]" . $cmd . "\n' >> " . $oreon->Nagioscfg["command_file"]; else if (isHostLocalhost($pearDB, $informations[0])) @@ -49,7 +49,7 @@ $actions = $oreon->user->access->checkAction("host_acknowledgement"); $key = urldecode($key); - $tmp = split(";", $key); + $tmp = preg_split(";", $key); $host_name = $tmp[0]; isset($_GET['persistent']) && $_GET['persistent'] == "true" ? $persistent = "1" : $persistent = "0"; @@ -103,7 +103,7 @@ $key = urldecode($key); - $tmp = split(";", $key); + $tmp = preg_split(";", $key); if (!isset($tmp[0])) { throw new Exception('No host found'); @@ -158,7 +158,7 @@ if ($actions == true || $is_admin) { $key = urldecode($key); - $tmp = split(";", $key); + $tmp = preg_split(";", $key); if (!isset($tmp[0])) { throw new Exception('No host found'); } @@ -170,22 +170,22 @@ isset($_GET['fixed']) && $_GET['fixed'] == "true" ? $fixed = 1 : $fixed = 0; isset($_GET['duration']) && $_GET['duration'] && is_numeric($_GET['duration']) ? $duration = $_GET['duration'] : $duration = 0; - $res = preg_split("/ /", $start); + $res = preg_preg_split("/ /", $start); if (count($res) != 2) { throw new Exception('Start date format is not valid'); } - $res1 = preg_split("/\//", $res[0]); - $res2 = preg_split("/:/", $res[1]); + $res1 = preg_preg_split("/\//", $res[0]); + $res2 = preg_preg_split("/:/", $res[1]); $start_time = mktime($res2[0], $res2[1], "0", $res1[1], $res1[2], $res1[0]); $start_time = $centreonGMT->getUTCDate($start_time); - $res = preg_split("/ /", $end); + $res = preg_preg_split("/ /", $end); if (count($res) != 2) { throw new Exception('End date format is not valid'); } - $res3 = preg_split("/\//", $res[0]); - $res4 = preg_split("/:/", $res[1]); + $res3 = preg_preg_split("/\//", $res[0]); + $res4 = preg_preg_split("/:/", $res[1]); $end_time = mktime($res4[0], $res4[1], "0", $res3[1], $res3[2], $res3[0]); $end_time = $centreonGMT->getUTCDate($end_time); if (!$duration) { @@ -222,7 +222,7 @@ if ($actions == true || $is_admin) { $key = urldecode($key); - $tmp = split(";", $key); + $tmp = preg_split(";", $key); if (!isset($tmp[0])) { throw new Exception('No host found'); @@ -241,21 +241,21 @@ isset($_GET['fixed']) && $_GET['fixed'] == "true" ? $fixed = 1 : $fixed = 0; isset($_GET['duration']) && $_GET['duration'] && is_numeric($_GET['duration']) ? $duration = $_GET['duration'] : $duration = 0; - $res = preg_split("/ /", $start); + $res = preg_preg_split("/ /", $start); if (count($res) != 2) { throw new Exception('Start date format is not valid'); } - $res1 = preg_split("/\//", $res[0]); - $res2 = preg_split("/:/", $res[1]); + $res1 = preg_preg_split("/\//", $res[0]); + $res2 = preg_preg_split("/:/", $res[1]); $start_time = mktime($res2[0], $res2[1], "0", $res1[1], $res1[2], $res1[0], -1); $start_time = $centreonGMT->getUTCDate($start_time); - $res = preg_split("/ /", $end); + $res = preg_preg_split("/ /", $end); if (count($res) != 2) { throw new Exception('End date format is not valid'); } - $res3 = preg_split("/\//", $res[0]); - $res4 = preg_split("/:/", $res[1]); + $res3 = preg_preg_split("/\//", $res[0]); + $res4 = preg_preg_split("/:/", $res[1]); $end_time = mktime($res4[0], $res4[1], "0", $res3[1], $res3[2], $res3[0], -1); $end_time = $centreonGMT->getUTCDate($end_time); if (!$duration) { diff --git a/www/include/monitoring/external_cmd/popup/massive_ack.php b/www/include/monitoring/external_cmd/popup/massive_ack.php index 77f90b83e3b910654c98307f5a47db782b9eb3a6..6afdc527b3a0f2bc5a4138e928b22ca1de8a91ae 100644 --- a/www/include/monitoring/external_cmd/popup/massive_ack.php +++ b/www/include/monitoring/external_cmd/popup/massive_ack.php @@ -44,7 +44,7 @@ if (isset($_GET['select'])) { foreach ($_GET['select'] as $key => $value) { if ($cmd == '72') { - $tmp = split(";", urlencode($key)); + $tmp = preg_split(";", urlencode($key)); $select[] = $tmp[0]; } else { $select[] = urlencode($key); diff --git a/www/include/monitoring/external_cmd/popup/massive_downtime.php b/www/include/monitoring/external_cmd/popup/massive_downtime.php index 2e6332fa43c3e1f7fe04f05ebf1e6d860e1f0765..7f6357aa315e01ba353d211354e99aa0d643f012 100644 --- a/www/include/monitoring/external_cmd/popup/massive_downtime.php +++ b/www/include/monitoring/external_cmd/popup/massive_downtime.php @@ -43,7 +43,7 @@ if (isset($_GET['select'])) { foreach ($_GET['select'] as $key => $value) { if ($cmd == '75') { - $tmp = split(";", $key); + $tmp = preg_split(";", $key); $select[] = $tmp[0]; } else { diff --git a/www/include/monitoring/objectDetails/serviceDetails.php b/www/include/monitoring/objectDetails/serviceDetails.php index 5d21de1ca507aa2b0f0ffd5997a3efd16e178aa2..ec2384422630eac10054b6049a83896202d01b82 100644 --- a/www/include/monitoring/objectDetails/serviceDetails.php +++ b/www/include/monitoring/objectDetails/serviceDetails.php @@ -71,7 +71,7 @@ $svc_description = $_GET["service_description"]; } else { foreach ($_GET["select"] as $key => $value) { - $tab_data = split(";", $key); + $tab_data = preg_split(";", $key); } $host_name = $tab_data[0]; $svc_description = $tab_data[1]; diff --git a/www/include/monitoring/status/Meta/xml/broker/metaServiceXML.php b/www/include/monitoring/status/Meta/xml/broker/metaServiceXML.php index ad9e20d95d47ff807025a9ac0f459cbd57890ae7..00bcb66535f247be1f647f25ca711cb47aa4441a 100644 --- a/www/include/monitoring/status/Meta/xml/broker/metaServiceXML.php +++ b/www/include/monitoring/status/Meta/xml/broker/metaServiceXML.php @@ -237,7 +237,7 @@ $class = "list_four"; } - $tabID = split("_", $ndo["service_description"]); + $tabID = preg_split("_", $ndo["service_description"]); $id = $tabID[1]; $DBRESULT= $pearDB->query("SELECT `meta_name` FROM `meta_service` WHERE `meta_id` = '$id'"); diff --git a/www/include/monitoring/status/Meta/xml/ndo/metaServiceXML.php b/www/include/monitoring/status/Meta/xml/ndo/metaServiceXML.php index ba7f4eb7d83825b9b12e23b995aacf25d47fd1f2..1028c58d35514b68f241cc9eecc22774dcecbfb2 100644 --- a/www/include/monitoring/status/Meta/xml/ndo/metaServiceXML.php +++ b/www/include/monitoring/status/Meta/xml/ndo/metaServiceXML.php @@ -237,7 +237,7 @@ $class = "list_four"; } - $tabID = split("_", $ndo["service_description"]); + $tabID = preg_split("_", $ndo["service_description"]); $id = $tabID[1]; $DBRESULT= $pearDB->query("SELECT `meta_name` FROM `meta_service` WHERE `meta_id` = '$id'"); diff --git a/www/include/monitoring/status/Services/xml/broker/makeXMLForOneService.php b/www/include/monitoring/status/Services/xml/broker/makeXMLForOneService.php index 23707f8ca6b6876fc2987a9addb8487411731db0..1ce91082decab9ca76e36159b787a35998cf6715 100644 --- a/www/include/monitoring/status/Services/xml/broker/makeXMLForOneService.php +++ b/www/include/monitoring/status/Services/xml/broker/makeXMLForOneService.php @@ -82,7 +82,7 @@ $disable = $obj->checkArgument("disable", $_GET, "disable"); $dateFormat = $obj->checkArgument("date_time_format_status", $_GET, "d/m/Y H:i:s"); - $tab = split('_', $svc_id); + $tab = preg_split('_', $svc_id); $host_id = $tab[0]; $service_id = $tab[1]; @@ -174,7 +174,7 @@ */ /* $obj->XML->writeElement("long_name", _("Extended Status Information"), 0); - $lo_array = preg_split('/<br \/>|<br>|\\\n|\x0A|\x0D\x0A/', $data["long_output"]); + $lo_array = preg_preg_split('/<br \/>|<br>|\\\n|\x0A|\x0D\x0A/', $data["long_output"]); foreach ($lo_array as $val) { if ($val != "") { $obj->XML->startElement("long_output_data"); @@ -184,7 +184,7 @@ } */ - $tab_perf = split(" ", $data["perfdata"]); + $tab_perf = preg_split(" ", $data["perfdata"]); foreach ($tab_perf as $val) { $obj->XML->startElement("performance_data"); $obj->XML->writeElement("perf_data", $val); diff --git a/www/include/monitoring/status/Services/xml/ndo/makeXMLForOneService.php b/www/include/monitoring/status/Services/xml/ndo/makeXMLForOneService.php index 961643ca4bd2ab2e8c66bc5862253fb55322c31f..afda6bec820fe10a54fe09c1563f218b9170c5e4 100644 --- a/www/include/monitoring/status/Services/xml/ndo/makeXMLForOneService.php +++ b/www/include/monitoring/status/Services/xml/ndo/makeXMLForOneService.php @@ -76,7 +76,7 @@ (isset($_GET["disable"]) && !check_injection($_GET["disable"])) ? $disable = htmlentities($_GET["disable"]) : $disable = "disable"; (isset($_GET["date_time_format_status"]) && !check_injection($_GET["date_time_format_status"])) ? $date_time_format_status = htmlentities($_GET["date_time_format_status"]) : $date_time_format_status = "d/m/Y H:i:s"; - $tmpTab = split("_", $svc_id); + $tmpTab = preg_split("_", $svc_id); if (isset($tmpTab[1])) { $svc_id = $tmpTab[1]; } @@ -209,7 +209,7 @@ * Long Output */ $buffer->writeElement("long_name", _("Extended Status Information"), 0); - $lo_array = preg_split('/<br \/>|<br>|\\\n|\x0A|\x0D\x0A/', $ndo["long_output"]); + $lo_array = preg_preg_split('/<br \/>|<br>|\\\n|\x0A|\x0D\x0A/', $ndo["long_output"]); foreach ($lo_array as $val) { if ($val != "") { $buffer->startElement("long_output_data"); @@ -218,7 +218,7 @@ } } - $tab_perf = split(" ", $ndo["perfdata"]); + $tab_perf = preg_split(" ", $ndo["perfdata"]); foreach ($tab_perf as $val) { $buffer->startElement("performance_data"); $buffer->writeElement("perf_data", $val); diff --git a/www/include/options/oreon/modules/listModules.php b/www/include/options/oreon/modules/listModules.php index 0ccbf0f9dc19c9fa6f2e21ac090484298980cfb5..8787c74cf02888138a66d60f4573735e8657ea67 100644 --- a/www/include/options/oreon/modules/listModules.php +++ b/www/include/options/oreon/modules/listModules.php @@ -46,7 +46,7 @@ * @return array */ function parse_zend_license_file($file) { - $lines = preg_split('/\n/', file_get_contents($file)); + $lines = preg_preg_split('/\n/', file_get_contents($file)); $infos = array(); foreach ($lines as $line) { if (preg_match('/^([^= ]+)\s*=\s*(.+)$/', $line, $match)) { diff --git a/www/include/reporting/dashboard/DB-Func.php b/www/include/reporting/dashboard/DB-Func.php index 19c15e27e70d1b326d6abf6580e5ead4148974f0..46909a2ed7d2f46ee06ab2416f1eedb240a65179 100644 --- a/www/include/reporting/dashboard/DB-Func.php +++ b/www/include/reporting/dashboard/DB-Func.php @@ -471,15 +471,15 @@ $serviceGroupStats[$host_service_id][$name] = 0; } $servicesStats = array(); - $res = preg_split("/_/", $host_service_id); + $res = preg_preg_split("/_/", $host_service_id); $servicesStats = getLogInDbForOneSVC($res[0], $res[1], $start_date, $end_date, $reportTimePeriod); if (isset($servicesStats)) { $serviceGroupStats[$host_service_id] = $servicesStats; - $res = preg_split("/_/", $host_service_id); + $res = preg_preg_split("/_/", $host_service_id); $serviceGroupStats[$host_service_id]["HOST_ID"] = $res[0]; $serviceGroupStats[$host_service_id]["SERVICE_ID"] = $res[1]; - $res = preg_split("/:::/", $host_service_name); + $res = preg_preg_split("/:::/", $host_service_name); $serviceGroupStats[$host_service_id]["HOST_NAME"] = $res[0]; $serviceGroupStats[$host_service_id]["SERVICE_DESC"] = $res[1]; foreach ($serviceStatsLabels as $name) diff --git a/www/include/reporting/dashboard/common-Func.php b/www/include/reporting/dashboard/common-Func.php index 44977a07769fb33744202c261eb4d508d7cb299e..d7db1c62f5734f21430b1e4e0720b75b92789fc9 100644 --- a/www/include/reporting/dashboard/common-Func.php +++ b/www/include/reporting/dashboard/common-Func.php @@ -136,13 +136,13 @@ if (is_numeric($end)) { $end_time = $end; } else if (isset($end) && $end != "") { - list($m, $d ,$y) = split('/', $end); + list($m, $d ,$y) = preg_split('/', $end); $end = mktime(24, 0, 0, $m, $d, $y); if ($end < $end_time) $end_time = $end; } if (!is_numeric($start) && isset($start) && $start != "") { - list($m, $d, $y) = split('/', $start); + list($m, $d, $y) = preg_split('/', $start); $start_time = mktime(0, 0, 0, $m, $d, $y); } else $start_time = $start; @@ -177,7 +177,7 @@ } function my_getTimeTamps($dateSTR) { - list($m,$d,$y) = split('/',$dateSTR); + list($m,$d,$y) = preg_split('/',$dateSTR); return (mktime(0,0,0,$m,$d,$y)); } diff --git a/www/include/views/graphs/GetXmlGraph.php b/www/include/views/graphs/GetXmlGraph.php index 8aa2de13758fd257215dced85497d837c369fbaf..d99b0820217f1b8d4f786e231c10ebdbf05686bd 100644 --- a/www/include/views/graphs/GetXmlGraph.php +++ b/www/include/views/graphs/GetXmlGraph.php @@ -121,7 +121,7 @@ (isset($_GET["sid"]) && !check_injection($_GET["sid"])) ? $sid = htmlentities($_GET["sid"], ENT_QUOTES, "UTF-8") : $sid = "-1"; (isset($_GET["template_id"]) && !check_injection($_GET["template_id"])) ? $template_id = htmlentities($_GET["template_id"], ENT_QUOTES, "UTF-8") : $template_id = "1"; - (isset($_GET["split"]) && !check_injection($_GET["split"])) ? $split = htmlentities($_GET["split"], ENT_QUOTES, "UTF-8") : $split = "0"; + (isset($_GET["preg_split"]) && !check_injection($_GET["preg_split"])) ? $preg_split = htmlentities($_GET["preg_split"], ENT_QUOTES, "UTF-8") : $preg_split = "0"; (isset($_GET["status"]) && !check_injection($_GET["status"])) ? $status = htmlentities($_GET["status"], ENT_QUOTES, "UTF-8") : $status = "0"; (isset($_GET["warning"]) && !check_injection($_GET["warning"])) ? $warning = htmlentities($_GET["warning"], ENT_QUOTES, "UTF-8") : $warning = "0"; (isset($_GET["critical"]) && !check_injection($_GET["critical"])) ? $critical = htmlentities($_GET["critical"], ENT_QUOTES, "UTF-8") : $critical = "0"; @@ -149,7 +149,7 @@ $flag_period = 0; if (!strncmp($openid, "SS_HS", 5)){ - $tab = split("_", $openid); + $tab = preg_split("_", $openid); $openid = "SS_".$tab[2]."_".$tab[3]; unset($tab); } @@ -199,7 +199,7 @@ $tab_id = array(); if ($multi == 0){ - $tab_tmp = split("_", $openid); + $tab_tmp = preg_split("_", $openid); $type = $tab_tmp[0]; $id = ""; for ($i = 1; $i <= (count($tab_tmp) - 1); $i++) @@ -207,10 +207,10 @@ array_push($tab_id, $type.$id); } else { $buffer->writeElement("opid", $openid); - $buffer->writeElement("splitvalue", $_GET["split"]); - $tab_tmp = split(",", $openid); + $buffer->writeElement("preg_splitvalue", $_GET["preg_split"]); + $tab_tmp = preg_split(",", $openid); foreach ($tab_tmp as $openid) { - $tab_tmp = split("_", $openid); + $tab_tmp = preg_split("_", $openid); if (isset($tab_tmp[1])) $id = $tab_tmp[1]; $type = $tab_tmp[0]; @@ -246,7 +246,7 @@ $services = getMyServiceGroupServices($id); foreach ($services as $svc_id => $svc_name) { - $tab_tmp = split("_", $svc_id); + $tab_tmp = preg_split("_", $svc_id); if (service_has_graph($tab_tmp[0], $tab_tmp[1]) && (($is_admin) || (!$is_admin && isset($lca[$tab_tmp[0]]) && isset($lca[$tab_tmp[0]][$tab_tmp[1]]) ))) { $oid = "HS_".$tab_tmp[1]."_".$tab_tmp[0]; array_push($tab_id, $oid); @@ -275,7 +275,7 @@ if (count($tab_tmp)){ foreach ($tab_tmp as $openid) { - $tab = split("_", $openid); + $tab = preg_split("_", $openid); if (isset($tab[2]) && $tab[2]) $tab_real_id[$tab[0] ."_". $tab[1]."_".$tab[2]] = $openid; else if (isset($tab[1]) && $tab[1]) @@ -298,7 +298,7 @@ foreach ($tab_real_id as $key => $openid) { $bad_value = 0; - $tab_tmp = split("_", $openid); + $tab_tmp = preg_split("_", $openid); if (isset($tab_tmp[2]) && $tab_tmp[2]) $id = $tab_tmp[1]."_".$tab_tmp[2]; @@ -324,14 +324,14 @@ $DBRESULT->free(); if ($type == "HS"){ - $tab_tmp = split("_", $real_id); + $tab_tmp = preg_split("_", $real_id); $DBRESULT2 = $pearDBO->query("SELECT id, service_id, service_description, host_name, special FROM index_data WHERE `trashed` = '0' AND special = '0' AND host_id = '".$tab_tmp[2]."' AND service_id = '".$tab_tmp[1]."'"); $svc_id = $DBRESULT2->fetchRow(); $template_id = getDefaultGraph($svc_id["service_id"], 1); $DBRESULT2 = $pearDB->query("SELECT * FROM giv_graphs_template WHERE graph_id = '".$template_id."' LIMIT 1"); $GraphTemplate = $DBRESULT2->fetchRow(); - if ($GraphTemplate["split_component"] == 1) - $split = 1; + if ($GraphTemplate["preg_split_component"] == 1) + $preg_split = 1; } if ($type == "MS"){ $other_services = array(); @@ -482,7 +482,7 @@ $buffer->writeElement("flagperiod", $flag_period); $buffer->writeElement("opid", $openid); - $buffer->writeElement("split", $split); + $buffer->writeElement("preg_split", $preg_split); $buffer->writeElement("status", $status); $buffer->writeElement("warning", $warning); $buffer->writeElement("critical", $critical); @@ -492,7 +492,7 @@ $buffer->writeElement("start", $start); $buffer->writeElement("end", time()); - if ($split) { + if ($preg_split) { foreach ($metrics as $metric_id => $metric) { if ($active_force || isset($metrics_active[$metric_id]) && $metrics_active[$metric_id] == 1) { $buffer->startElement("metric"); @@ -530,7 +530,7 @@ $elem = array(); if ($type == "SS"){ - $tab_tmp = split("_", $openid); + $tab_tmp = preg_split("_", $openid); $DBRESULT2 = $pearDBO->query("SELECT id, service_id, service_description, host_name, special FROM index_data WHERE `trashed` = '0' AND special = '0' AND host_id = '".$tab_tmp[2]."' AND service_id = '".$tab_tmp[1]."'"); $svc_id = $DBRESULT2->fetchRow(); $DBRESULT2->free(); @@ -539,8 +539,8 @@ $DBRESULT2 = $pearDB->query("SELECT * FROM giv_graphs_template WHERE graph_id = '".$template_id."' LIMIT 1"); $GraphTemplate = $DBRESULT2->fetchRow(); $DBRESULT2->free(); - if ($GraphTemplate["split_component"] == 1 ) - $split = 1; + if ($GraphTemplate["preg_split_component"] == 1 ) + $preg_split = 1; } if ($type == "SM"){ $other_services = array(); @@ -568,8 +568,8 @@ $DBRESULT2 = $pearDB->query("SELECT * FROM giv_graphs_template WHERE graph_id = '".$template_id."' LIMIT 1"); $GraphTemplate = $DBRESULT2->fetchRow(); - if (($GraphTemplate["split_component"] == 1 && !isset($_GET["split"])) || (isset($_GET["split"]) && $_GET["split"]["split"] == 1)) - $split = 1; + if (($GraphTemplate["preg_split_component"] == 1 && !isset($_GET["preg_split"])) || (isset($_GET["preg_split"]) && $_GET["preg_split"]["preg_split"] == 1)) + $preg_split = 1; /* * Real Metrics @@ -669,7 +669,7 @@ $buffer->writeElement("start", $start); $buffer->writeElement("end", $end); $buffer->writeElement("index", $index_id); - $buffer->writeElement("split", $split); + $buffer->writeElement("preg_split", $preg_split); $buffer->writeElement("critical", $critical); $buffer->writeElement("warning", $warning); $buffer->writeElement("status", $status); @@ -677,7 +677,7 @@ $buffer->writeElement("multi", $multi); if (!$multi){ - if ($split == 0){ + if ($preg_split == 0){ $buffer->startElement("metricsTab"); $flag = 0; $str = ""; @@ -738,7 +738,7 @@ $buffer->startElement("lang"); $buffer->writeElement("giv_gg_tpl", _("Template"), 0); $buffer->writeElement("advanced", _("Options"), 0); - $buffer->writeElement("giv_split_component", _("Split Components"), 0); + $buffer->writeElement("giv_preg_split_component", _("preg_split Components"), 0); $buffer->writeElement("status", _("Display Status"), 0); $buffer->writeElement("warning", _("Warning"), 0); $buffer->writeElement("critical", _("Critical"), 0); diff --git a/www/include/views/graphs/GetXmlTree.php b/www/include/views/graphs/GetXmlTree.php index e9b49bf69ba4231d52b043fb86b28d07e8296bba..ef1330b12d2b0c6e8436b8a01b229e5994d19aad 100644 --- a/www/include/views/graphs/GetXmlTree.php +++ b/www/include/views/graphs/GetXmlTree.php @@ -242,7 +242,7 @@ */ $data = getMyServiceGroupActivateServices($id); foreach ($data as $key => $value){ - $tab_value = split("_", $key); + $tab_value = preg_split("_", $key); $host_name = $hostCache[$tab_value[0]]; $service_description = $serviceCache[$tab_value[1]]; if (checkIfServiceSgIsEn($tab_value[0], $tab_value[1])) { @@ -260,7 +260,7 @@ /** * get services for host */ - $tab_value = split("_", $id); + $tab_value = preg_split("_", $id); $id = $tab_value[0]; $services = getMyHostActiveServices($id, $search_service); $graphList = getMyHostGraphs($id); @@ -497,14 +497,14 @@ $buffer->startElement("tree"); $buffer->writeAttribute("id", "1"); - $tab_id = split(",",$url_var); + $tab_id = preg_split(",",$url_var); foreach ($tab_id as $openid) { $type = substr($openid, 0, 2); $id = substr($openid, 3, strlen($openid)); $buffer->writeElement("id", $id); - $id_full = split('_', $id); + $id_full = preg_split('_', $id); $id = $id_full[0]; $buffer->startElement("idfull"); $buffer->endElement(); diff --git a/www/include/views/graphs/graphStatus/displayServiceStatus.php b/www/include/views/graphs/graphStatus/displayServiceStatus.php index f6b5f2c4d1764b212b04e3f8e73fe3f1d60e400b..273633469da5d67848c31f8f20fbd86fbd8418b1 100644 --- a/www/include/views/graphs/graphStatus/displayServiceStatus.php +++ b/www/include/views/graphs/graphStatus/displayServiceStatus.php @@ -36,7 +36,7 @@ * */ function escape_command($command) { - return ereg_replace("(\\\$|`)", "", $command); + return preg_replace("/(\\\$|`)/", "", $command); } require_once "@CENTREON_ETC@/centreon.conf.php"; diff --git a/www/include/views/graphs/graphTemplates/DB-Func.php b/www/include/views/graphs/graphTemplates/DB-Func.php index 095535dd49f70b9f0130f80ba8419d5ff97c176e..8f9c756b148fa9c0873fdf74689aa79326ab2f13 100644 --- a/www/include/views/graphs/graphTemplates/DB-Func.php +++ b/www/include/views/graphs/graphTemplates/DB-Func.php @@ -121,7 +121,7 @@ noDefaultOreonGraph(); $rq = "INSERT INTO `giv_graphs_template` ( `graph_id` , `name` , " . "`vertical_label` , `width` , `height` , `base` , `lower_limit`, `upper_limit` , `bg_grid_color` , `bg_color` , `police_color` , `grid_main_color` , " . - "`grid_sec_color` , `contour_cub_color` , `col_arrow` , `col_top` , `col_bot` , `default_tpl1` , `split_component` , `scaled`, " . + "`grid_sec_color` , `contour_cub_color` , `col_arrow` , `col_top` , `col_bot` , `default_tpl1` , `preg_split_component` , `scaled`, " . "`stacked` , `comment` ) "; $rq .= "VALUES ("; $rq .= "NULL, "; @@ -142,7 +142,7 @@ isset($ret["col_top"]) && $ret["col_top"] != NULL ? $rq .= "'".htmlentities($ret["col_top"], ENT_QUOTES, "UTF-8")."', ": $rq .= "NULL, "; isset($ret["col_bot"]) && $ret["col_bot"] != NULL ? $rq .= "'".htmlentities($ret["col_bot"], ENT_QUOTES, "UTF-8")."', ": $rq .= "NULL, "; isset($ret["default_tpl1"]) && $ret["default_tpl1"] != NULL ? $rq .= "'".$ret["default_tpl1"]."', ": $rq .= "NULL, "; - isset($ret["split_component"]) && $ret["split_component"] != NULL ? $rq .= "'".$ret["split_component"]."', ": $rq .= "NULL, "; + isset($ret["preg_split_component"]) && $ret["preg_split_component"] != NULL ? $rq .= "'".$ret["preg_split_component"]."', ": $rq .= "NULL, "; isset($ret["scaled"]) && $ret["scaled"] != NULL ? $rq .= "'".$ret["scaled"]."', ": $rq .= "'0', "; isset($ret["stacked"]) && $ret["stacked"] != NULL ? $rq .= "'".htmlentities($ret["stacked"], ENT_QUOTES, "UTF-8")."', ": $rq .= "NULL, "; isset($ret["comment"]) && $ret["comment"] != NULL ? $rq .= "'".htmlentities($ret["comment"], ENT_QUOTES, "UTF-8")."'": $rq .= "NULL"; @@ -196,8 +196,8 @@ isset($ret["col_bot"]) && $ret["col_bot"] != NULL ? $rq .= "'".htmlentities($ret["col_bot"], ENT_QUOTES, "UTF-8")."', ": $rq .= "NULL, "; $rq .= "default_tpl1 = "; isset($ret["default_tpl1"]) && $ret["default_tpl1"] != NULL ? $rq .= "'".$ret["default_tpl1"]."', ": $rq .= "NULL, "; - $rq .= "split_component = "; - isset($ret["split_component"]) && $ret["split_component"] != NULL ? $rq .= "'".$ret["split_component"]."', ": $rq .= "NULL, "; + $rq .= "preg_split_component = "; + isset($ret["preg_split_component"]) && $ret["preg_split_component"] != NULL ? $rq .= "'".$ret["preg_split_component"]."', ": $rq .= "NULL, "; $rq .= "scaled = "; isset($ret["scaled"]) && $ret["scaled"] != NULL ? $rq .= "'".$ret["scaled"]."', ": $rq .= "'0', "; $rq .= "stacked = "; diff --git a/www/include/views/graphs/graphTemplates/formGraphTemplate.php b/www/include/views/graphs/graphTemplates/formGraphTemplate.php index ac5bc183ef8fcebbea841b46000186515d567f91..1358e468418bb159f62d4ebb3a18711ee7ea194a 100644 --- a/www/include/views/graphs/graphTemplates/formGraphTemplate.php +++ b/www/include/views/graphs/graphTemplates/formGraphTemplate.php @@ -152,7 +152,7 @@ $form->addElement('checkbox', 'stacked', _("Stacking")); - $form->addElement('checkbox', 'split_component', _("Split Components")); + $form->addElement('checkbox', 'preg_split_component', _("preg_split Components")); $form->addElement('checkbox', 'scaled', _("Scale Graph Values")); $form->addElement('textarea', 'comment', _("Comments"), $attrsTextarea); $form->addElement('checkbox', 'default_tpl1', _("Default Centreon Graph Template")); diff --git a/www/include/views/graphs/graphTemplates/listGraphTemplates.php b/www/include/views/graphs/graphTemplates/listGraphTemplates.php index 0dff51210d1184b386d1921f97d8dc3c31ee3a30..688f63c7241815125a4d63778440eca489c9105e 100644 --- a/www/include/views/graphs/graphTemplates/listGraphTemplates.php +++ b/www/include/views/graphs/graphTemplates/listGraphTemplates.php @@ -68,12 +68,12 @@ $tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>"); $tpl->assign("headerMenu_name", _("Name")); $tpl->assign("headerMenu_desc", _("Description")); - $tpl->assign("headerMenu_split_component", _("Split Components")); + $tpl->assign("headerMenu_preg_split_component", _("preg_split Components")); $tpl->assign("headerMenu_base", _("Base")); $tpl->assign("headerMenu_options", _("Options")); #List - $rq = "SELECT graph_id, name, default_tpl1, vertical_label, base, split_component FROM giv_graphs_template gg $SearchTool ORDER BY name LIMIT ".$num * $limit.", ".$limit; + $rq = "SELECT graph_id, name, default_tpl1, vertical_label, base, preg_split_component FROM giv_graphs_template gg $SearchTool ORDER BY name LIMIT ".$num * $limit.", ".$limit; $res = & $pearDB->query($rq); $form = new HTML_QuickForm('select_form', 'POST', "?p=".$p); @@ -94,7 +94,7 @@ "RowMenu_link"=>"?p=".$p."&o=c&graph_id=".$graph['graph_id'], "RowMenu_desc"=>$graph["vertical_label"], "RowMenu_base"=>$graph["base"], - "RowMenu_split_component"=>$graph["split_component"] ? _("Yes") : _("No"), + "RowMenu_preg_split_component"=>$graph["preg_split_component"] ? _("Yes") : _("No"), "RowMenu_options"=>$moptions); $style != "two" ? $style = "two" : $style = "one"; } diff --git a/www/include/views/graphs/graphs.php b/www/include/views/graphs/graphs.php index dc7137cd89be5393318a501848b180a8fb86ba7c..a42977ed4865641f02fc1692174abd691d646173 100644 --- a/www/include/views/graphs/graphs.php +++ b/www/include/views/graphs/graphs.php @@ -261,8 +261,8 @@ function form2ctime(dpart, tpart) { // dpart : MM/DD/YYYY // tpart : HH:mm - var dparts = dpart.split("/"); - var tparts = tpart.split(":"); + var dparts = dpart.preg_split("/"); + var tparts = tpart.preg_split(":"); return new Date(dparts[2], dparts[0]-1, dparts[1], tparts[0], tparts[1], 0).getTime(); } @@ -418,10 +418,10 @@ function nextPeriod() { _tpl_id = document.formu2.template_select.value; } - // Split metric - var _split = 0; - if (document.formu2 && document.formu2.split && document.formu2.split.checked) { - _split = 1; + // preg_split metric + var _preg_split = 0; + if (document.formu2 && document.formu2.preg_split && document.formu2.preg_split.checked) { + _preg_split = 1; } var _status = 0; @@ -442,7 +442,7 @@ function nextPeriod() { tree.selectItem(id); var proc = new Transformation(); var _addrXSL = "./include/views/graphs/graph.xsl"; - var _addrXML = './include/views/graphs/GetXmlGraph.php?multi='+multi+'&split='+_split+'&status='+_status+'&warning='+_warning+'&critical='+_critical+_metrics+'&template_id='+_tpl_id +'&period='+period+'&StartDate='+StartDate+'&EndDate='+EndDate+'&StartTime='+StartTime+'&EndTime='+EndTime+'&id='+id+'&sid=<?php echo $sid;?><?php if (isset($search_service) && $search_service) print "&search_service=".$search_service; ?>'; + var _addrXML = './include/views/graphs/GetXmlGraph.php?multi='+multi+'&preg_split='+_preg_split+'&status='+_status+'&warning='+_warning+'&critical='+_critical+_metrics+'&template_id='+_tpl_id +'&period='+period+'&StartDate='+StartDate+'&EndDate='+EndDate+'&StartTime='+StartTime+'&EndTime='+EndTime+'&id='+id+'&sid=<?php echo $sid;?><?php if (isset($search_service) && $search_service) print "&search_service=".$search_service; ?>'; proc.setXml(_addrXML); proc.setXslt(_addrXSL); @@ -535,7 +535,7 @@ function nextPeriod() { } var start = parseInt((img_url.start * 1000) + ((coords.x1 - margeLeftGraph) * period / ($(img_name).width - margeLeftGraph - margeRightGraph))); var end = parseInt((img_url.start * 1000) + ((coords.x2 - margeLeftGraph) * period / ($(img_name).width - margeLeftGraph - margeRightGraph))); - var id = img_name.split('__')[0]; + var id = img_name.preg_split('__')[0]; id = id.replace('HS_', 'SS_'); document.FormPeriod.period.selectedIndex = 0; diff --git a/www/include/views/graphs/virtualMetrics/DB-Func.php b/www/include/views/graphs/virtualMetrics/DB-Func.php index 9139dc772bcf04171ce4f1ff79da92d41afa5d76..6ae7a89ffbfa28fdb54f85270ea7240528b32bc2 100644 --- a/www/include/views/graphs/virtualMetrics/DB-Func.php +++ b/www/include/views/graphs/virtualMetrics/DB-Func.php @@ -264,7 +264,7 @@ if ( $l_pqy->numRows() == 1 ) { $p_vmetric = $l_pqy->fetchRow(); $l_pqy->free(); - $l_mlist = split(",",$p_vmetric["rpn_function"]); + $l_mlist = preg_split(",",$p_vmetric["rpn_function"]); foreach ( $l_mlist as $l_mnane ){ $lv_ena = enableVirtualMetric(NULL, $l_mnane, $p_vmetric["index_id"]); if ( is_array($lv_ena)) diff --git a/www/install/step_upgrade/step3.php b/www/install/step_upgrade/step3.php index 9f6743c0c3b311f683565611f2d37fb976aa750e..bab225faeb47d937c0cfbf3a4f24993698b3ba1f 100644 --- a/www/install/step_upgrade/step3.php +++ b/www/install/step_upgrade/step3.php @@ -145,7 +145,7 @@ aff_header("Centreon Upgrade Wizard", "Verifying Configuration", 3); ?> <tr> <td><b> PEAR</b></td> <td align="right"><?php - $tab_path = split(":", get_include_path()); + $tab_path = preg_split(":", get_include_path()); $ok = 0; foreach ($tab_path as $path){ if (file_exists($path. '/PEAR.php')){ diff --git a/www/install/steps/step4.php b/www/install/steps/step4.php index 7283bc09b18799471f5d469dba85784ffb2d55ea..5a0ec4ce73ae1c8137a893045a759f23e1f1cb2a 100644 --- a/www/install/steps/step4.php +++ b/www/install/steps/step4.php @@ -143,7 +143,7 @@ aff_header("Centreon Setup Wizard", "Verifying Configuration", 4); ?> <tr> <td><b> PEAR</b></td> <td align="right"><?php - $tab_path = split(":", get_include_path()); + $tab_path = preg_split(":", get_include_path()); $ok = 0; foreach ($tab_path as $path){ if (file_exists($path. '/PEAR.php')){ diff --git a/www/install/steps/step5.php b/www/install/steps/step5.php index 46bda7e00a9a169722f8edd026a6d183e0eb76c7..271bac419aefcc29a577f6ffebf8e0ba553fa889 100644 --- a/www/install/steps/step5.php +++ b/www/install/steps/step5.php @@ -53,7 +53,7 @@ aff_header("Centreon Setup Wizard", "Verifying PHP Pear Component", 5); $msg = NULL; $alldeps = NULL; - $tab_path = split(":", get_include_path()); + $tab_path = preg_split(":", get_include_path()); foreach ($pear_module as $module) { ?> <tr> diff --git a/www/lib/ofc-library/open-flash-chart.php b/www/lib/ofc-library/open-flash-chart.php index 4037474438781127f9503c9b4e07a5b8a15173e3..de1b92ae4682fb768f3ebe94e57f3c21c95ef76a 100644 --- a/www/lib/ofc-library/open-flash-chart.php +++ b/www/lib/ofc-library/open-flash-chart.php @@ -175,7 +175,7 @@ class graph { // we replace the comma so it is not URL escaped // if it is, flash just thinks it is a comma - // which is no good if we are splitting the + // which is no good if we are preg_splitting the // string on commas. $tmp = str_replace( ',', '#comma#', $text ); // now we urlescape all dodgy characters (like & % $ etc..) diff --git a/www/main.php b/www/main.php index ebf1d409ae909e835fb52681b0fe209050f0a7b0..c09e909f99151c17147dbd0a3b44e3747f25e39c 100644 --- a/www/main.php +++ b/www/main.php @@ -113,7 +113,7 @@ $ret2 = get_child($ret['topology_page'], $centreon->user->access->topologyStr); if ($ret2["topology_url_opt"]) { if (!$o) { - $tab = split("\=", $ret2["topology_url_opt"]); + $tab = preg_split("\=", $ret2["topology_url_opt"]); $o = $tab[1]; } $p = $ret2["topology_page"]; @@ -122,7 +122,7 @@ $url = $ret2["topology_url"]; reset_search_page($url); if ($ret2["topology_url_opt"]){ - $tab = split("\=", $ret2["topology_url_opt"]); + $tab = preg_split("\=", $ret2["topology_url_opt"]); $o = $tab[1]; } } else { @@ -141,7 +141,7 @@ } else { if ($ret["topology_url_opt"]){ if (!$o) { - $tab = split("\=", $ret["topology_url_opt"]); + $tab = preg_split("\=", $ret["topology_url_opt"]); $o = $tab[1]; } $p = $ret["topology_page"]; diff --git a/www/stat.php b/www/stat.php index 9903d5c5339dd8dd34ece57349209cfd16628325..f7ba6fa40c5409abff0cac2aec94c09cac18d041 100644 --- a/www/stat.php +++ b/www/stat.php @@ -65,11 +65,11 @@ if (!(isset($lng) && file_exists('./sysinfo/includes/lang/' . $centreon->user->g $lng = 'en'; // see if the browser knows the right languange. if(isset($HTTP_ACCEPT_LANGUAGE)) { - $plng = split(',', $HTTP_ACCEPT_LANGUAGE); + $plng = preg_split(',', $HTTP_ACCEPT_LANGUAGE); if(count($plng) > 0) { while(list($k,$v) = each($plng)) { - $k = split(';', $v, 1); - $k = split('-', $k[0]); + $k = preg_split(';', $v, 1); + $k = preg_split('-', $k[0]); if(file_exists('./sysinfo/includes/lang/' . $k[0] . '.php')) { $lng = $k[0]; break;