[PHP8.1] Replaced output.php with a newer one

这个提交包含在:
Andreas 2022-12-14 13:53:14 +01:00
父节点 8384d7d421
当前提交 85ca34bf80

查看文件

@ -6,7 +6,7 @@
* *
* This content is released under the MIT License (MIT) * 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal * of this software and associated documentation files (the "Software"), to deal
@ -30,6 +30,7 @@
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @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) 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 * @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com * @link https://codeigniter.com
* @since Version 1.0.0 * @since Version 1.0.0
@ -55,7 +56,7 @@ class CI_Output {
* *
* @var string * @var string
*/ */
public $final_output; public $final_output = '';
/** /**
* Cache expiration time * Cache expiration time
@ -145,7 +146,7 @@ class CI_Output {
&& extension_loaded('zlib') && 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 // Get mime types for later
$this->mimes =& get_mimes(); $this->mimes =& get_mimes();
@ -299,10 +300,14 @@ class CI_Output {
*/ */
public function get_header($header) 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( $headers = array_merge(
// We only need [x][0] from our multi-dimensional array $header_lines,
array_map('array_shift', $this->headers),
headers_list() headers_list()
); );