aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-08-28 19:04:05 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-08-28 19:04:05 +0200
commit86f40d6a2cc5c2b69eec91e8386a1fcbfdb46819 (patch)
treed49083249d04dc3e28d78fa720068bf57ea657c8
parent9bc3761f359294393a2872474b146460b03c0236 (diff)
downloadUstring-86f40d6a2cc5c2b69eec91e8386a1fcbfdb46819.zip
Ustring-86f40d6a2cc5c2b69eec91e8386a1fcbfdb46819.tar.gz
Ustring-86f40d6a2cc5c2b69eec91e8386a1fcbfdb46819.tar.bz2
Fix a bug with WITH_OFFSET and match().
-rw-r--r--String.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/String.php b/String.php
index 53a3ebb..b5cf37a 100644
--- a/String.php
+++ b/String.php
@@ -368,8 +368,11 @@ class String implements \ArrayAccess, \Countable, \IteratorAggregate {
$pattern = static::safePattern($pattern);
- if(true === $global && 0 === $flags)
- $flags = static::GROUP_BY_PATTERN;
+ if(true === $global)
+ if(0 === $flags)
+ $flags = static::GROUP_BY_PATTERN;
+ else
+ $flags &= ~PREG_SPLIT_OFFSET_CAPTURE;
$offset = strlen(mb_substr($this->_string, 0, $offset));