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
+13 -11
View File
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2019, British Columbia Institute of Technology
* Copyright (c) 2019 - 2022, CodeIgniter Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -30,6 +30,7 @@
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 1.0.0
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Uploads
* @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/libraries/file_uploading.html
* @link https://codeigniter.com/userguide3/libraries/file_uploading.html
*/
class CI_Upload {
@@ -867,7 +868,7 @@ class CI_Upload {
$this->file_type = 'image/jpeg';
}
$img_mimes = array('image/gif', 'image/jpeg', 'image/png');
$img_mimes = array('image/gif', 'image/jpeg', 'image/png', 'image/webp');
return in_array($this->file_type, $img_mimes, TRUE);
}
@@ -901,7 +902,7 @@ class CI_Upload {
}
// Images get some additional checks
if (in_array($ext, array('gif', 'jpg', 'jpeg', 'jpe', 'png'), TRUE) && @getimagesize($this->file_temp) === FALSE)
if (in_array($ext, array('gif', 'jpg', 'jpeg', 'jpe', 'png', 'webp'), TRUE) && @getimagesize($this->file_temp) === FALSE)
{
return FALSE;
}
@@ -1183,7 +1184,7 @@ class CI_Upload {
* Prevents possible script execution from Apache's handling
* of files' multiple extensions.
*
* @link http://httpd.apache.org/docs/1.3/mod/mod_mime.html#multipleext
* @link https://httpd.apache.org/docs/1.3/mod/mod_mime.html#multipleext
*
* @param string $filename
* @return string
@@ -1227,10 +1228,13 @@ class CI_Upload {
if (function_exists('finfo_file'))
{
$finfo = @finfo_open(FILEINFO_MIME);
if (is_resource($finfo)) // It is possible that a FALSE value is returned, if there is no magic MIME database file found on the system
if ($finfo !== FALSE) // It is possible that a FALSE value is returned, if there is no magic MIME database file found on the system
{
$mime = @finfo_file($finfo, $file['tmp_name']);
finfo_close($finfo);
if (PHP_VERSION_ID < 80100)
{
finfo_close($finfo);
}
/* According to the comments section of the PHP manual page,
* it is possible that this function returns an empty string
@@ -1257,9 +1261,7 @@ class CI_Upload {
*/
if (DIRECTORY_SEPARATOR !== '\\')
{
$cmd = function_exists('escapeshellarg')
? 'file --brief --mime '.escapeshellarg($file['tmp_name']).' 2>&1'
: 'file --brief --mime '.$file['tmp_name'].' 2>&1';
$cmd = 'file --brief --mime '.escapeshellarg($file['tmp_name']).' 2>&1';
if (function_usable('exec'))
{
@@ -1276,7 +1278,7 @@ class CI_Upload {
}
}
if ( ! ini_get('safe_mode') && function_usable('shell_exec'))
if (function_usable('shell_exec'))
{
$mime = @shell_exec($cmd);
if (strlen($mime) > 0)