PHP8.1 compatibility

This commit is contained in:
sparkyx 2023-07-16 18:00:40 +02:00
parent 4420a634c3
commit bc50a2996e
5 changed files with 6 additions and 6 deletions

View file

@ -39,7 +39,7 @@ class Database extends DatabaseCore
function __construct($p_database_id = 0, $p_type = 'dos')
{
if (IsNumber($p_database_id) == false || strlen($p_database_id) > 10)
if (IsNumber($p_database_id) == false || strlen($p_database_id??"") > 10)
die("-->Dossier invalide [$p_database_id]");
$noalyss_user = (defined("noalyss_user")) ? noalyss_user : phpcompta_user;
$password = (defined("noalyss_password")) ? noalyss_password : phpcompta_password;
@ -90,7 +90,7 @@ class Database extends DatabaseCore
if (pg_num_rows($ret) != 0) {
$r = pg_fetch_array($ret, 0);
$old_oid = $r['jr_pj'];
if (strlen($old_oid) != 0)
if (strlen($old_oid??"") != 0)
$this->lo_unlink( $old_oid);
}
// Load new document

View file

@ -108,7 +108,7 @@ class IText extends HtmlInput
$extra=(isset($this->extra))?$this->extra:"";
$readonly=" readonly ";
$this->value=htmlentities($this->value, ENT_COMPAT|ENT_QUOTES, "UTF-8");
$this->value=htmlentities($this->value??"", ENT_COMPAT|ENT_QUOTES, "UTF-8");
$this->style=' class="input_text_ro" ';
if ( ! isset ($this->css_size))
{

View file

@ -179,7 +179,7 @@ abstract class Table_Data_SQL extends Data_SQL
$sql=$this->build_query();
$pk=$this->primary_key;
// primary cannot be null or empty
if (trim($this->$pk)==="" || $this->$pk===null) {
if (trim($this->$pk??"")==="" || $this->$pk===null) {
$this->pk=-1;
return false;
}

View file

@ -67,7 +67,7 @@ global $div,$g_parameter,$cn,$access,$jr_id,$obj;
<td>
<?php
$itext = new IText('lib');
$itext->value = strip_tags($obj->det->jr_comment);
$itext->value = strip_tags($obj->det->jr_comment??"");
$itext->size = 40;
echo td(_('Libellé')) . td($itext->input(), ' colspan="2" ');
?>

View file

@ -78,7 +78,7 @@ $str_anc = "";
<td>
<?php
$itext = new IText('lib');
$itext->value = strip_tags($obj->det->jr_comment);
$itext->value = strip_tags($obj->det->jr_comment??"");
$itext->size = 40;
echo td(_('Libellé')) . td($itext->input(), ' colspan="2" ');
?>