Skip to content

Commit d85ef2b

Browse files
committed
Add PHP 8.4 compatibility
1 parent 3f6dd27 commit d85ef2b

File tree

11 files changed

+29
-63
lines changed

11 files changed

+29
-63
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Prerequisites
3333

3434
* A web server: Apache, LiteSpeed, Nginx, Lighttpd, Cherokee.
3535
* A database: MySQL / MariaDB, Postgres. OR a writable folder on your filesystem for SQLite.
36-
* PHP version 7.0 - 8.3.
36+
* PHP version 7.1 - 8.4.
3737
* PHP-GD for the creation of QR-codes and Captcha.
3838

3939

@@ -80,6 +80,11 @@ In the doc/ folder, you will find:
8080
Changelog
8181
---------
8282

83+
### Version 1.1.2:
84+
85+
* Added PHP 8.4 compatibility
86+
* Fixed broken QR images on PHP 8+
87+
8388
### Version 1.1.1:
8489

8590
* Fixed some Docker related issues

docker/snip.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
| The project version.
2424
|
2525
*/
26-
$config['proj_version'] = '1.1.1';
26+
$config['proj_version'] = '1.1.2';
2727

2828

2929
/**
@@ -333,7 +333,7 @@
333333
$config['disable_api'] = false;
334334
$config['disable_keep_forever'] = false;
335335
$config['blocked_words'] = '';
336-
$config['disallow_search_engines'] = true;
336+
$config['disallow_search_engines'] = false;
337337
$config['disable_replies'] = false;
338338
$config['enable_adminlink'] = false;
339339

htdocs/application/config/snip.php.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $config['proj_url'] = 'https://github.com/MercanoGlobal/SNIP';
2323
| The project version.
2424
|
2525
*/
26-
$config['proj_version'] = '1.1.1';
26+
$config['proj_version'] = '1.1.2';
2727

2828

2929
/**

htdocs/application/libraries/phpqrcode/qrvect.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
class QRvect {
2828

2929
//----------------------------------------------------------------------
30-
public static function eps($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE, $back_color = 0xFFFFFF, $fore_color = 0x000000, $cmyk = false)
30+
public static function eps($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4, $saveandprint = FALSE, $back_color = 0xFFFFFF, $fore_color = 0x000000, $cmyk = false)
3131
{
3232
$vect = self::vectEPS($frame, $pixelPerPoint, $outerFrame, $back_color, $fore_color, $cmyk);
3333

@@ -137,7 +137,7 @@ private static function vectEPS($frame, $pixelPerPoint = 4, $outerFrame = 4, $ba
137137
}
138138

139139
//----------------------------------------------------------------------
140-
public static function svg($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE, $back_color, $fore_color)
140+
public static function svg($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4, $saveandprint = FALSE, $back_color = 0xFFFFFF, $fore_color = 0x000000)
141141
{
142142
$vect = self::vectSVG($frame, $pixelPerPoint, $outerFrame, $back_color, $fore_color);
143143

htdocs/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@
7373
case 'testing':
7474
case 'production':
7575
ini_set('display_errors', 0);
76-
if (version_compare(PHP_VERSION, '5.3', '>='))
76+
if (version_compare(PHP_VERSION, '8.4', '>='))
7777
{
78-
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
78+
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
7979
}
8080
else
8181
{
82-
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
82+
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
8383
}
8484
break;
8585

htdocs/system/core/Exceptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class CI_Exceptions {
7373
E_USER_ERROR => 'User Error',
7474
E_USER_WARNING => 'User Warning',
7575
E_USER_NOTICE => 'User Notice',
76-
E_STRICT => 'Runtime Notice'
76+
2048 => 'Runtime Notice' // If we are using older PHP versions, E_STRICT errors will be labeled correctly, otherwise they will be ignored.
7777
);
7878

7979
/**

htdocs/system/core/Lang.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function load($langfile, $idiom = '', $return = FALSE, $add_suffix = TRUE
190190
*/
191191
public function line($line, $log_errors = TRUE)
192192
{
193-
$value = isset($this->language[$line]) ? $this->language[$line] : FALSE;
193+
$value = ($line !== NULL && isset($this->language[$line])) ? $this->language[$line] : FALSE;
194194

195195
// Because killer robots like unicorns!
196196
if ($value === FALSE && $log_errors === TRUE)

htdocs/system/core/Output.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ public function _display($output = '')
456456

457457
$elapsed = $BM->elapsed_time('total_execution_time_start', 'total_execution_time_end');
458458

459-
if ($this->parse_exec_vars === TRUE)
459+
if ($this->parse_exec_vars === TRUE && !empty($output))
460460
{
461461
$memory = round(memory_get_usage() / 1024 / 1024, 2).'MB';
462462
$output = $output ? str_replace(array('{elapsed_time}', '{memory_usage}'), array($elapsed, $memory), $output) : '';

htdocs/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function __construct(&$db)
9999

100100
if (version_compare($this->db->version(), '9.0', '>'))
101101
{
102-
$this->create_table_if = 'CREATE TABLE IF NOT EXISTS';
102+
$this->_create_table_if = 'CREATE TABLE IF NOT EXISTS';
103103
}
104104
}
105105

htdocs/system/libraries/Encryption.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public function create_key($length)
369369
* @param array $params Input parameters
370370
* @return string
371371
*/
372-
public function encrypt($data, array $params = NULL)
372+
public function encrypt($data, ?array $params = NULL)
373373
{
374374
if (($params = $this->_get_params($params)) === FALSE)
375375
{
@@ -504,7 +504,7 @@ protected function _openssl_encrypt($data, $params)
504504
* @param array $params Input parameters
505505
* @return string
506506
*/
507-
public function decrypt($data, array $params = NULL)
507+
public function decrypt($data, ?array $params = NULL)
508508
{
509509
if (($params = $this->_get_params($params)) === FALSE)
510510
{

0 commit comments

Comments
 (0)