mirror of
https://github.com/processwire/processwire.git
synced 2025-08-10 16:54:44 +02:00
Fix issue processwire/processwire-issues#353 remove limit on max selector quantity
This commit is contained in:
@@ -38,30 +38,12 @@ require_once(PROCESSWIRE_CORE_PATH . "Selector.php");
|
|||||||
|
|
||||||
class Selectors extends WireArray {
|
class Selectors extends WireArray {
|
||||||
|
|
||||||
/**
|
|
||||||
* Maximum length for a selector value
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
const maxValueLength = 500;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum length for a selector operator
|
* Maximum length for a selector operator
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const maxOperatorLength = 10;
|
const maxOperatorLength = 10;
|
||||||
|
|
||||||
/**
|
|
||||||
* Maximum length for a selector field name
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
const maxFieldLength = 50;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Maximum number of selectors that can be present in a given selectors string
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
const maxSelectors = 20;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Static array of Selector types of $operator => $className
|
* Static array of Selector types of $operator => $className
|
||||||
*
|
*
|
||||||
@@ -411,8 +393,6 @@ class Selectors extends WireArray {
|
|||||||
*/
|
*/
|
||||||
protected function extractString($str) {
|
protected function extractString($str) {
|
||||||
|
|
||||||
$cnt = 0;
|
|
||||||
|
|
||||||
while(strlen($str)) {
|
while(strlen($str)) {
|
||||||
|
|
||||||
$not = false;
|
$not = false;
|
||||||
@@ -442,8 +422,6 @@ class Selectors extends WireArray {
|
|||||||
if($not) $selector->not = true;
|
if($not) $selector->not = true;
|
||||||
$this->add($selector);
|
$this->add($selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(++$cnt > self::maxSelectors) break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -682,7 +660,7 @@ class Selectors extends WireArray {
|
|||||||
$len = strlen("$value");
|
$len = strlen("$value");
|
||||||
if($len) {
|
if($len) {
|
||||||
$str = substr($str, $n);
|
$str = substr($str, $n);
|
||||||
if($len > self::maxValueLength) $value = substr($value, 0, self::maxValueLength);
|
// if($len > self::maxValueLength) $value = substr($value, 0, self::maxValueLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
$str = ltrim($str, ' ,"\']})'); // should be executed even if blank value
|
$str = ltrim($str, ' ,"\']})'); // should be executed even if blank value
|
||||||
|
Reference in New Issue
Block a user