mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 00:06:55 +02:00
Fix issue processwire/processwire-issues#153 where selector fails when there is leading comma in quoted value
This commit is contained in:
@@ -530,7 +530,9 @@ class Selectors extends WireArray {
|
|||||||
protected function extractValueQuick(&$str, $openingQuote, $closingQuote) {
|
protected function extractValueQuick(&$str, $openingQuote, $closingQuote) {
|
||||||
|
|
||||||
// determine where value ends
|
// determine where value ends
|
||||||
$commaPos = strpos("$str,", $closingQuote . ','); // "$str," just in case value is last and no trailing comma
|
$offset = 0;
|
||||||
|
if($openingQuote) $offset++; // skip over leading quote
|
||||||
|
$commaPos = strpos("$str,", $closingQuote . ',', $offset); // "$str," just in case value is last and no trailing comma
|
||||||
|
|
||||||
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>,
|
||||||
|
@@ -1309,7 +1309,23 @@ class ProcessPageLister extends Process implements ConfigurableModule {
|
|||||||
$class = '';
|
$class = '';
|
||||||
$statusIcon = '';
|
$statusIcon = '';
|
||||||
$isTrash = false;
|
$isTrash = false;
|
||||||
if(!strlen($value)) $value = $this->blankLabel;
|
|
||||||
|
if(!strlen($value)) {
|
||||||
|
// column is blank
|
||||||
|
$name = $p->name;
|
||||||
|
$maxNameLen = 20;
|
||||||
|
if(strlen($name) > $maxNameLen) {
|
||||||
|
$parts = explode('-', $name);
|
||||||
|
while(strlen($name) > $maxNameLen) {
|
||||||
|
array_pop($parts);
|
||||||
|
$name = implode('-', $parts);
|
||||||
|
}
|
||||||
|
if(!$name) $name = substr($p->name, 0, $maxNameLen);
|
||||||
|
$name .= '…';
|
||||||
|
}
|
||||||
|
$value = "$this->blankLabel <small class='ui-priority-secondary'>($name)</small>";
|
||||||
|
}
|
||||||
|
|
||||||
if($p->hasStatus(Page::statusHidden)) $class .= " PageListStatusHidden";
|
if($p->hasStatus(Page::statusHidden)) $class .= " PageListStatusHidden";
|
||||||
if($p->hasStatus(Page::statusUnpublished)) $class .= " PageListStatusUnpublished";
|
if($p->hasStatus(Page::statusUnpublished)) $class .= " PageListStatusUnpublished";
|
||||||
if($p->hasStatus(Page::statusLocked)) {
|
if($p->hasStatus(Page::statusLocked)) {
|
||||||
|
Reference in New Issue
Block a user