1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 16:26:59 +02:00

Fix issue processwire/processwire-issues#381 where Selectors class could get confused by a quoted value with comma when contained in an OR value

This commit is contained in:
Ryan Cramer
2017-10-12 11:57:26 -04:00
parent 58bde80a81
commit 5dc690af9e

View File

@@ -516,8 +516,18 @@ class Selectors extends WireArray {
if($commaPos === false && $closingQuote) { if($commaPos === false && $closingQuote) {
// if closing quote and comma didn't match, try to match just comma in case of "something"<space>, // if closing quote and comma didn't match, try to match just comma in case of "something"<space>,
$commaPos = strpos(substr($str, 1), ','); $str1 = substr($str, 1);
if($commaPos !== false) $commaPos++; $commaPos = strpos($str1, ',');
if($commaPos !== false) {
$closingQuotePos = strpos($str1, $closingQuote);
if($closingQuotePos > $commaPos) {
// comma is in quotes and thus not one we want to work with
return false;
} else {
// increment by 1 since it was derived from a string at position 1 (rather than 0)
$commaPos++;
}
}
} }
if($commaPos === false) { if($commaPos === false) {