CodeIgniter 3.1.11 -> 3.4.5 (pocketarc fork) en PHP 8.3-fixes

- system/ vervangen door CodeIgniter 3.4.5 (pocketarc/codeigniter, PHP 8.2-8.5 compatibel)
- config.php, mimes.php, user_agents.php en error-views bijgewerkt naar 3.4.5
- composer.json: php-constraint "^7.4 || ^8.0" zodat composer install op 8.3 werkt
- PHP 8-fatals opgelost: count()/array-functies op FALSE/null, rekenen met lege
  strings, delen door nul, property zetten op FALSE, curly-brace string offsets,
  ongedefinieerde constanten, foute curl_setopt in Phantom_model::create_img
- dynamic properties gedeclareerd in libraries, optionele parameters voor verplichte opgelost
- vergelijkingen waar '' == 0 in PHP 8 anders uitvalt gecast naar (int)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 09:34:46 +02:00
co-authored by Claude Opus 5.5
parent c6afbb01f2
commit 172fcf566c
284 changed files with 3497 additions and 3718 deletions
+3 -3
View File
@@ -133,14 +133,14 @@ class Phantom2_model extends CI_Model{
if(!$margins){
return $this->margins;
}elseif(!is_array($margins)){
$margins = str_replace('cm', $margins);
$margins = str_replace('cm', '', $margins);
if(!is_numeric($margins)) return $this->margins;
return array($margins.'cm',$margins.'cm',$margins.'cm',$margins.'cm');
}elseif(count($margins)==2){
$margin1 = str_replace('cm', $margins[0]);
$margin2 = str_replace('cm', $margins[1]);
$margin1 = str_replace('cm', '', $margins[0]);
$margin2 = str_replace('cm', '', $margins[1]);
if(!is_numeric($margin1) && !is_numeric($margins2)) return $this->margins;
+2 -2
View File
@@ -55,8 +55,8 @@ class Phantom_model extends CI_Model{
if( $footer ) $data['footer'] = $footer;
if( $margins ) $data['margins'] = serialize($margins);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt_array($curl, array(
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0),
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $_ENV['printserver']. 'test/1',
CURLOPT_POST => 1,
@@ -100,7 +100,7 @@ class Phantom_model extends CI_Model{
return $file;
}
function create_and_get_pdf($html, $file, $header = FALSE, $footer = FALSE, $margins = array(), $orientation, $footerFirstpage=TRUE, $headerFirstpage=TRUE)
function create_and_get_pdf($html, $file, $header, $footer, $margins, $orientation, $footerFirstpage=TRUE, $headerFirstpage=TRUE)
{
//margins [left, right, top, bottom, height header]
if ( ! is_array( $margins ) ) $margins = array();
+1 -1
View File
@@ -28,7 +28,7 @@ class Modfases extends MY_Model{
ORDER BY volgorde";
$res = $this->get_query_result();
$onb = (object) array("naam"=>"onbekend", "kleur"=>"#989898");
array_unshift($res,$onb );
if (is_array($res)) array_unshift($res,$onb );
return $res;
}
@@ -34,6 +34,7 @@ class ModPartActKosten extends MY_Model{
FROM tbPartActKosten
WHERE id = $kostID" ;
$results = $this->get_query_row();
if (! $results) $results = new stdClass();
$results->kosten = mysql2bedrag($results->kosten);
return $results;
}
@@ -187,7 +187,7 @@ class Mutatielog_model extends MY_Model{
function store_mutatie($mutatie){
$sql = "
INSERT INTO replicatie.replicatielog (replicatie_data, creation_date, created_by, last_update_date, last_updated_by)
VALUES('".mysql_real_escape_string(serialize($mutatie))."', NOW(), 'cron', NOW(), 'cron')";
VALUES('".$this->db->escape_str(serialize($mutatie))."', NOW(), 'cron', NOW(), 'cron')";
$this->db->query($sql);
}
@@ -132,14 +132,14 @@ class Phantom_model extends CI_Model{
if(!$margins){
return $this->margins;
}elseif(!is_array($margins)){
$margins = str_replace('cm', $margins);
$margins = str_replace('cm', '', $margins);
if(!is_numeric($margins)) return $this->margins;
return array($margins.'cm',$margins.'cm',$margins.'cm',$margins.'cm');
}elseif(count($margins)==2){
$margin1 = str_replace('cm', $margins[0]);
$margin2 = str_replace('cm', $margins[1]);
$margin1 = str_replace('cm', '', $margins[0]);
$margin2 = str_replace('cm', '', $margins[1]);
if(!is_numeric($margin1) && !is_numeric($margins2)) return $this->margins;
@@ -155,7 +155,7 @@ class Diversiteits_model extends MY_Model{
$school->oov = round(($aantalmetvraag / $school->aantallln) * 100);
$school->cat1 =$school->aantallln - $aantalmetvraag;
$school->tgd = round($schooltgd + $school->cat1);
$school->dq = round(($school->tgd / $normtot) * 100) / 100;
$school->dq = ($normtot != 0) ? round(($school->tgd / $normtot) * 100) / 100 : 0;
$bggem->cat1 = $bggem->cat1 + $school->cat1;
$bggem->oov = $bggem->oov + $school->oov;
$bggem->tgd = $bggem->tgd + $school->tgd ;
@@ -308,7 +308,7 @@ class Diversiteits_model extends MY_Model{
};
$groep->diversiteit = ($groep->som5 * 2) + ($groep->som6 * 3) + ($groep->som7 * 4) +($groep ->som8 * 5);
$groep->groepdq = round($groep->diversiteit/$groep->normaantal);
$groep->groepdq = ($groep->normaantal != 0) ? round($groep->diversiteit/$groep->normaantal) : 0;
$normtot = $normtot + $groep->normaantal;
$somschooldq = $somschooldq + $groep->groepdq;
}
@@ -351,7 +351,7 @@ class Diversiteits_model extends MY_Model{
if ($school->aantallln > 0) {
$school->tgd = round($schooltgd);
$school->dq = round(($school->tgd / $school->normaantal) * 100) / 100;
$school->dq = ($school->normaantal != 0) ? round(($school->tgd / $school->normaantal) * 100) / 100 : 0;
$bggem->tgd = $bggem->tgd + $school->tgd ;
$bggem->dq= $bggem->dq + $school->dq;
$usedaantalscholen ++;
@@ -230,6 +230,7 @@ class Maakinhoudnieuw_model extends MY_Model{
function setVersie($orgversieid){
$orgversie = $this->Orgversies_model->get_record_by_id($orgversieid);
$versie = $this->Versies_model ->get_record_by_id($orgversie->versie_id);
if (! $versie) $versie = new stdClass();
$versie->naam = $versie->naam . ', periode: ' . $orgversie->periodenummer . ': ' . $orgversie->geldigvanaf . ' - ' . $orgversie->geldigtm;
return $versie;
}
@@ -311,7 +311,7 @@ class Sopinhouden_model extends MY_Model{
$factor =$normaantallen->groep38;
if (strpos($groep->niveau,'1') !== false || strpos($groep->niveau,'2') !== false) {$factor = $normaantallen->groep12;};
$groep->dq= round(($groep->diversiteit / $factor),2);
$groep->dq= ($factor != 0) ? round(($groep->diversiteit / $factor),2) : 0;
$totaal = $totaal + $groep->totaantal;
$hoeveelgroepen = $hoeveelgroepen + 1;
if (strpos($groep->niveau, ';') > 0){$combi = $combi + 1;}
@@ -432,7 +432,7 @@ class Sopinhouden_model extends MY_Model{
if (strpos($groep->niveau,';') >0) {$groep->diversiteit = $groep->diversiteit + 1.5;};
$factor =$normaantallen->groep38;
if (strpos($groep->niveau,'1') > 0 || strpos($groep->niveau,'2') > 0) {$factor = $normaantallen->groep12;};
$groep->dq= round(($groep->diversiteit / $factor),2);
$groep->dq= ($factor != 0) ? round(($groep->diversiteit / $factor),2) : 0;
$som1= $som1 + $groep->som1;
$som2= $som2 + $groep->som2;
$som3= $som3 + $groep->som3;
@@ -734,7 +734,7 @@ class Sopinhouden_model extends MY_Model{
$score->disablenvt = 'F';
if($score->aantalvier > 0 && $score->aantalvier == $score->aantalnvt) $score->disablenvt = 'T';
if($score->disabled == 'F' && $score->disablenvt == 'F') {
$score->gem = $score->somscore / $score->num;
$score->gem = ($score->num != 0) ? $score->somscore / $score->num : 0;
$score->colorcode = $this->kleurcodes->getkleur($score->gem);
$som = $som + $score->gem;
}
@@ -95,7 +95,7 @@ class Organisaties_model extends MY_Model{
AND actief = 1";
return $this->get_query_row();
}
function checkbrin($orgid=false, $brin){
function checkbrin($orgid, $brin){
$this->sql =" SELECT COUNT(id) as aantal
FROM tb_organisaties
WHERE lower(brin) = lower('{$brin}')";
@@ -559,7 +559,7 @@ class Organisaties_model extends MY_Model{
return $lijst;
}
function getKleurcodesOrg($clusterid = FALSE, $swvid){
function getKleurcodesOrg($clusterid, $swvid){
if (! $clusterid) $clusterid = 0;
$sql = " SELECT *
FROM tb_kleurcodes KC