From 469735b79ee10ad3aa92f71b27f0914b309b5ecc Mon Sep 17 00:00:00 2001 From: sparkyx Date: Fri, 15 Dec 2023 19:03:24 +0100 Subject: [PATCH] PHP 8.2 compatibility --- include/admin_repo.inc.php | 1 + include/backup.inc.php | 2 ++ include/class/calendar.class.php | 3 ++- include/class/dossier.class.php | 6 ++++++ include/lib/select_box.class.php | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/admin_repo.inc.php b/include/admin_repo.inc.php index 08bdddff6..1fab37313 100644 --- a/include/admin_repo.inc.php +++ b/include/admin_repo.inc.php @@ -161,6 +161,7 @@ if ( $action == "info" && SYSINFO_DISPLAY == true) { echo phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_ENVIRONMENT | INFO_VARIABLES); $r=ob_get_clean(); $html=new DOMDocument(); + libxml_use_internal_errors(true); $html->loadHTML($r); $nodelist=$html->getElementsByTagName("style"); $nodelist->item(0)->nodeValue=' diff --git a/include/backup.inc.php b/include/backup.inc.php index 6c2667f9c..2be381e00 100644 --- a/include/backup.inc.php +++ b/include/backup.inc.php @@ -73,6 +73,7 @@ if ( isset ($_REQUEST['sa']) ) $database=domaine."dossier".$dossier_number; $filename= str_replace(array('/','\\' ,'<','>','"','[',']',':','*',' ','{','}','&'),'_', $name); $filename= str_replace("__", "_", $filename); + $filename=str_replace(PHP_EOL,'',$filename); $filename.="-".date('Ymd'); $args= " -Fc -Z9 --no-owner -h ".getenv("PGHOST")." -p ".getenv("PGPORT")." ".$database; header('Content-type: application/octet'); @@ -90,6 +91,7 @@ if ( isset ($_REQUEST['sa']) ) $database=domaine."mod".$dossier_number; $filename= str_replace(array('/','\\' ,'<','>','"','[',']',':','*',' ','{','}','&'),'_', $name); $filename= str_replace("__", "_", $filename); + $filename=str_replace(PHP_EOL,'',$filename); $filename.="-".date('Ymd'); $args= " -Fc -Z9 --no-owner -h ".getenv("PGHOST")." -p ".getenv("PGPORT")." ".$database; header('Content-type: bin/x-application'); diff --git a/include/class/calendar.class.php b/include/class/calendar.class.php index bbaa7fc35..d3a5fb962 100644 --- a/include/class/calendar.class.php +++ b/include/class/calendar.class.php @@ -42,6 +42,7 @@ class Calendar var $str_name; // array of tiers for event - follow-up (T: action_gestion) var $title; // array of title for each event - follow-up (T: action_gestion) var $hour ; // array of hour for each event - follow-up (T: action_gestion) + var $default_periode; //default periode function __construct() { @@ -257,7 +258,7 @@ class Calendar { $p_id=$g_user->get_periode(); } - $this->default_periode=$p_id; + $this->default_periode=$p_id; return $p_id; } /** diff --git a/include/class/dossier.class.php b/include/class/dossier.class.php index 46c53e615..251bab7b9 100644 --- a/include/class/dossier.class.php +++ b/include/class/dossier.class.php @@ -44,6 +44,12 @@ class Dossier "desc"=>"dos_description", "max_email"=>'dos_email'); + var $cn; //!< Database connexion + var $dos_id; //!< number of db + var $dos_name; + var $dos_description; + var $dos_email; + function __construct($p_id) { $this->cn=new Database(); // Connect to the repository diff --git a/include/lib/select_box.class.php b/include/lib/select_box.class.php index 56bfb10fb..f5b61a5b9 100644 --- a/include/lib/select_box.class.php +++ b/include/lib/select_box.class.php @@ -38,7 +38,7 @@ class Select_Box private $position; //!< change depending if we are in an absolute block or not protected $style_box; protected $value; - public $style_box; + /** * Default constructor * @param type $p_id javascript DOMid