mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Added support for regex modifiers
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6668 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
5fe0038a74
commit
fc8611b003
2 changed files with 11 additions and 3 deletions
|
@ -404,7 +404,7 @@ class Set extends Object {
|
|||
$contexts = array($data);
|
||||
}
|
||||
|
||||
$tokens = array_slice(preg_split('/(?<!=)\/(?!])/', $path), 1);
|
||||
$tokens = array_slice(preg_split('/(?<!=)\/(?![a-z]*\])/', $path), 1);
|
||||
do {
|
||||
$token = array_shift($tokens);
|
||||
$conditions = false;
|
||||
|
|
|
@ -426,8 +426,16 @@ class SetTest extends UnitTestCase {
|
|||
|
||||
$expected = array(1, 3);
|
||||
$r = Set::extract('/User[name=/n/]/id', $tricky);
|
||||
$this->assertEqual($r, $expected);
|
||||
|
||||
$this->assertEqual($r, $expected);
|
||||
|
||||
$expected = array(4);
|
||||
$r = Set::extract('/User[name=/N/]/id', $tricky);
|
||||
$this->assertEqual($r, $expected);
|
||||
|
||||
$expected = array(1, 3, 4);
|
||||
$r = Set::extract('/User[name=/N/i]/id', $tricky);
|
||||
$this->assertEqual($r, $expected);
|
||||
|
||||
$common = array(
|
||||
array(
|
||||
'Article' => array(
|
||||
|
|
Loading…
Reference in a new issue