mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 09:44:38 +02:00
Correction to previous commit
This commit is contained in:
@@ -575,7 +575,8 @@ class WireArray extends Wire implements \IteratorAggregate, \ArrayAccess, \Count
|
||||
if(isset($this->data[$key])) return $this->data[$key];
|
||||
|
||||
// check if key contains something other than numbers, letters, underscores, hyphens
|
||||
if(is_string($key) && !ctype_alnum($key) && !ctype_alnum(strtr($key, '-_', 'ab'))) {
|
||||
if(is_string($key)) {
|
||||
if(!ctype_alnum($key) && !ctype_alnum(strtr($key, '-_', 'ab'))) {
|
||||
|
||||
// check if key contains a selector
|
||||
if(Selectors::stringHasSelector($key)) {
|
||||
@@ -607,10 +608,11 @@ class WireArray extends Wire implements \IteratorAggregate, \ArrayAccess, \Count
|
||||
}
|
||||
return $match;
|
||||
}
|
||||
}
|
||||
|
||||
// if the WireArray uses numeric keys, then it's okay to
|
||||
// match a 'name' field if the provided key is a string
|
||||
if($this->usesNumericKeys()) {
|
||||
if(is_string($key) && $this->usesNumericKeys()) {
|
||||
$match = $this->getItemThatMatches('name', $key);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user