diff options
author | Andrey Andreev <narf@devilix.net> | 2014-07-12 20:46:26 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-07-12 20:46:26 +0200 |
commit | 35a7b44d6515e5ceae0151119a56904296a32ee5 (patch) | |
tree | 0e51173d28e3417291f6916492292748e69da736 /system | |
parent | 11beac2458afa34fe83913b77c9ba103d90583cd (diff) |
Fix CI_Encryption::substr() for PHP 5.3
Nothing critical, just an edge case that isn't currently used
Diffstat (limited to 'system')
-rw-r--r-- | system/libraries/Encryption.php | 5 |
1 files changed, 4 insertions, 1 deletions
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'); } |