summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2021-02-21 11:18:58 +0100
committerFlorian Pritz <bluewind@xinu.at>2021-02-21 11:18:58 +0100
commit08510ba2faa4785339ca7093ba0fa7052ff5d0c8 (patch)
tree108365fe3624295d70a677642b300fd458e7c569 /system/libraries
parent29e6c8ad462a426f4bc6d380646e434e3361a21d (diff)
parent0925b5099919300a239909588351a6482c5e792d (diff)
PHP8: Merge remote-tracking branch 'upstream/3.1-stable' into dev
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Cache/drivers/Cache_apc.php8
-rw-r--r--system/libraries/Cache/drivers/Cache_dummy.php8
-rw-r--r--system/libraries/Cache/drivers/Cache_redis.php27
-rw-r--r--system/libraries/Cache/drivers/Cache_wincache.php8
-rw-r--r--system/libraries/Calendar.php2
-rw-r--r--system/libraries/Cart.php2
-rw-r--r--system/libraries/Email.php2
-rw-r--r--system/libraries/Encrypt.php4
-rw-r--r--system/libraries/Encryption.php2
-rw-r--r--system/libraries/Form_validation.php2
-rw-r--r--system/libraries/Ftp.php2
-rw-r--r--system/libraries/Image_lib.php2
-rw-r--r--system/libraries/Javascript.php2
-rw-r--r--system/libraries/Javascript/Jquery.php2
-rw-r--r--system/libraries/Migration.php2
-rw-r--r--system/libraries/Pagination.php2
-rw-r--r--system/libraries/Parser.php2
-rw-r--r--system/libraries/Profiler.php20
-rw-r--r--system/libraries/Session/Session.php6
-rw-r--r--system/libraries/Session/SessionHandlerInterface.php2
-rw-r--r--system/libraries/Session/Session_driver.php2
-rw-r--r--system/libraries/Session/drivers/Session_database_driver.php2
-rw-r--r--system/libraries/Session/drivers/Session_files_driver.php6
-rw-r--r--system/libraries/Session/drivers/Session_memcached_driver.php2
-rw-r--r--system/libraries/Session/drivers/Session_redis_driver.php2
-rw-r--r--system/libraries/Table.php2
-rw-r--r--system/libraries/Trackback.php2
-rw-r--r--system/libraries/Typography.php2
-rw-r--r--system/libraries/Unit_test.php2
-rw-r--r--system/libraries/Upload.php6
-rw-r--r--system/libraries/User_agent.php2
-rw-r--r--system/libraries/Xmlrpc.php10
-rw-r--r--system/libraries/Xmlrpcs.php4
-rw-r--r--system/libraries/Zip.php7
34 files changed, 89 insertions, 69 deletions
diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php
index 8da8854ee..c0527e665 100644
--- a/system/libraries/Cache/drivers/Cache_apc.php
+++ b/system/libraries/Cache/drivers/Cache_apc.php
@@ -160,10 +160,10 @@ class CI_Cache_apc extends CI_Driver {
* @param string user/filehits
* @return mixed array on success, false on failure
*/
- public function cache_info($type = NULL)
- {
- return apc_cache_info($type);
- }
+ public function cache_info($type = NULL)
+ {
+ return apc_cache_info($type);
+ }
// ------------------------------------------------------------------------
diff --git a/system/libraries/Cache/drivers/Cache_dummy.php b/system/libraries/Cache/drivers/Cache_dummy.php
index fdb9042ef..0a90d0692 100644
--- a/system/libraries/Cache/drivers/Cache_dummy.php
+++ b/system/libraries/Cache/drivers/Cache_dummy.php
@@ -138,10 +138,10 @@ class CI_Cache_dummy extends CI_Driver {
* @param string user/filehits
* @return bool FALSE
*/
- public function cache_info($type = NULL)
- {
- return FALSE;
- }
+ public function cache_info($type = NULL)
+ {
+ return FALSE;
+ }
// ------------------------------------------------------------------------
diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php
index bff96fbfb..f0a72ee3c 100644
--- a/system/libraries/Cache/drivers/Cache_redis.php
+++ b/system/libraries/Cache/drivers/Cache_redis.php
@@ -83,6 +83,13 @@ class CI_Cache_redis extends CI_Driver
*/
protected static $_delete_name;
+ /**
+ * sRem()/sRemove() method name depending on phpRedis version
+ *
+ * @var string
+ */
+ protected static $_sRemove_name;
+
// ------------------------------------------------------------------------
/**
@@ -104,9 +111,19 @@ class CI_Cache_redis extends CI_Driver
return;
}
- isset(static::$_delete_name) OR static::$_delete_name = version_compare(phpversion('phpredis'), '5', '>=')
- ? 'del'
- : 'delete';
+ if ( ! isset(static::$_delete_name, static::$_sRemove_name))
+ {
+ if (version_compare(phpversion('redis'), '5', '>='))
+ {
+ static::$_delete_name = 'del';
+ static::$_sRemove_name = 'sRem';
+ }
+ else
+ {
+ static::$_delete_name = 'delete';
+ static::$_sRemove_name = 'sRemove';
+ }
+ }
$CI =& get_instance();
@@ -193,7 +210,7 @@ class CI_Cache_redis extends CI_Driver
}
else
{
- $this->_redis->sRemove('_ci_redis_serialized', $id);
+ $this->_redis->{static::$_sRemove_name}('_ci_redis_serialized', $id);
}
return $this->_redis->set($id, $data, $ttl);
@@ -214,7 +231,7 @@ class CI_Cache_redis extends CI_Driver
return FALSE;
}
- $this->_redis->sRemove('_ci_redis_serialized', $key);
+ $this->_redis->{static::$_sRemove_name}('_ci_redis_serialized', $key);
return TRUE;
}
diff --git a/system/libraries/Cache/drivers/Cache_wincache.php b/system/libraries/Cache/drivers/Cache_wincache.php
index 1feaa158f..c20d0bc91 100644
--- a/system/libraries/Cache/drivers/Cache_wincache.php
+++ b/system/libraries/Cache/drivers/Cache_wincache.php
@@ -169,10 +169,10 @@ class CI_Cache_wincache extends CI_Driver {
*
* @return mixed array on success, false on failure
*/
- public function cache_info()
- {
- return wincache_ucache_info(TRUE);
- }
+ public function cache_info()
+ {
+ return wincache_ucache_info(TRUE);
+ }
// ------------------------------------------------------------------------
diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php
index a6bdae50a..fcfcf62ca 100644
--- a/system/libraries/Calendar.php
+++ b/system/libraries/Calendar.php
@@ -46,7 +46,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Libraries
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/calendar.html
+ * @link https://codeigniter.com/userguide3/libraries/calendar.html
*/
class CI_Calendar {
diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php
index 6a107752c..a4c73e5e7 100644
--- a/system/libraries/Cart.php
+++ b/system/libraries/Cart.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Shopping Cart
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/cart.html
+ * @link https://codeigniter.com/userguide3/libraries/cart.html
* @deprecated 3.0.0 This class is too specific for CI.
*/
class CI_Cart {
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 10b74777d..dcc4ca0d3 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -46,7 +46,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Libraries
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/email.html
+ * @link https://codeigniter.com/userguide3/libraries/email.html
*/
class CI_Email {
diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php
index 7ed185f1b..df1af4cf4 100644
--- a/system/libraries/Encrypt.php
+++ b/system/libraries/Encrypt.php
@@ -46,7 +46,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Libraries
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/encryption.html
+ * @link https://codeigniter.com/userguide3/libraries/encryption.html
*/
class CI_Encrypt {
@@ -198,7 +198,7 @@ class CI_Encrypt {
* This allows for backwards compatibility and a method to transition to the
* new encryption algorithms.
*
- * For more details, see https://codeigniter.com/user_guide/installation/upgrade_200.html#encryption
+ * For more details, see https://codeigniter.com/userguide3/installation/upgrade_200.html#encryption
*
* @param string
* @param int (mcrypt mode constant)
diff --git a/system/libraries/Encryption.php b/system/libraries/Encryption.php
index 4c1973fee..cb8ad9de9 100644
--- a/system/libraries/Encryption.php
+++ b/system/libraries/Encryption.php
@@ -46,7 +46,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Libraries
* @author Andrey Andreev
- * @link https://codeigniter.com/user_guide/libraries/encryption.html
+ * @link https://codeigniter.com/userguide3/libraries/encryption.html
*/
class CI_Encryption {
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index fdf202010..9d976984e 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Validation
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/form_validation.html
+ * @link https://codeigniter.com/userguide3/libraries/form_validation.html
*/
class CI_Form_validation {
diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php
index 4f0f5dfb3..61fa80c0f 100644
--- a/system/libraries/Ftp.php
+++ b/system/libraries/Ftp.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Libraries
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/ftp.html
+ * @link https://codeigniter.com/userguide3/libraries/ftp.html
*/
class CI_FTP {
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index b89bc5b7e..7e7d4c85c 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Image_lib
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/image_lib.html
+ * @link https://codeigniter.com/userguide3/libraries/image_lib.html
*/
class CI_Image_lib {
diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php
index c9103945b..c0cf676f2 100644
--- a/system/libraries/Javascript.php
+++ b/system/libraries/Javascript.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Javascript
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/javascript.html
+ * @link https://codeigniter.com/userguide3/libraries/javascript.html
* @deprecated 3.0.0 This was never a good idea in the first place.
*/
class CI_Javascript {
diff --git a/system/libraries/Javascript/Jquery.php b/system/libraries/Javascript/Jquery.php
index 485d1dc18..0649ee1ae 100644
--- a/system/libraries/Javascript/Jquery.php
+++ b/system/libraries/Javascript/Jquery.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Loader
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/javascript.html
+ * @link https://codeigniter.com/userguide3/libraries/javascript.html
*/
class CI_Jquery extends CI_Javascript {
diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php
index 1b7808923..915d4e453 100644
--- a/system/libraries/Migration.php
+++ b/system/libraries/Migration.php
@@ -288,7 +288,7 @@ class CI_Migration {
$this->_error_string = sprintf($this->lang->line('migration_class_doesnt_exist'), $class);
return FALSE;
}
- elseif ( ! is_callable(array($class, $method)))
+ elseif ( ! method_exists($class, $method) OR ! (new ReflectionMethod($class, $method))->isPublic())
{
$this->_error_string = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class);
return FALSE;
diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php
index 5d501a966..69e00e266 100644
--- a/system/libraries/Pagination.php
+++ b/system/libraries/Pagination.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Pagination
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/pagination.html
+ * @link https://codeigniter.com/userguide3/libraries/pagination.html
*/
class CI_Pagination {
diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php
index d3c6500ae..04476f1a2 100644
--- a/system/libraries/Parser.php
+++ b/system/libraries/Parser.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Parser
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/parser.html
+ * @link https://codeigniter.com/userguide3/libraries/parser.html
*/
class CI_Parser {
diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php
index 77af7b99b..5531f3366 100644
--- a/system/libraries/Profiler.php
+++ b/system/libraries/Profiler.php
@@ -50,7 +50,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Libraries
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/general/profiling.html
+ * @link https://codeigniter.com/userguide3/general/profiling.html
*/
class CI_Profiler {
@@ -105,7 +105,7 @@ class CI_Profiler {
{
if ( ! isset($config[$section]))
{
- $this->_compile_{$section} = TRUE;
+ $this->{'_compile_'.$section} = TRUE;
}
}
@@ -135,7 +135,7 @@ class CI_Profiler {
{
if (in_array($method, $this->_available_sections))
{
- $this->_compile_{$method} = ($enable !== FALSE);
+ $this->{'_compile_'.$method} = ($enable !== FALSE);
}
}
}
@@ -486,13 +486,13 @@ class CI_Profiler {
{
$pre = '';
$pre_close = '';
-
+
if (is_array($val) OR is_object($val))
{
$val = print_r($val, TRUE);
-
+
$pre = '<pre>' ;
- $pre_close = '</pre>';
+ $pre_close = '</pre>';
}
$output .= '<tr><td style="padding:5px;vertical-align:top;color:#900;background-color:#ddd;">'
@@ -524,13 +524,13 @@ class CI_Profiler {
{
$pre = '';
$pre_close = '';
-
+
if (is_array($val) OR is_object($val))
{
$val = print_r($val, TRUE);
-
+
$pre = '<pre>' ;
- $pre_close = '</pre>';
+ $pre_close = '</pre>';
}
$output .= '<tr><td style="padding:5px;vertical-align:top;color:#900;background-color:#ddd;">'
@@ -554,7 +554,7 @@ class CI_Profiler {
foreach ($this->_available_sections as $section)
{
- if ($this->_compile_{$section} !== FALSE)
+ if ($this->{'_compile_'.$section} !== FALSE)
{
$func = '_compile_'.$section;
$output .= $this->{$func}();
diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php
index 9b834f86a..06b953ab2 100644
--- a/system/libraries/Session/Session.php
+++ b/system/libraries/Session/Session.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Sessions
* @author Andrey Andreev
- * @link https://codeigniter.com/user_guide/libraries/sessions.html
+ * @link https://codeigniter.com/userguide3/libraries/sessions.html
*/
class CI_Session {
@@ -415,9 +415,7 @@ class CI_Session {
{
$_SESSION['__ci_vars'][$key] = 'old';
}
- // Hacky, but 'old' will (implicitly) always be less than time() ;)
- // DO NOT move this above the 'new' check!
- elseif ($value < $current_time)
+ elseif ($value === 'old' || $value < $current_time)
{
unset($_SESSION[$key], $_SESSION['__ci_vars'][$key]);
}
diff --git a/system/libraries/Session/SessionHandlerInterface.php b/system/libraries/Session/SessionHandlerInterface.php
index 240c5f54e..95d2488b4 100644
--- a/system/libraries/Session/SessionHandlerInterface.php
+++ b/system/libraries/Session/SessionHandlerInterface.php
@@ -46,7 +46,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Sessions
* @author Andrey Andreev
- * @link https://codeigniter.com/user_guide/libraries/sessions.html
+ * @link https://codeigniter.com/userguide3/libraries/sessions.html
*/
interface SessionHandlerInterface {
diff --git a/system/libraries/Session/Session_driver.php b/system/libraries/Session/Session_driver.php
index dbc833739..734b6e052 100644
--- a/system/libraries/Session/Session_driver.php
+++ b/system/libraries/Session/Session_driver.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Sessions
* @author Andrey Andreev
- * @link https://codeigniter.com/user_guide/libraries/sessions.html
+ * @link https://codeigniter.com/userguide3/libraries/sessions.html
*/
abstract class CI_Session_driver implements SessionHandlerInterface {
diff --git a/system/libraries/Session/drivers/Session_database_driver.php b/system/libraries/Session/drivers/Session_database_driver.php
index 89afe3455..a3055af5e 100644
--- a/system/libraries/Session/drivers/Session_database_driver.php
+++ b/system/libraries/Session/drivers/Session_database_driver.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Sessions
* @author Andrey Andreev
- * @link https://codeigniter.com/user_guide/libraries/sessions.html
+ * @link https://codeigniter.com/userguide3/libraries/sessions.html
*/
class CI_Session_database_driver extends CI_Session_driver implements SessionHandlerInterface {
diff --git a/system/libraries/Session/drivers/Session_files_driver.php b/system/libraries/Session/drivers/Session_files_driver.php
index 2899b7dec..49bf5b781 100644
--- a/system/libraries/Session/drivers/Session_files_driver.php
+++ b/system/libraries/Session/drivers/Session_files_driver.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Sessions
* @author Andrey Andreev
- * @link https://codeigniter.com/user_guide/libraries/sessions.html
+ * @link https://codeigniter.com/userguide3/libraries/sessions.html
*/
class CI_Session_files_driver extends CI_Session_driver implements SessionHandlerInterface {
@@ -196,6 +196,10 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
$this->_fingerprint = md5('');
return '';
}
+
+ // Prevent possible data corruption
+ // See https://github.com/bcit-ci/CodeIgniter/issues/5857
+ clearstatcache(TRUE, $this->_file_path.$session_id);
}
// We shouldn't need this, but apparently we do ...
// See https://github.com/bcit-ci/CodeIgniter/issues/4039
diff --git a/system/libraries/Session/drivers/Session_memcached_driver.php b/system/libraries/Session/drivers/Session_memcached_driver.php
index 854adf821..b4d3eb464 100644
--- a/system/libraries/Session/drivers/Session_memcached_driver.php
+++ b/system/libraries/Session/drivers/Session_memcached_driver.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Sessions
* @author Andrey Andreev
- * @link https://codeigniter.com/user_guide/libraries/sessions.html
+ * @link https://codeigniter.com/userguide3/libraries/sessions.html
*/
class CI_Session_memcached_driver extends CI_Session_driver implements SessionHandlerInterface {
diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php
index df38174b4..d65c6ee14 100644
--- a/system/libraries/Session/drivers/Session_redis_driver.php
+++ b/system/libraries/Session/drivers/Session_redis_driver.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Sessions
* @author Andrey Andreev
- * @link https://codeigniter.com/user_guide/libraries/sessions.html
+ * @link https://codeigniter.com/userguide3/libraries/sessions.html
*/
class CI_Session_redis_driver extends CI_Session_driver implements SessionHandlerInterface {
diff --git a/system/libraries/Table.php b/system/libraries/Table.php
index 06e8d7098..46f66949b 100644
--- a/system/libraries/Table.php
+++ b/system/libraries/Table.php
@@ -46,7 +46,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category HTML Tables
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/table.html
+ * @link https://codeigniter.com/userguide3/libraries/table.html
*/
class CI_Table {
diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php
index 07f066d01..75ccae8f8 100644
--- a/system/libraries/Trackback.php
+++ b/system/libraries/Trackback.php
@@ -46,7 +46,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Trackbacks
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/trackback.html
+ * @link https://codeigniter.com/userguide3/libraries/trackback.html
*/
class CI_Trackback {
diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php
index e67138c1a..d919d484a 100644
--- a/system/libraries/Typography.php
+++ b/system/libraries/Typography.php
@@ -44,7 +44,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Helpers
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/typography.html
+ * @link https://codeigniter.com/userguide3/libraries/typography.html
*/
class CI_Typography {
diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php
index 631d583ba..55e3bfcb2 100644
--- a/system/libraries/Unit_test.php
+++ b/system/libraries/Unit_test.php
@@ -46,7 +46,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category UnitTesting
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/unit_testing.html
+ * @link https://codeigniter.com/userguide3/libraries/unit_testing.html
*/
class CI_Unit_test {
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index 29f9f5ff9..ae60f35af 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -44,7 +44,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 +867,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 +901,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;
}
diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php
index a70511fc3..a42975b35 100644
--- a/system/libraries/User_agent.php
+++ b/system/libraries/User_agent.php
@@ -46,7 +46,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category User Agent
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/user_agent.html
+ * @link https://codeigniter.com/userguide3/libraries/user_agent.html
*/
class CI_User_agent {
diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php
index 690b245be..32b236b43 100644
--- a/system/libraries/Xmlrpc.php
+++ b/system/libraries/Xmlrpc.php
@@ -51,7 +51,7 @@ if ( ! function_exists('xml_parser_create'))
* @subpackage Libraries
* @category XML-RPC
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/xmlrpc.html
+ * @link https://codeigniter.com/userguide3/libraries/xmlrpc.html
*/
class CI_Xmlrpc {
@@ -559,7 +559,7 @@ class CI_Xmlrpc {
*
* @category XML-RPC
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/xmlrpc.html
+ * @link https://codeigniter.com/userguide3/libraries/xmlrpc.html
*/
class XML_RPC_Client extends CI_Xmlrpc
{
@@ -780,7 +780,7 @@ class XML_RPC_Client extends CI_Xmlrpc
*
* @category XML-RPC
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/xmlrpc.html
+ * @link https://codeigniter.com/userguide3/libraries/xmlrpc.html
*/
class XML_RPC_Response
{
@@ -1030,7 +1030,7 @@ class XML_RPC_Response
*
* @category XML-RPC
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/xmlrpc.html
+ * @link https://codeigniter.com/userguide3/libraries/xmlrpc.html
*/
class XML_RPC_Message extends CI_Xmlrpc
{
@@ -1649,7 +1649,7 @@ class XML_RPC_Message extends CI_Xmlrpc
*
* @category XML-RPC
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/xmlrpc.html
+ * @link https://codeigniter.com/userguide3/libraries/xmlrpc.html
*/
class XML_RPC_Values extends CI_Xmlrpc
{
diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php
index e70b80397..e20bf4836 100644
--- a/system/libraries/Xmlrpcs.php
+++ b/system/libraries/Xmlrpcs.php
@@ -56,7 +56,7 @@ if ( ! class_exists('CI_Xmlrpc', FALSE))
* @subpackage Libraries
* @category XML-RPC
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/xmlrpc.html
+ * @link https://codeigniter.com/userguide3/libraries/xmlrpc.html
*/
class CI_Xmlrpcs extends CI_Xmlrpc {
@@ -348,7 +348,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc {
return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']);
}
}
- elseif (($objectCall && ! is_callable(array($method_parts[0], $method_parts[1])))
+ elseif (($objectCall && ( ! method_exists($method_parts[0], $method_parts[1]) OR ! (new ReflectionMethod($method_parts[0], $method_parts[1]))->isPublic()))
OR ( ! $objectCall && ! is_callable($this->methods[$methName]['function']))
)
{
diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php
index c0a14023d..e99873ae7 100644
--- a/system/libraries/Zip.php
+++ b/system/libraries/Zip.php
@@ -50,7 +50,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Libraries
* @category Encryption
* @author EllisLab Dev Team
- * @link https://codeigniter.com/user_guide/libraries/zip.html
+ * @link https://codeigniter.com/userguide3/libraries/zip.html
*/
class CI_Zip {
@@ -406,13 +406,14 @@ class CI_Zip {
return FALSE;
}
- return $this->zipdata
- .$this->directory."\x50\x4b\x05\x06\x00\x00\x00\x00"
+ // @see https://github.com/bcit-ci/CodeIgniter/issues/5864
+ $footer = $this->directory."\x50\x4b\x05\x06\x00\x00\x00\x00"
.pack('v', $this->entries) // total # of entries "on this disk"
.pack('v', $this->entries) // total # of entries overall
.pack('V', self::strlen($this->directory)) // size of central dir
.pack('V', self::strlen($this->zipdata)) // offset to start of central dir
."\x00\x00"; // .zip file comment length
+ return $this->zipdata.$footer;
}
// --------------------------------------------------------------------