mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-13 16:53:59 +02:00
Fix split for PHP 5.3
This commit is contained in:
@@ -1183,6 +1183,11 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
|||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mb_split errors when supplied an empty pattern in PHP 5.3
|
||||||
|
if ($pattern === '') {
|
||||||
|
return array(static::create($this->str, $this->encoding));
|
||||||
|
}
|
||||||
|
|
||||||
$regexEncoding = mb_regex_encoding();
|
$regexEncoding = mb_regex_encoding();
|
||||||
mb_regex_encoding($this->encoding);
|
mb_regex_encoding($this->encoding);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user