Merge pull request #1843 from AndreasK79/php8.1_fixes

pull/1846/head
Andreas Kristiansen 2022-12-14 16:10:47 +01:00 zatwierdzone przez GitHub
commit 5c565bfabc
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
7 zmienionych plików z 28 dodań i 14 usunięć

Wyświetl plik

@ -34,9 +34,9 @@ function echo_table_col($row, $name) {
}
function echoQrbCalcLink($mygrid, $grid, $vucc) {
if (strlen($grid) != 0) {
if (!empty($grid)) {
echo $grid . ' <a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $grid . '\')"><i class="fas fa-globe"></i></a>';
} else if (strlen($vucc) != 0) {
} else if (!empty($vucc)) {
echo $vucc .' <a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $vucc . '\')"><i class="fas fa-globe"></i></a>';
}
}

Wyświetl plik

@ -34,9 +34,9 @@ function echo_table_col($row, $name) {
}
function echoQrbCalcLink($mygrid, $grid, $vucc) {
if (strlen($grid) != 0) {
if (!empty($grid)) {
echo $grid . ' <a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $grid . '\')"><i class="fas fa-globe"></i></a>';
} else if (strlen($vucc) != 0) {
} else if (!empty($vucc)) {
echo $vucc .' <a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $vucc . '\')"><i class="fas fa-globe"></i></a>';
}
}

Wyświetl plik

@ -32,9 +32,9 @@ function echo_table_col($row, $name) {
}
function echoQrbCalcLink($mygrid, $grid, $vucc) {
if (strlen($grid) != 0) {
if (!empty($grid)) {
echo $grid . ' <a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $grid . '\')"><i class="fas fa-globe"></i></a>';
} else if (strlen($vucc) != 0) {
} else if (!empty($vucc)) {
echo $vucc .' <a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $vucc . '\')"><i class="fas fa-globe"></i></a>';
}
}

Wyświetl plik

@ -727,6 +727,9 @@ if ( ! function_exists('remove_invisible_characters'))
do
{
if ($str == null) {
$str = "";
}
$str = preg_replace($non_displayables, '', $str, -1, $count);
}
while ($count);

Wyświetl plik

@ -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
@ -55,7 +56,7 @@ class CI_Output {
*
* @var string
*/
public $final_output;
public $final_output = '';
/**
* Cache expiration time
@ -145,7 +146,7 @@ class CI_Output {
&& extension_loaded('zlib')
);
isset(self::$func_overload) OR self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload'));
isset(self::$func_overload) OR self::$func_overload = ( ! is_php('8.0') && extension_loaded('mbstring') && @ini_get('mbstring.func_overload'));
// Get mime types for later
$this->mimes =& get_mimes();
@ -299,10 +300,14 @@ class CI_Output {
*/
public function get_header($header)
{
// Combine headers already sent with our batched headers
// We only need [x][0] from our multi-dimensional array
$header_lines = array_map(function ($headers)
{
return array_shift($headers);
}, $this->headers);
$headers = array_merge(
// We only need [x][0] from our multi-dimensional array
array_map('array_shift', $this->headers),
$header_lines,
headers_list()
);

Wyświetl plik

@ -490,10 +490,10 @@ class CI_Profiler {
if (is_array($val) OR is_object($val))
{
$val = print_r($val, TRUE);
$pre = '<pre>' ;
$pre_close = '</pre>';
}
$val = $val == null ? "" : $val;
$output .= '<tr><td style="padding:5px;vertical-align:top;color:#900;background-color:#ddd;">'
.$config.'&nbsp;&nbsp;</td><td style="padding:5px;color:#000;background-color:#ddd;">'.$pre.htmlspecialchars($val, ENT_QUOTES, config_item('charset')).$pre_close."</td></tr>\n";
@ -522,6 +522,7 @@ class CI_Profiler {
foreach ($this->CI->session->userdata() as $key => $val)
{
$val = $val == null ? "" : $val;
$pre = '';
$pre_close = '';

Wyświetl plik

@ -129,7 +129,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param string $name Session cookie name
* @return bool
*/
public function open($save_path, $name)
public function open($save_path, $name): bool
{
if ( ! is_dir($save_path))
{
@ -165,6 +165,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param string $session_id Session ID
* @return string Serialized session data
*/
#[\ReturnTypeWillChange]
public function read($session_id)
{
// This might seem weird, but PHP 5.6 introduces session_reset(),
@ -238,6 +239,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param string $session_data Serialized session data
* @return bool
*/
#[\ReturnTypeWillChange]
public function write($session_id, $session_data)
{
// If the two IDs don't match, we have a session_regenerate_id() call
@ -295,6 +297,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function close()
{
if (is_resource($this->_file_handle))
@ -318,6 +321,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param string $session_id Session ID
* @return bool
*/
#[\ReturnTypeWillChange]
public function destroy($session_id)
{
if ($this->close() === $this->_success)
@ -359,6 +363,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param int $maxlifetime Maximum lifetime of sessions
* @return bool
*/
#[\ReturnTypeWillChange]
public function gc($maxlifetime)
{
if ( ! is_dir($this->_config['save_path']) OR ($directory = opendir($this->_config['save_path'])) === FALSE)