mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-21 18:36:31 +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:
@@ -209,7 +209,7 @@ if (!class_exists('xml_cdr')) {
|
||||
if (isset($this->fields)) {
|
||||
foreach ($this->fields as $field) {
|
||||
$field = preg_replace('#[^a-zA-Z0-9_\-]#', '', $field);
|
||||
if (isset($row[$field]) && strlen($row[$field]) > 0) {
|
||||
if (isset($row[$field]) && !empty($row[$field])) {
|
||||
$array['xml_cdr'][0][$field] = $row[$field];
|
||||
}
|
||||
}
|
||||
@@ -362,7 +362,7 @@ if (!class_exists('xml_cdr')) {
|
||||
unset($i);
|
||||
|
||||
//if last_sent_callee_id_number is set use it for the destination_number
|
||||
if (strlen($xml->variables->last_sent_callee_id_number) > 0) {
|
||||
if (!empty($xml->variables->last_sent_callee_id_number)) {
|
||||
$destination_number = urldecode($xml->variables->last_sent_callee_id_number);
|
||||
}
|
||||
|
||||
@@ -514,7 +514,7 @@ if (!class_exists('xml_cdr')) {
|
||||
|
||||
//call quality
|
||||
$rtp_audio_in_mos = urldecode($xml->variables->rtp_audio_in_mos);
|
||||
if (strlen($rtp_audio_in_mos) > 0) {
|
||||
if (!empty($rtp_audio_in_mos)) {
|
||||
$this->array[$key]['rtp_audio_in_mos'] = $rtp_audio_in_mos;
|
||||
}
|
||||
|
||||
@@ -539,18 +539,18 @@ if (!class_exists('xml_cdr')) {
|
||||
$domain_uuid = urldecode($xml->variables->domain_uuid);
|
||||
|
||||
//get the domain name
|
||||
if (strlen($domain_name) == 0) {
|
||||
if (empty($domain_name)) {
|
||||
$domain_name = urldecode($xml->variables->dialed_domain);
|
||||
}
|
||||
if (strlen($domain_name) == 0) {
|
||||
if (empty($domain_name)) {
|
||||
$domain_name = urldecode($xml->variables->sip_invite_domain);
|
||||
}
|
||||
if (strlen($domain_name) == 0) {
|
||||
if (empty($domain_name)) {
|
||||
$domain_name = urldecode($xml->variables->sip_req_host);
|
||||
}
|
||||
if (strlen($domain_name) == 0) {
|
||||
if (empty($domain_name)) {
|
||||
$presence_id = urldecode($xml->variables->presence_id);
|
||||
if (strlen($presence_id) > 0) {
|
||||
if (!empty($presence_id)) {
|
||||
$presence_array = explode($presence_id, '%40');
|
||||
$domain_name = $presence_array[1];
|
||||
}
|
||||
@@ -586,9 +586,9 @@ if (!class_exists('xml_cdr')) {
|
||||
//$this->log("\ndomain_name is `$domain_name`;\ndomain_uuid is '$domain_uuid'\n");
|
||||
|
||||
//get the domain_uuid with the domain_name
|
||||
if (strlen($domain_uuid) == 0) {
|
||||
if (empty($domain_uuid)) {
|
||||
$sql = "select domain_uuid from v_domains ";
|
||||
if (strlen($domain_name) == 0 && $context != 'public' && $context != 'default') {
|
||||
if (empty($domain_name) && $context != 'public' && $context != 'default') {
|
||||
$sql .= "where domain_name = :context ";
|
||||
$parameters['context'] = $context;
|
||||
}
|
||||
@@ -602,10 +602,10 @@ if (!class_exists('xml_cdr')) {
|
||||
}
|
||||
|
||||
//set values in the database
|
||||
if (strlen($domain_uuid) > 0) {
|
||||
if (!empty($domain_uuid)) {
|
||||
$this->array[$key]['domain_uuid'] = $domain_uuid;
|
||||
}
|
||||
if (strlen($domain_name) > 0) {
|
||||
if (!empty($domain_name)) {
|
||||
$this->array[$key]['domain_name'] = $domain_name;
|
||||
}
|
||||
|
||||
@@ -635,17 +635,17 @@ if (!class_exists('xml_cdr')) {
|
||||
$record_name = urldecode($xml->variables->record_name);
|
||||
$record_length = urldecode($xml->variables->duration);
|
||||
}
|
||||
elseif (strlen($xml->variables->sofia_record_file) > 0) {
|
||||
elseif (!empty($xml->variables->sofia_record_file)) {
|
||||
$record_path = dirname(urldecode($xml->variables->sofia_record_file));
|
||||
$record_name = basename(urldecode($xml->variables->sofia_record_file));
|
||||
$record_length = urldecode($xml->variables->record_seconds);
|
||||
}
|
||||
elseif (strlen($xml->variables->cc_record_filename) > 0) {
|
||||
elseif (!empty($xml->variables->cc_record_filename)) {
|
||||
$record_path = dirname(urldecode($xml->variables->cc_record_filename));
|
||||
$record_name = basename(urldecode($xml->variables->cc_record_filename));
|
||||
$record_length = urldecode($xml->variables->record_seconds);
|
||||
}
|
||||
elseif (strlen($xml->variables->api_on_answer) > 0) {
|
||||
elseif (!empty($xml->variables->api_on_answer)) {
|
||||
$command = str_replace("\n", " ", urldecode($xml->variables->api_on_answer));
|
||||
$parts = explode(" ", $command);
|
||||
if ($parts[0] == "uuid_record") {
|
||||
@@ -655,13 +655,13 @@ if (!class_exists('xml_cdr')) {
|
||||
$record_length = urldecode($xml->variables->duration);
|
||||
}
|
||||
}
|
||||
elseif (strlen($xml->variables->conference_recording) > 0) {
|
||||
elseif (!empty($xml->variables->conference_recording)) {
|
||||
$conference_recording = urldecode($xml->variables->conference_recording);
|
||||
$record_path = dirname($conference_recording);
|
||||
$record_name = basename($conference_recording);
|
||||
$record_length = urldecode($xml->variables->duration);
|
||||
}
|
||||
elseif (strlen($xml->variables->current_application_data) > 0) {
|
||||
elseif (!empty($xml->variables->current_application_data)) {
|
||||
$commands = explode(",", urldecode($xml->variables->current_application_data));
|
||||
foreach ($commands as $command) {
|
||||
$cmd = explode("=", $command);
|
||||
@@ -705,7 +705,7 @@ if (!class_exists('xml_cdr')) {
|
||||
}
|
||||
|
||||
//last check
|
||||
if (!isset($record_name) || is_null ($record_name) || (strlen($record_name) == 0)) {
|
||||
if (!isset($record_name) || is_null ($record_name) || (empty($record_name))) {
|
||||
$bridge_uuid = urldecode($xml->variables->bridge_uuid) ?: $last_bridge ;
|
||||
$path = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name.'/archive/'.$start_year.'/'.$start_month.'/'.$start_day;
|
||||
if (file_exists($path.'/'.$bridge_uuid.'.wav')) {
|
||||
@@ -862,7 +862,7 @@ if (!class_exists('xml_cdr')) {
|
||||
}
|
||||
|
||||
if ($_SESSION['cdr']['storage']['text'] == "dir" && $error != "true") {
|
||||
if (strlen($uuid) > 0) {
|
||||
if (!empty($uuid)) {
|
||||
$tmp_dir = $_SESSION['switch']['log']['dir'].'/xml_cdr/archive/'.$start_year.'/'.$start_month.'/'.$start_day;
|
||||
if(!file_exists($tmp_dir)) {
|
||||
mkdir($tmp_dir, 0770, true);
|
||||
@@ -973,7 +973,7 @@ if (!class_exists('xml_cdr')) {
|
||||
|
||||
//authentication for xml cdr http post
|
||||
if (!defined('STDIN')) {
|
||||
if ($_SESSION["cdr"]["http_enabled"]["boolean"] == "true" && strlen($_SESSION["xml_cdr"]["username"]) == 0) {
|
||||
if ($_SESSION["cdr"]["http_enabled"]["boolean"] == "true" && empty($_SESSION["xml_cdr"]["username"])) {
|
||||
//get the contents of xml_cdr.conf.xml
|
||||
$conf_xml_string = file_get_contents($_SESSION['switch']['conf']['dir'].'/autoload_configs/xml_cdr.conf.xml');
|
||||
|
||||
@@ -1065,19 +1065,19 @@ if (!class_exists('xml_cdr')) {
|
||||
}
|
||||
|
||||
//build the date range
|
||||
if (strlen($this->start_stamp_begin) > 0 || strlen($this->start_stamp_end) > 0) {
|
||||
if (strlen($this->start_stamp_begin) > 0 || !empty($this->start_stamp_end)) {
|
||||
unset($this->quick_select);
|
||||
if (strlen($this->start_stamp_begin) > 0 && strlen($this->start_stamp_end) > 0) {
|
||||
if (strlen($this->start_stamp_begin) > 0 && !empty($this->start_stamp_end)) {
|
||||
$sql_date_range = " and start_stamp between :start_stamp_begin::timestamptz and :start_stamp_end::timestamptz \n";
|
||||
$parameters['start_stamp_begin'] = $this->start_stamp_begin.':00.000 '.$time_zone;
|
||||
$parameters['start_stamp_end'] = $this->start_stamp_end.':59.999 '.$time_zone;
|
||||
}
|
||||
else {
|
||||
if (strlen($this->start_stamp_begin) > 0) {
|
||||
if (!empty($this->start_stamp_begin)) {
|
||||
$sql_date_range = "and start_stamp >= :start_stamp_begin::timestamptz \n";
|
||||
$parameters['start_stamp_begin'] = $this->start_stamp_begin.':00.000 '.$time_zone;
|
||||
}
|
||||
if (strlen($this->start_stamp_end) > 0) {
|
||||
if (!empty($this->start_stamp_end)) {
|
||||
$sql_date_range .= "and start_stamp <= :start_stamp_end::timestamptz \n";
|
||||
$parameters['start_stamp_end'] = $this->start_stamp_end.':59.999 '.$time_zone;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user