Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

Commit 55f2f8a

Browse files
committed
🔨 minor improvements
Signed-off-by: otengkwame <[email protected]>
1 parent 400950a commit 55f2f8a

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

framework/core/Benchmark.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* This content is released under the MIT License (MIT)
99
*
10-
* Copyright (c) 2014 - 2019, British Columbia Institute of Technology
10+
* Copyright (c) 2019 - 2022, CodeIgniter Foundation
1111
*
1212
* Permission is hereby granted, free of charge, to any person obtaining a copy
1313
* of this software and associated documentation files (the "Software"), to deal
@@ -31,6 +31,7 @@
3131
* @author EllisLab Dev Team
3232
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
3333
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
34+
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
3435
* @license https://opensource.org/licenses/MIT MIT License
3536
* @link https://codeigniter.com
3637
* @since Version 1.0.0

framework/core/Common.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ function _shutdown_handler()
759759
* @param bool
760760
* @return string
761761
*/
762-
function remove_invisible_characters($str, $url_encoded = true)
762+
function remove_invisible_characters($str = '', $url_encoded = true)
763763
{
764764
$non_displayables = [];
765765

@@ -776,6 +776,10 @@ function remove_invisible_characters($str, $url_encoded = true)
776776

777777
do
778778
{
779+
if ($str == null) {
780+
$str = '';
781+
}
782+
779783
$str = preg_replace($non_displayables, '', $str, -1, $count);
780784
}
781785
while ($count);

framework/core/Log.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function __construct()
122122
{
123123
$config =& get_config();
124124

125-
isset(self::$func_overload) OR self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload'));
125+
isset(self::$func_overload) OR self::$func_overload = ( ! is_php('8.0') && extension_loaded('mbstring') && @ini_get('mbstring.func_overload'));
126126

127127
$this->_log_path = ($config['log_path'] !== '') ? $config['log_path'] : APPPATH.'logs/';
128128
$this->_file_ext = (isset($config['log_file_extension']) && $config['log_file_extension'] !== '')

framework/libraries/Email.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public function __construct(array $config = [])
397397
$this->initialize($config);
398398
$this->_safe_mode = ( ! is_php('5.4') && ini_get('safe_mode'));
399399

400-
isset(self::$func_overload) OR self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload'));
400+
isset(self::$func_overload) OR self::$func_overload = ( ! is_php('8.0') && extension_loaded('mbstring') && @ini_get('mbstring.func_overload'));
401401

402402
log_message('info', 'Email Class Initialized');
403403
}

framework/libraries/Encryption.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function __construct(array $params = [])
161161
show_error('Encryption: Unable to find an available encryption driver.');
162162
}
163163

164-
isset(self::$func_overload) OR self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload'));
164+
isset(self::$func_overload) OR self::$func_overload = ( ! is_php('8.0') && extension_loaded('mbstring') && @ini_get('mbstring.func_overload'));
165165
$this->initialize($params);
166166

167167
if ( ! isset($this->_key) && self::strlen($key = config_item('encryption_key')) > 0)

framework/libraries/Zip.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class CI_Zip {
119119
*/
120120
public function __construct()
121121
{
122-
isset(self::$func_overload) OR self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload'));
122+
isset(self::$func_overload) OR self::$func_overload = ( ! is_php('8.0') && extension_loaded('mbstring') && @ini_get('mbstring.func_overload'));
123123

124124
$this->now = time();
125125
log_message('info', 'Zip Compression Class Initialized');

0 commit comments

Comments
 (0)