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:
frytimo
2023-05-05 10:46:37 -06:00
committed by GitHub
co-authored by Tim Fry FusionPBX
parent ebbb2f1a72
commit fef8165be2
230 changed files with 1948 additions and 1937 deletions
+10 -10
View File
@@ -6309,7 +6309,7 @@ class TCPDF {
public function Write($h, $txt, $link='', $fill=false, $align='', $ln=false, $stretch=0, $firstline=false, $firstblock=false, $maxh=0, $wadj=0, $margin='') {
// check page for no-write regions and adapt page margins if necessary
list($this->x, $this->y) = $this->checkPageRegions($h, $this->x, $this->y);
if (strlen($txt) == 0) {
if (empty($txt)) {
// fix empty text
$txt = ' ';
}
@@ -10432,7 +10432,7 @@ class TCPDF {
$lnkdata = explode(',', $url);
if (isset($lnkdata[0]) ) {
$page = substr($lnkdata[0], 1);
if (isset($lnkdata[1]) AND (strlen($lnkdata[1]) > 0)) {
if (isset($lnkdata[1]) AND (!empty($lnkdata[1]))) {
$lnky = floatval($lnkdata[1]);
} else {
$lnky = 0;
@@ -13476,10 +13476,10 @@ class TCPDF {
$this->sig_obj_id = $this->n; // signature widget
++$this->n; // signature object ($this->sig_obj_id + 1)
$this->signature_data = array();
if (strlen($signing_cert) == 0) {
if (empty($signing_cert)) {
$this->Error('Please provide a certificate file and password!');
}
if (strlen($private_key) == 0) {
if (empty($private_key)) {
$private_key = $signing_cert;
}
$this->signature_data['signcert'] = $signing_cert;
@@ -13574,7 +13574,7 @@ class TCPDF {
if (!function_exists('curl_init')) {
$this->Error('Please enable cURL PHP extension!');
}
if (strlen($tsa_host) == 0) {
if (empty($tsa_host)) {
$this->Error('Please specify the host of Time Stamping Authority (TSA)!');
}
$this->tsa_data['tsa_host'] = $tsa_host;
@@ -16326,7 +16326,7 @@ class TCPDF {
if (preg_match('/href[\s]*=[\s]*"([^"]*)"/', $link, $type) > 0) {
// read CSS data file
$cssdata = TCPDF_STATIC::fileGetContents(trim($type[1]));
if (($cssdata !== FALSE) AND (strlen($cssdata) > 0)) {
if (($cssdata !== FALSE) AND (!empty($cssdata))) {
$css = array_merge($css, TCPDF_STATIC::extractCSSproperties($cssdata));
}
}
@@ -17604,7 +17604,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
}
}
// align lines
if ($this->newline AND (strlen($dom[$key]['value']) > 0) AND ($dom[$key]['value'] != 'td') AND ($dom[$key]['value'] != 'th')) {
if ($this->newline AND (!empty($dom[$key]['value'])) AND ($dom[$key]['value'] != 'td') AND ($dom[$key]['value'] != 'th')) {
$newline = true;
$fontaligned = false;
// we are at the beginning of a new line
@@ -18352,7 +18352,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$startlinepage = $this->page;
}
}
} elseif (strlen($dom[$key]['value']) > 0) {
} elseif (!empty($dom[$key]['value'])) {
// print list-item
if (!TCPDF_STATIC::empty_string($this->lispacer) AND ($this->lispacer != '^')) {
$this->SetFont($pfontname, $pfontstyle, $pfontsize);
@@ -18501,7 +18501,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
}
}
$this->textindent = 0;
if (strlen($strrest) > 0) {
if (!empty($strrest)) {
// store the remaining string on the previous $key position
$this->newline = true;
if ($strrest == $dom[$key]['value']) {
@@ -18948,7 +18948,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
if (empty($page) OR ($page <= 0)) {
$page = $this->page;
}
if (isset($lnkdata[1]) AND (strlen($lnkdata[1]) > 0)) {
if (isset($lnkdata[1]) AND (!empty($lnkdata[1]))) {
$lnky = floatval($lnkdata[1]);
} else {
$lnky = 0;