summaryrefslogtreecommitdiffstats
path: root/system/libraries/Encryption.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/Encryption.php')
-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');
}