mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Frytimo pr patches for php8.1 (#6630)
* Passing null to parameter #2 ($string) of type string is deprecated * Passing null to parameter #1 ($string) of type string is deprecated * php 8.1 fixes * php 8.1 fixes - replace strlen($var) > 0 with !empty($var) * php 8.1 fixes - replace ${var} with {$var} * php 8.1 fixes - replace ${var} with {$var} * php 8.1 fixes - replace ${var} with {$var} * php 8.1 fixes - replace ${var} with {$var} * php 8.1 fixes - strlower with null * php 8.1 fixes - strreplace with null * php 8.1 fixes - passing null to base64_decode * php 8.1 fixes - check for false and check for null on $this->dir * php 8.1 fixes - remove assignment of $db variable to modules object * php 8.1 fixes - avoid sending null to substr * php 8.1 fixes - change ${var} to {$var} * php 8.1 fixes - check for null before preg_replace * php 8.1 fixes - remove setting db variable on domains object * php 8.1 fixes - set empty string if $row['domain_setting_subcategory'] is null * php 8.1 fixes - set empty string if $_REQUEST['show'] is not available * php 8.1 fixes * php 8.1 fixes - correct $_POST checking syntax * php 8.1 fixes - correct $_POST variables * php 8.1 fixes * Use brackets consistently * Update user_setting_edit.php * Change to not empty * Update device.php * Update text.php --------- Co-authored-by: Tim Fry <tim@voipstratus.com> Co-authored-by: FusionPBX <markjcrane@gmail.com>
This commit is contained in:
@@ -77,8 +77,8 @@
|
||||
}
|
||||
|
||||
//create the sql query to get the xml cdr records
|
||||
if (strlen($order_by) == 0) { $order_by = "start_epoch"; }
|
||||
if (strlen($order) == 0) { $order = "desc"; }
|
||||
if (empty($order_by)) { $order_by = "start_epoch"; }
|
||||
if (empty($order)) { $order = "desc"; }
|
||||
|
||||
//get post or get variables from http
|
||||
if (isset($_REQUEST)) {
|
||||
@@ -112,7 +112,7 @@
|
||||
$bridge_uuid = $_REQUEST["network_addr"];
|
||||
$order_by = $_REQUEST["order_by"];
|
||||
$order = $_REQUEST["order"];
|
||||
if (strlen($_REQUEST["mos_comparison"]) > 0) {
|
||||
if (!empty($_REQUEST["mos_comparison"])) {
|
||||
switch($_REQUEST["mos_comparison"]) {
|
||||
case 'less':
|
||||
$mos_comparison = "<";
|
||||
@@ -163,96 +163,96 @@
|
||||
$sql_where_ands[] = "c.missed_call = true ";
|
||||
$sql_where_ands[] = "c.and hangup_cause <> 'LOSE_RACE' ";
|
||||
}
|
||||
if (strlen($start_epoch) > 0 && strlen($stop_epoch) > 0) {
|
||||
if (!empty($start_epoch) && !empty($stop_epoch)) {
|
||||
$sql_where_ands[] = "c.start_epoch between :start_epoch and :stop_epoch";
|
||||
$parameters['start_epoch'] = $start_epoch;
|
||||
$parameters['stop_epoch'] = $stop_epoch;
|
||||
}
|
||||
if (strlen($cdr_id) > 0) {
|
||||
if (!empty($cdr_id)) {
|
||||
$sql_where_ands[] = "c.cdr_id like :cdr_id";
|
||||
$parameters['cdr_id'] = '%'.$cdr_id.'%';
|
||||
}
|
||||
if (strlen($direction) > 0) {
|
||||
if (!empty($direction)) {
|
||||
$sql_where_ands[] = "c.direction = :direction";
|
||||
$parameters['direction'] = $direction;
|
||||
}
|
||||
if (strlen($caller_id_name) > 0) {
|
||||
if (!empty($caller_id_name)) {
|
||||
$mod_caller_id_name = str_replace("*", "%", $caller_id_name);
|
||||
$sql_where_ands[] = "c.caller_id_name like :mod_caller_id_name";
|
||||
$parameters['mod_caller_id_name'] = $mod_caller_id_name;
|
||||
}
|
||||
if (strlen($caller_extension_uuid) > 0) {
|
||||
if (!empty($caller_extension_uuid)) {
|
||||
$sql_where_ands[] = "c.extension_uuid = :caller_extension_uuid";
|
||||
$parameters['caller_extension_uuid'] = $caller_extension_uuid;
|
||||
}
|
||||
if (strlen($extension_uuid) > 0) {
|
||||
if (!empty($extension_uuid)) {
|
||||
$sql_where_ands[] = "c.extension_uuid = :extension_uuid";
|
||||
$parameters['extension_uuid'] = $extension_uuid;
|
||||
}
|
||||
if (strlen($caller_id_number) > 0) {
|
||||
if (!empty($caller_id_number)) {
|
||||
$mod_caller_id_number = str_replace("*", "%", $caller_id_number);
|
||||
$sql_where_ands[] = "c.caller_id_number like :mod_caller_id_number";
|
||||
$parameters['mod_caller_id_number'] = $mod_caller_id_number;
|
||||
}
|
||||
if (strlen($destination_number) > 0) {
|
||||
if (!empty($destination_number)) {
|
||||
$mod_destination_number = str_replace("*", "%", $destination_number);
|
||||
$sql_where_ands[] = "c.destination_number like :mod_destination_number";
|
||||
$parameters['mod_destination_number'] = $mod_destination_number;
|
||||
}
|
||||
if (strlen($context) > 0) {
|
||||
if (!empty($context)) {
|
||||
$sql_where_ands[] = "c.context like :context";
|
||||
$parameters['context'] = '%'.$context.'%';
|
||||
}
|
||||
/*
|
||||
if (strlen($start_stamp_begin) > 0 && strlen($start_stamp_end) > 0) {
|
||||
if (!empty($start_stamp_begin) && !empty($start_stamp_end)) {
|
||||
$sql_where_ands[] = "start_stamp between :start_stamp_begin and :start_stamp_end";
|
||||
$parameters['start_stamp_begin'] = $start_stamp_begin.':00.000';
|
||||
$parameters['start_stamp_end'] = $start_stamp_end.':59.999';
|
||||
}
|
||||
else if (strlen($start_stamp_begin) > 0) {
|
||||
else if (!empty($start_stamp_begin)) {
|
||||
$sql_where_ands[] = "start_stamp >= :start_stamp_begin";
|
||||
$parameters['start_stamp_begin'] = $start_stamp_begin.':00.000';
|
||||
}
|
||||
else if (strlen($start_stamp_end) > 0) {
|
||||
else if (!empty($start_stamp_end)) {
|
||||
$sql_where_ands[] = "start_stamp <= :start_stamp_end";
|
||||
$parameters['start_stamp_end'] = $start_stamp_end.':59.999';
|
||||
}
|
||||
*/
|
||||
if (strlen($answer_stamp_begin) > 0 && strlen($answer_stamp_end) > 0) {
|
||||
if (!empty($answer_stamp_begin) && !empty($answer_stamp_end)) {
|
||||
$sql_where_ands[] = "c.answer_stamp between :answer_stamp_begin and :answer_stamp_end";
|
||||
$parameters['answer_stamp_begin'] = $answer_stamp_begin.':00.000';
|
||||
$parameters['answer_stamp_end'] = $answer_stamp_end.':59.999';
|
||||
}
|
||||
else if (strlen($answer_stamp_begin) > 0) {
|
||||
else if (!empty($answer_stamp_begin)) {
|
||||
$sql_where_ands[] = "c.answer_stamp >= :answer_stamp_begin";
|
||||
$parameters['answer_stamp_begin'] = $answer_stamp_begin.':00.000';
|
||||
}
|
||||
else if (strlen($answer_stamp_end) > 0) {
|
||||
else if (!empty($answer_stamp_end)) {
|
||||
$sql_where_ands[] = "c.answer_stamp <= :answer_stamp_end";
|
||||
$parameters['answer_stamp_end'] = $answer_stamp_end.':59.999';
|
||||
}
|
||||
if (strlen($end_stamp_begin) > 0 && strlen($end_stamp_end) > 0) {
|
||||
if (!empty($end_stamp_begin) && !empty($end_stamp_end)) {
|
||||
$sql_where_ands[] = "c.end_stamp between :end_stamp_begin and :end_stamp_end";
|
||||
$parameters['end_stamp_begin'] = $end_stamp_begin.':00.000';
|
||||
$parameters['end_stamp_end'] = $end_stamp_end.':59.999';
|
||||
}
|
||||
else if (strlen($end_stamp_begin) > 0) {
|
||||
else if (!empty($end_stamp_begin)) {
|
||||
$sql_where_ands[] = "c.end_stamp >= :end_stamp_begin";
|
||||
$parameters['end_stamp_begin'] = $end_stamp_begin.':00.000';
|
||||
}
|
||||
else if (strlen($end_stamp_end) > 0) {
|
||||
else if (!empty($end_stamp_end)) {
|
||||
$sql_where_ands[] = "c.end_stamp <= :end_stamp_end";
|
||||
$parameters['end_stamp_end'] = $end_stamp_end.':59.999';
|
||||
}
|
||||
if (strlen($duration) > 0) {
|
||||
if (!empty($duration)) {
|
||||
$sql_where_ands[] = "c.duration like :duration";
|
||||
$parameters['duration'] = '%'.$duration.'%';
|
||||
}
|
||||
if (strlen($billsec) > 0) {
|
||||
if (!empty($billsec)) {
|
||||
$sql_where_ands[] = "c.billsec like :billsec";
|
||||
$parameters['billsec'] = '%'.$billsec.'%';
|
||||
}
|
||||
if (strlen($hangup_cause) > 0) {
|
||||
if (!empty($hangup_cause)) {
|
||||
$sql_where_ands[] = "c.hangup_cause like :hangup_cause";
|
||||
$parameters['hangup_cause'] = '%'.$hangup_cause.'%';
|
||||
}
|
||||
@@ -264,31 +264,31 @@
|
||||
$sql_where_ands[] = "c.bleg_uuid = :bleg_uuid";
|
||||
$parameters['bleg_uuid'] = $bleg_uuid;
|
||||
}
|
||||
if (strlen($accountcode) > 0) {
|
||||
if (!empty($accountcode)) {
|
||||
$sql_where_ands[] = "c.accountcode = :accountcode";
|
||||
$parameters['accountcode'] = $accountcode;
|
||||
}
|
||||
if (strlen($read_codec) > 0) {
|
||||
if (!empty($read_codec)) {
|
||||
$sql_where_ands[] = "c.read_codec like :read_codec";
|
||||
$parameters['read_codec'] = '%'.$read_codec.'%';
|
||||
}
|
||||
if (strlen($write_codec) > 0) {
|
||||
if (!empty($write_codec)) {
|
||||
$sql_where_ands[] = "c.write_codec like :write_codec";
|
||||
$parameters['write_codec'] = '%'.$write_codec.'%';
|
||||
}
|
||||
if (strlen($remote_media_ip) > 0) {
|
||||
if (!empty($remote_media_ip)) {
|
||||
$sql_where_ands[] = "c.remote_media_ip like :remote_media_ip";
|
||||
$parameters['remote_media_ip'] = '%'.$remote_media_ip.'%';
|
||||
}
|
||||
if (strlen($network_addr) > 0) {
|
||||
if (!empty($network_addr)) {
|
||||
$sql_where_ands[] = "c.network_addr like :network_addr";
|
||||
$parameters['network_addr'] = '%'.$network_addr.'%';
|
||||
}
|
||||
if (strlen($mos_comparison) > 0 && strlen($mos_score) > 0 ) {
|
||||
if (!empty($mos_comparison) && !empty($mos_score) ) {
|
||||
$sql_where_ands[] = "c.rtp_audio_in_mos ".$mos_comparison." :mos_score";
|
||||
$parameters['mos_score'] = $mos_score;
|
||||
}
|
||||
if (strlen($leg) > 0) {
|
||||
if (!empty($leg)) {
|
||||
$sql_where_ands[] = "c.leg = :leg";
|
||||
$parameters['leg'] = $leg;
|
||||
}
|
||||
@@ -324,7 +324,7 @@
|
||||
// if source submitted is blank, implement restriction for assigned extension(s)
|
||||
if ($caller_id_number == '') { // if source criteria is blank, then restrict to assigned ext
|
||||
foreach ($user_extensions as $user_extension) {
|
||||
if (strlen($user_extension) > 0) {
|
||||
if (!empty($user_extension)) {
|
||||
$sql_where_ors[] = "c.caller_id_number like :user_extension";
|
||||
$parameters['user_extension'] = $user_extension;
|
||||
}
|
||||
@@ -333,7 +333,7 @@
|
||||
// if destination submitted is blank, implement restriction for assigned extension(s)
|
||||
if ($destination_number == '') {
|
||||
foreach ($user_extensions as $user_extension) {
|
||||
if (strlen($user_extension) > 0) {
|
||||
if (!empty($user_extension)) {
|
||||
$sql_where_ors[] = "c.destination_number like :user_extension";
|
||||
$sql_where_ors[] = "c.destination_number like :star_99_user_extension";
|
||||
$parameters['user_extension'] = $user_extension;
|
||||
@@ -435,102 +435,102 @@
|
||||
if ($missed == true) {
|
||||
$sql .= "and c.missed_call = true ";
|
||||
}
|
||||
if (strlen($start_epoch) > 0 && strlen($stop_epoch) > 0) {
|
||||
if (!empty($start_epoch) && !empty($stop_epoch)) {
|
||||
$sql .= "and c.start_epoch between :start_epoch and :stop_epoch \n";
|
||||
$parameters['start_epoch'] = $start_epoch;
|
||||
$parameters['stop_epoch'] = $stop_epoch;
|
||||
}
|
||||
if (strlen($start_date) > 0 && strlen($stop_date) > 0) {
|
||||
if (!empty($start_date) && !empty($stop_date)) {
|
||||
$sql .= "and c.start_stamp between :start_date and :stop_date \n";
|
||||
$parameters['start_date'] = $start_date;
|
||||
$parameters['stop_date'] = $stop_date;
|
||||
}
|
||||
//if (strlen($start_stamp) == 0 && strlen($end_stamp) == 0) {
|
||||
//if (strlen($start_stamp) == 0 && empty($end_stamp)) {
|
||||
// $sql .= "and c.start_stamp between NOW() - INTERVAL '24 HOURS' AND NOW() \n";
|
||||
//}
|
||||
if (strlen($cdr_id) > 0) {
|
||||
if (!empty($cdr_id)) {
|
||||
$sql .= "and c.cdr_id like :cdr_id \n";
|
||||
$parameters['cdr_id'] = '%'.$cdr_id.'%';
|
||||
}
|
||||
if (strlen($direction) > 0) {
|
||||
if (!empty($direction)) {
|
||||
$sql .= "and c.direction = :direction \n";
|
||||
$parameters['direction'] = $direction;
|
||||
}
|
||||
if (strlen($caller_id_name) > 0) {
|
||||
if (!empty($caller_id_name)) {
|
||||
$mod_caller_id_name = str_replace("*", "%", $caller_id_name);
|
||||
$sql .= "and c.caller_id_name like :mod_caller_id_name";
|
||||
$parameters['mod_caller_id_name'] = $mod_caller_id_name;
|
||||
}
|
||||
if (strlen($caller_extension_uuid) > 0) {
|
||||
if (!empty($caller_extension_uuid)) {
|
||||
$sql .= "and c.extension_uuid = :caller_extension_uuid \n";
|
||||
$parameters['caller_extension_uuid'] = $caller_extension_uuid;
|
||||
}
|
||||
if (strlen($extension_uuid) > 0) {
|
||||
if (!empty($extension_uuid)) {
|
||||
$sql .= "and c.extension_uuid = :extension_uuid \n";
|
||||
$parameters['extension_uuid'] = $extension_uuid;
|
||||
}
|
||||
if (strlen($caller_id_number) > 0) {
|
||||
if (!empty($caller_id_number)) {
|
||||
$mod_caller_id_number = str_replace("*", "%", $caller_id_number);
|
||||
$sql .= "and c.caller_id_number like :mod_caller_id_number \n";
|
||||
$parameters['mod_caller_id_number'] = $mod_caller_id_number;
|
||||
}
|
||||
if (strlen($destination_number) > 0) {
|
||||
if (!empty($destination_number)) {
|
||||
$mod_destination_number = str_replace("*", "%", $destination_number);
|
||||
$sql .= "and c.destination_number like :mod_destination_number \n";
|
||||
$parameters['mod_destination_number'] = $mod_destination_number;
|
||||
}
|
||||
if (strlen($context) > 0) {
|
||||
if (!empty($context)) {
|
||||
$sql .= "and c.context like :context \n";
|
||||
$parameters['context'] = '%'.$context.'%';
|
||||
}
|
||||
if (strlen($start_stamp_begin) > 0 && strlen($start_stamp_end) > 0) {
|
||||
if (!empty($start_stamp_begin) && !empty($start_stamp_end)) {
|
||||
$sql .= "and c.start_stamp between :start_stamp_begin and :start_stamp_end \n";
|
||||
$parameters['start_stamp_begin'] = $start_stamp_begin.':00.000';
|
||||
$parameters['start_stamp_end'] = $start_stamp_end.':59.999';
|
||||
}
|
||||
else if (strlen($start_stamp_begin) > 0) {
|
||||
else if (!empty($start_stamp_begin)) {
|
||||
$sql .= "and c.start_stamp >= :start_stamp_begin \n";
|
||||
$parameters['start_stamp_begin'] = $start_stamp_begin.':00.000';
|
||||
}
|
||||
else if (strlen($start_stamp_end) > 0) {
|
||||
else if (!empty($start_stamp_end)) {
|
||||
$sql .= "and c.start_stamp <= :start_stamp_end \n";
|
||||
$parameters['start_stamp_end'] = $start_stamp_end.':59.999';
|
||||
}
|
||||
if (strlen($answer_stamp_begin) > 0 && strlen($answer_stamp_end) > 0) {
|
||||
if (!empty($answer_stamp_begin) && !empty($answer_stamp_end)) {
|
||||
$sql .= "and c.answer_stamp between :answer_stamp_begin and :answer_stamp_end \n";
|
||||
$parameters['answer_stamp_begin'] = $answer_stamp_begin.':00.000';
|
||||
$parameters['answer_stamp_end'] = $answer_stamp_end.':59.999';
|
||||
}
|
||||
else if (strlen($answer_stamp_begin) > 0) {
|
||||
else if (!empty($answer_stamp_begin)) {
|
||||
$sql .= "and c.answer_stamp >= :answer_stamp_begin \n";
|
||||
$parameters['answer_stamp_begin'] = $answer_stamp_begin.':00.000';
|
||||
}
|
||||
else if (strlen($answer_stamp_end) > 0) {
|
||||
else if (!empty($answer_stamp_end)) {
|
||||
$sql .= "and c.answer_stamp <= :answer_stamp_end \n";
|
||||
$parameters['answer_stamp_end'] = $answer_stamp_end.':59.999';
|
||||
}
|
||||
if (strlen($end_stamp_begin) > 0 && strlen($end_stamp_end) > 0) {
|
||||
if (!empty($end_stamp_begin) && !empty($end_stamp_end)) {
|
||||
$sql .= "and c.end_stamp between :end_stamp_begin and :end_stamp_end \n";
|
||||
$parameters['end_stamp_begin'] = $end_stamp_begin.':00.000';
|
||||
$parameters['end_stamp_end'] = $end_stamp_end.':59.999';
|
||||
}
|
||||
else if (strlen($end_stamp_begin) > 0) {
|
||||
else if (!empty($end_stamp_begin)) {
|
||||
$sql .= "and c.end_stamp >= :end_stamp_begin \n";
|
||||
$parameters['end_stamp_begin'] = $end_stamp_begin.':00.000';
|
||||
}
|
||||
else if (strlen($end_stamp_end) > 0) {
|
||||
else if (!empty($end_stamp_end)) {
|
||||
$sql .= "and c.end_stamp <= :end_stamp_end \n";
|
||||
$parameters['end_stamp_end'] = $end_stamp_end.':59.999';
|
||||
}
|
||||
if (strlen($duration) > 0) {
|
||||
if (!empty($duration)) {
|
||||
$sql .= "and c.duration like :duration \n";
|
||||
$parameters['duration'] = '%'.$duration.'%';
|
||||
}
|
||||
if (strlen($billsec) > 0) {
|
||||
if (!empty($billsec)) {
|
||||
$sql .= "and c.billsec like :billsec \n";
|
||||
$parameters['billsec'] = '%'.$billsec.'%';
|
||||
}
|
||||
if (strlen($hangup_cause) > 0) {
|
||||
if (!empty($hangup_cause)) {
|
||||
$sql .= "and c.hangup_cause like :hangup_cause \n";
|
||||
$parameters['hangup_cause'] = '%'.$hangup_cause.'%';
|
||||
}
|
||||
@@ -542,31 +542,31 @@
|
||||
$sql .= "and c.bleg_uuid = :bleg_uuid \n";
|
||||
$parameters['bleg_uuid'] = $bleg_uuid;
|
||||
}
|
||||
if (strlen($accountcode) > 0) {
|
||||
if (!empty($accountcode)) {
|
||||
$sql .= "and c.accountcode = :accountcode \n";
|
||||
$parameters['accountcode'] = $accountcode;
|
||||
}
|
||||
if (strlen($read_codec) > 0) {
|
||||
if (!empty($read_codec)) {
|
||||
$sql .= "and c.read_codec like :read_codec \n";
|
||||
$parameters['read_codec'] = '%'.$read_codec.'%';
|
||||
}
|
||||
if (strlen($write_codec) > 0) {
|
||||
if (!empty($write_codec)) {
|
||||
$sql .= "and c.write_codec like :write_codec \n";
|
||||
$parameters['write_codec'] = '%'.$write_codec.'%';
|
||||
}
|
||||
if (strlen($remote_media_ip) > 0) {
|
||||
if (!empty($remote_media_ip)) {
|
||||
$sql .= "and c.remote_media_ip like :remote_media_ip \n";
|
||||
$parameters['remote_media_ip'] = '%'.$remote_media_ip.'%';
|
||||
}
|
||||
if (strlen($network_addr) > 0) {
|
||||
if (!empty($network_addr)) {
|
||||
$sql .= "and c.network_addr like :network_addr \n";
|
||||
$parameters['network_addr'] = '%'.$network_addr.'%';
|
||||
}
|
||||
if (strlen($mos_comparison) > 0 && strlen($mos_score) > 0 ) {
|
||||
if (!empty($mos_comparison) && !empty($mos_score) ) {
|
||||
$sql .= "and c.rtp_audio_in_mos ".$mos_comparison." :mos_score \n";
|
||||
$parameters['mos_score'] = $mos_score;
|
||||
}
|
||||
if (strlen($leg) > 0) {
|
||||
if (!empty($leg)) {
|
||||
$sql .= "and c.leg = :leg \n";
|
||||
$parameters['leg'] = $leg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user