From 35a7b44d6515e5ceae0151119a56904296a32ee5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 12 Jul 2014 21:46:26 +0300 Subject: Fix CI_Encryption::substr() for PHP 5.3 Nothing critical, just an edge case that isn't currently used --- system/libraries/Encryption.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system/libraries/Encryption.php b/system/libraries/Encryption.php index e002c28ef..1a61967a7 100644 --- a/system/libraries/Encryption.php +++ b/system/libraries/Encryption.php @@ -897,10 +897,13 @@ class CI_Encryption { * @param int $length * @return string */ - protected static function substr($str, $start, $length = null) + protected static function substr($str, $start, $length = NULL) { if (self::$func_override) { + // mb_substr($str, $start, null, '8bit') returns an empty + // string on PHP 5.3 + isset($length) OR $length = ($start >= 0 ? self::strlen($str) - $start : -$start); return mb_substr($str, $start, $length, '8bit'); } -- cgit v1.2.3-24-g4f1b