summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-07-12 20:46:26 +0200
committerAndrey Andreev <narf@devilix.net>2014-07-12 20:46:26 +0200
commit35a7b44d6515e5ceae0151119a56904296a32ee5 (patch)
tree0e51173d28e3417291f6916492292748e69da736 /system/libraries
parent11beac2458afa34fe83913b77c9ba103d90583cd (diff)
Fix CI_Encryption::substr() for PHP 5.3
Nothing critical, just an edge case that isn't currently used
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Encryption.php5
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');
}