From 30c437676595c8a6ceb93990ef32a60b38f32fae Mon Sep 17 00:00:00 2001 From: Adam Zammit Date: Thu, 28 Jan 2021 14:24:26 +1100 Subject: [PATCH] Remove deprecated functions for php 7.4 --- admin/availability.php | 4 ++-- admin/callrestrict.php | 4 ++-- admin/clients.php | 10 +++++----- admin/operators.php | 16 ++++++++-------- admin/shifttemplate.php | 4 ++-- admin/timezonetemplate.php | 4 ++-- functions/functions.operator.php | 8 ++++---- functions/functions.process.php | 2 +- include/pear/HTML/QuickForm.php | 2 +- include/pear/PEAR/Config.php | 2 +- include/pear/PEAR/DependencyDB.php | 4 ++-- include/pear/PEAR/Registry.php | 6 +++--- include/php-gettext-1.0.11/gettext.php | 2 +- include/php-gettext-1.0.11/streams.php | 6 +++--- 14 files changed, 37 insertions(+), 37 deletions(-) diff --git a/admin/availability.php b/admin/availability.php index d6a21d99..87daef5d 100644 --- a/admin/availability.php +++ b/admin/availability.php @@ -94,8 +94,8 @@ if (isset($_POST['day'])) $val = intval($val); $key = intval($key); - $start = $db->qstr($_POST['start'][$key],get_magic_quotes_gpc()); - $end = $db->qstr($_POST['end'][$key],get_magic_quotes_gpc()); + $start = $db->qstr($_POST['start'][$key],0); + $end = $db->qstr($_POST['end'][$key],0); $sql = "INSERT INTO availability (day_of_week,start,end,availability_group_id) VALUES ('$val',$start,$end,$availability_group)"; diff --git a/admin/callrestrict.php b/admin/callrestrict.php index 044a3d74..bc205318 100644 --- a/admin/callrestrict.php +++ b/admin/callrestrict.php @@ -88,8 +88,8 @@ if (isset($_POST['day'])) $val = intval($val); $key = intval($key); - $start = $db->qstr($_POST['start'][$key],get_magic_quotes_gpc()); - $end = $db->qstr($_POST['end'][$key],get_magic_quotes_gpc()); + $start = $db->qstr($_POST['start'][$key],0); + $end = $db->qstr($_POST['end'][$key],0); $sql = "INSERT INTO call_restrict (day_of_week,start,end) VALUES ('$val',$start,$end)"; diff --git a/admin/clients.php b/admin/clients.php index b9bfdd93..eebf9e4f 100644 --- a/admin/clients.php +++ b/admin/clients.php @@ -61,11 +61,11 @@ $client =""; $firstname="";$lastname="";$email=""; $time_zone_name=""; if (isset($_POST['client']) && !empty($_POST['client'])) { - $client = $db->qstr($_POST['client'],get_magic_quotes_gpc()); - $firstname = $db->qstr($_POST['firstname'],get_magic_quotes_gpc()); - $email = $db->qstr($_POST['email'],get_magic_quotes_gpc()); - $lastname = $db->qstr($_POST['lastname'],get_magic_quotes_gpc()); - $time_zone_name = $db->qstr($_POST['Time_zone_name'],get_magic_quotes_gpc()); + $client = $db->qstr($_POST['client'],0); + $firstname = $db->qstr($_POST['firstname'],0); + $email = $db->qstr($_POST['email'],0); + $lastname = $db->qstr($_POST['lastname'],0); + $time_zone_name = $db->qstr($_POST['Time_zone_name'],0); /* check if there'a record with this username*/ $sql = "SELECT `username`,`client_id` from client WHERE `username` LIKE $client"; diff --git a/admin/operators.php b/admin/operators.php index ba245d64..1a3d6315 100644 --- a/admin/operators.php +++ b/admin/operators.php @@ -56,14 +56,14 @@ $a = false; if (isset($_POST['operator']) && isset($_POST['adduser'])) { - $operator = $db->qstr($_POST['operator'],get_magic_quotes_gpc()); - $email= $db->qstr($_POST['email'],get_magic_quotes_gpc()); - $password = $db->qstr($_POST['password'],get_magic_quotes_gpc()); - $firstname = $db->qstr($_POST['firstname'],get_magic_quotes_gpc()); - $lastname = $db->qstr($_POST['lastname'],get_magic_quotes_gpc()); - $chat_user = $db->qstr($_POST['chat_user'],get_magic_quotes_gpc()); - $chat_password = $db->qstr($_POST['chat_password'],get_magic_quotes_gpc()); - $time_zone_name = $db->qstr($_POST['Time_zone_name'],get_magic_quotes_gpc()); + $operator = $db->qstr($_POST['operator'],0); + $email= $db->qstr($_POST['email'],0); + $password = $db->qstr($_POST['password'],0); + $firstname = $db->qstr($_POST['firstname'],0); + $lastname = $db->qstr($_POST['lastname'],0); + $chat_user = $db->qstr($_POST['chat_user'],0); + $chat_password = $db->qstr($_POST['chat_password'],0); + $time_zone_name = $db->qstr($_POST['Time_zone_name'],0); $extension = ""; if (FREEPBX_PATH != false) { diff --git a/admin/shifttemplate.php b/admin/shifttemplate.php index f2227093..ce45e1b4 100644 --- a/admin/shifttemplate.php +++ b/admin/shifttemplate.php @@ -85,8 +85,8 @@ if (isset($_POST['day'])) $val = intval($val); $key = intval($key); - $start = $db->qstr($_POST['start'][$key],get_magic_quotes_gpc()); - $end = $db->qstr($_POST['end'][$key],get_magic_quotes_gpc()); + $start = $db->qstr($_POST['start'][$key],0); + $end = $db->qstr($_POST['end'][$key],0); $sql = "INSERT INTO shift_template(day_of_week,start,end) VALUES ($val,$start,$end)"; diff --git a/admin/timezonetemplate.php b/admin/timezonetemplate.php index 75265c7c..0e875fd1 100644 --- a/admin/timezonetemplate.php +++ b/admin/timezonetemplate.php @@ -72,7 +72,7 @@ if (isset($_GET['time_zone'])) { //need to add sample to questionnaire - $tz = $db->qstr($_GET['time_zone'],get_magic_quotes_gpc()); + $tz = $db->qstr($_GET['time_zone'],0); $sql = "INSERT INTO timezone_template(Time_zone_name) VALUES($tz)"; @@ -85,7 +85,7 @@ if (isset($_GET['tz'])) { //need to remove rsid from questionnaire - $tz = $db->qstr($_GET['tz'],get_magic_quotes_gpc()); + $tz = $db->qstr($_GET['tz'],0); $sql = "DELETE FROM timezone_template WHERE Time_zone_name = $tz"; diff --git a/functions/functions.operator.php b/functions/functions.operator.php index bdcc52d9..f203da8e 100644 --- a/functions/functions.operator.php +++ b/functions/functions.operator.php @@ -2534,10 +2534,10 @@ function add_respondent($case_id,$firstName,$lastName,$Time_zone_name) { global $db; - $case_id = $db->qstr($case_id,get_magic_quotes_gpc()); - $firstName = $db->qstr($firstName,get_magic_quotes_gpc()); - $lastName = $db->qstr($lastName,get_magic_quotes_gpc()); - $Time_zone_name = $db->qstr($Time_zone_name,get_magic_quotes_gpc()); + $case_id = $db->qstr($case_id,0); + $firstName = $db->qstr($firstName,0); + $lastName = $db->qstr($lastName,0); + $Time_zone_name = $db->qstr($Time_zone_name,0); $sql = "INSERT INTO respondent (respondent_id,case_id,firstName,lastName,Time_zone_name) VALUES (NULL,$case_id,$firstName,$lastName,$Time_zone_name)"; diff --git a/functions/functions.process.php b/functions/functions.process.php index 12388053..678a2f6d 100644 --- a/functions/functions.process.php +++ b/functions/functions.process.php @@ -185,7 +185,7 @@ function process_append_data($process_id,$data) { global $db; - $data = $db->qstr($data,get_magic_quotes_gpc()); + $data = $db->qstr($data,0); $sql = "INSERT INTO `process_log` (process_log_id,process_id,datetime,data) VALUES (NULL,'$process_id',NOW(),$data)"; diff --git a/include/pear/HTML/QuickForm.php b/include/pear/HTML/QuickForm.php index 649af05d..167857e6 100644 --- a/include/pear/HTML/QuickForm.php +++ b/include/pear/HTML/QuickForm.php @@ -290,7 +290,7 @@ class HTML_QuickForm extends HTML_Common $attributes = array('action'=>$action, 'method'=>$method, 'name'=>$formName, 'id'=>$formName) + $target; $this->updateAttributes($attributes); if (!$trackSubmit || isset($_REQUEST['_qf__' . $formName])) { - if (1 == get_magic_quotes_gpc()) { + if (1 == 0) { $this->_submitValues = $this->_recursiveFilter('stripslashes', 'get' == $method? $_GET: $_POST); foreach ($_FILES as $keyFirst => $valFirst) { foreach ($valFirst as $keySecond => $valSecond) { diff --git a/include/pear/PEAR/Config.php b/include/pear/PEAR/Config.php index 1992e681..c13c74fe 100644 --- a/include/pear/PEAR/Config.php +++ b/include/pear/PEAR/Config.php @@ -970,7 +970,7 @@ class PEAR_Config extends PEAR return $this->raiseError("PEAR_Config::readConfigFile fopen('$file','r') failed"); } $size = filesize($file); - $rt = get_magic_quotes_runtime(); + $rt = 0; set_magic_quotes_runtime(0); if (function_exists('file_get_contents')) { fclose($fp); diff --git a/include/pear/PEAR/DependencyDB.php b/include/pear/PEAR/DependencyDB.php index 840cf673..db8856a6 100644 --- a/include/pear/PEAR/DependencyDB.php +++ b/include/pear/PEAR/DependencyDB.php @@ -501,7 +501,7 @@ class PEAR_DependencyDB $err = PEAR::raiseError("Could not open dependencies file `".$this->_depdb."'"); return $err; } - $rt = get_magic_quotes_runtime(); + $rt = 0; set_magic_quotes_runtime(0); clearstatcache(); if (function_exists('file_get_contents')) { @@ -531,7 +531,7 @@ class PEAR_DependencyDB $this->_unlock(); return PEAR::raiseError("Could not open dependencies file `".$this->_depdb."' for writing"); } - $rt = get_magic_quotes_runtime(); + $rt = 0; set_magic_quotes_runtime(0); fwrite($fp, serialize($deps)); set_magic_quotes_runtime($rt); diff --git a/include/pear/PEAR/Registry.php b/include/pear/PEAR/Registry.php index b198eba3..35460bde 100644 --- a/include/pear/PEAR/Registry.php +++ b/include/pear/PEAR/Registry.php @@ -696,7 +696,7 @@ class PEAR_Registry extends PEAR return $this->raiseError('PEAR_Registry: could not open filemap "' . $this->filemap . '"', PEAR_REGISTRY_ERROR_FILE, null, null, $php_errormsg); } clearstatcache(); - $rt = get_magic_quotes_runtime(); + $rt = 0; set_magic_quotes_runtime(0); $fsize = filesize($this->filemap); if (function_exists('file_get_contents')) { @@ -998,7 +998,7 @@ class PEAR_Registry extends PEAR if ($fp === null) { return null; } - $rt = get_magic_quotes_runtime(); + $rt = 0; set_magic_quotes_runtime(0); clearstatcache(); if (function_exists('file_get_contents')) { @@ -1040,7 +1040,7 @@ class PEAR_Registry extends PEAR if ($fp === null) { return null; } - $rt = get_magic_quotes_runtime(); + $rt = 0; set_magic_quotes_runtime(0); clearstatcache(); if (function_exists('file_get_contents')) { diff --git a/include/php-gettext-1.0.11/gettext.php b/include/php-gettext-1.0.11/gettext.php index 5064047c..81af5550 100755 --- a/include/php-gettext-1.0.11/gettext.php +++ b/include/php-gettext-1.0.11/gettext.php @@ -98,7 +98,7 @@ class gettext_reader { * @param object Reader the StreamReader object * @param boolean enable_cache Enable or disable caching of strings (default on) */ - function gettext_reader($Reader, $enable_cache = true) { + function __construct($Reader, $enable_cache = true) { // If there isn't a StreamReader, turn on short circuit mode. if (! $Reader || isset($Reader->error) ) { $this->short_circuit = true; diff --git a/include/php-gettext-1.0.11/streams.php b/include/php-gettext-1.0.11/streams.php index 3cdc1584..00cf6cc5 100644 --- a/include/php-gettext-1.0.11/streams.php +++ b/include/php-gettext-1.0.11/streams.php @@ -49,7 +49,7 @@ class StringReader { var $_pos; var $_str; - function StringReader($str='') { + function __construct($str='') { $this->_str = $str; $this->_pos = 0; } @@ -86,7 +86,7 @@ class FileReader { var $_fd; var $_length; - function FileReader($filename) { + function __construct($filename) { if (file_exists($filename)) { $this->_length=filesize($filename); @@ -143,7 +143,7 @@ class FileReader { // Preloads entire file in memory first, then creates a StringReader // over it (it assumes knowledge of StringReader internals) class CachedFileReader extends StringReader { - function CachedFileReader($filename) { + function __construct($filename) { if (file_exists($filename)) { $length=filesize($filename);