1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 15:57:01 +02:00
This commit is contained in:
Ryan Cramer
2016-12-28 07:03:17 -05:00
parent 20b6ebb81f
commit e12095e622

View File

@@ -309,6 +309,13 @@ class Selectors extends WireArray {
// replace characters that are allowed but aren't useful here
$str = str_replace(array('!', '(', ')', '@', '.', '|', '_'), '', trim(strtolower($str)));
// flatten sub-selectors
$pos = strpos($str, '[');
if($pos && strrpos($str, ']') > $pos) {
$str = str_replace(array(']', '=[', '<[', '>['), array('', '=1,', '<2,', '>3,'), $str);
}
$str = rtrim($str, ", ");
// first character must match alphabet
if(strpos($alphabet, substr($str, 0, 1)) === false) return false;