diff --git a/phpgwapi/inc/class.egw_session_memcache.inc.php b/phpgwapi/inc/class.egw_session_memcache.inc.php index 2cd4151083..5e4fb1913e 100644 --- a/phpgwapi/inc/class.egw_session_memcache.inc.php +++ b/phpgwapi/inc/class.egw_session_memcache.inc.php @@ -240,6 +240,8 @@ class egw_session_memcache if (self::DEBUG > 1) error_log("\n memcache in cutbyte mb $id:$n:".print_r(mb_substr($data,$offset,$len,'ascii'),true)); if (self::DEBUG > 1) error_log("\n memcache in cutbyte norm $id:$n:".print_r(substr($data,$offset,$len),true)); + if (is_null($len)) $len = self::_bytes($data) - $offset; + return self::$mbstring_func_overload ? mb_substr($data,$offset,$len,'ascii') : substr($data,$offset,$len); } diff --git a/phpgwapi/inc/class.global_stream_wrapper.inc.php b/phpgwapi/inc/class.global_stream_wrapper.inc.php index ecb30a2f83..81a0bf7524 100644 --- a/phpgwapi/inc/class.global_stream_wrapper.inc.php +++ b/phpgwapi/inc/class.global_stream_wrapper.inc.php @@ -125,6 +125,8 @@ class global_stream_wrapper */ private static function _cut_bytes(&$data,$offset,$len=null) { + if (is_null($len)) $len = self::_bytes($data) - $offset; + return self::$mbstring_func_overload ? mb_substr($data,$offset,$len,'ascii') : substr($data,$offset,$len); }