mirror of
https://github.com/processwire/processwire.git
synced 2025-08-14 02:34:24 +02:00
Bump version to 3.0.159
This commit is contained in:
@@ -499,6 +499,8 @@ class PagesParents extends Wire {
|
|||||||
}
|
}
|
||||||
} else if($page->parentPrevious && $page->parentPrevious->id != $page->parent->id) {
|
} else if($page->parentPrevious && $page->parentPrevious->id != $page->parent->id) {
|
||||||
// existing page with parent changed
|
// existing page with parent changed
|
||||||
|
$this->rebuildAll();
|
||||||
|
/*
|
||||||
if($page->parentPrevious->numChildren === 0) {
|
if($page->parentPrevious->numChildren === 0) {
|
||||||
// parent no longer has children and doesn’t need entry
|
// parent no longer has children and doesn’t need entry
|
||||||
$numRows += $this->delete($page->parentPrevious);
|
$numRows += $this->delete($page->parentPrevious);
|
||||||
@@ -507,6 +509,7 @@ class PagesParents extends Wire {
|
|||||||
// first time parent gets added to pages_parents
|
// first time parent gets added to pages_parents
|
||||||
$numRows += $this->rebuild($page->parent);
|
$numRows += $this->rebuild($page->parent);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return $numRows;
|
return $numRows;
|
||||||
|
@@ -77,7 +77,7 @@ class ProcessWire extends Wire {
|
|||||||
* Reversion revision number
|
* Reversion revision number
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const versionRevision = 158;
|
const versionRevision = 159;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version suffix string (when applicable)
|
* Version suffix string (when applicable)
|
||||||
|
@@ -2169,9 +2169,13 @@ class Sanitizer extends Wire {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// reductions and replacements
|
// reductions and replacements
|
||||||
$reductions = array('..' => '.', './' => ' ', ' ' => ' ', '--' => '-');
|
$reductions = array('..' => '.', './' => ' ', ' ' => ' ');
|
||||||
foreach($reductions as $f => $r) {
|
foreach($reductions as $f => $r) {
|
||||||
while(strpos($value, $f) !== false) $value = str_replace($f, $r, $value);
|
if(strpos($value, $f) === false) continue;
|
||||||
|
if(in_array($f, $options['whitelist'])) continue;
|
||||||
|
do {
|
||||||
|
$value = str_replace($f, $r, $value);
|
||||||
|
} while(strpos($value, $f) !== false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$value = trim($value); // trim any kind of whitespace
|
$value = trim($value); // trim any kind of whitespace
|
||||||
|
@@ -307,6 +307,13 @@ class ProcessPageView extends Process {
|
|||||||
// did URL end with index.php|htm|html? If so we might redirect if a page matches without it.
|
// did URL end with index.php|htm|html? If so we might redirect if a page matches without it.
|
||||||
$indexRedirect = false;
|
$indexRedirect = false;
|
||||||
|
|
||||||
|
// options for $sanitizer->selectorValue() call
|
||||||
|
$selectorValueOptions = array(
|
||||||
|
'maxLength' => 2048,
|
||||||
|
'maxBytes' => 6144,
|
||||||
|
'allowArray' => false,
|
||||||
|
);
|
||||||
|
|
||||||
/** @var string $shit Dirty URL */
|
/** @var string $shit Dirty URL */
|
||||||
/** @var string $it Clean URL */
|
/** @var string $it Clean URL */
|
||||||
|
|
||||||
@@ -388,7 +395,7 @@ class ProcessPageView extends Process {
|
|||||||
$this->pageNum = (int) $matches[2];
|
$this->pageNum = (int) $matches[2];
|
||||||
$page = null;
|
$page = null;
|
||||||
} else {
|
} else {
|
||||||
$spit = $sanitizer->selectorValue($it, 2048);
|
$spit = $sanitizer->selectorValue($it, $selectorValueOptions);
|
||||||
$page = $pages->get("path=$spit, status<" . Page::statusMax);
|
$page = $pages->get("path=$spit, status<" . Page::statusMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,7 +420,7 @@ class ProcessPageView extends Process {
|
|||||||
$spit = $sanitizer->pageNameUTF8($trit);
|
$spit = $sanitizer->pageNameUTF8($trit);
|
||||||
if($trit === $spit) {
|
if($trit === $spit) {
|
||||||
// one segment off root
|
// one segment off root
|
||||||
$spit = $sanitizer->selectorValue($spit, 2048);
|
$spit = $sanitizer->selectorValue($spit, $selectorValueOptions);
|
||||||
$page = $pages->get("name=$spit, status=" . Page::statusUnique);
|
$page = $pages->get("name=$spit, status=" . Page::statusUnique);
|
||||||
if($page->id && $page->viewable()) {
|
if($page->id && $page->viewable()) {
|
||||||
$this->redirectURL = $page->url;
|
$this->redirectURL = $page->url;
|
||||||
@@ -437,7 +444,7 @@ class ProcessPageView extends Process {
|
|||||||
$urlSegment = substr($it, $pos);
|
$urlSegment = substr($it, $pos);
|
||||||
$urlSegments[$cnt] = $urlSegment;
|
$urlSegments[$cnt] = $urlSegment;
|
||||||
$it = substr($it, 0, $pos); // $it no longer includes the urlSegment
|
$it = substr($it, 0, $pos); // $it no longer includes the urlSegment
|
||||||
$selector = "path=" . $sanitizer->selectorValue($it, 2048) . ", status<" . Page::statusMax;
|
$selector = "path=" . $sanitizer->selectorValue($it, $selectorValueOptions) . ", status<" . Page::statusMax;
|
||||||
$page = $pages->get($selector);
|
$page = $pages->get($selector);
|
||||||
$cnt++;
|
$cnt++;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user