1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-25 15:51:37 +02:00

Add a few to-do code snippets, comments and notes for 3.0.150+ (next dev branch after master merge)

This commit is contained in:
Ryan Cramer
2019-12-31 14:22:33 -05:00
parent a0ddedc005
commit 22808c316f
5 changed files with 49 additions and 0 deletions

View File

@@ -265,6 +265,7 @@ class InputfieldForm extends InputfieldWrapper {
} // $fields
$processNow = $numFieldsMatched > 0;
// @todo 3.0.150: if($processNow) $child->set('showIfSkipped', false); // https://processwire.com/talk/topic/22130-forced-10-inputfield-dependency-issues/
if(!$processNow) break;
if(self::debug) $this->debugNote("$child->name ($child->label) - matched: showIf($selector)");

View File

@@ -365,6 +365,7 @@ class ProcessPageView extends Process {
$numParts = substr_count($it, '/');
if($numParts > $config->maxUrlDepth) return null;
// if($this->isSecurePagefileUrl($it)) { // @todo replace next line with this in 3.0.150
if($config->pagefileSecure) {
$page = $this->checkRequestFile($it);
if(is_object($page)) {
@@ -945,6 +946,38 @@ class ProcessPageView extends Process {
public function setDelayRedirects($delayRedirects) {
$this->delayRedirects = $delayRedirects ? true : false;
}
/**
* Are secure pagefiles possible on this system and url?
*
* @param string $url
* @return bool
* @todo enable in 3.0.150
*
protected function isSecurePagefileUrl($url) {
$config = $this->wire('config');
// if URL does not start from root, prepend root
if(strpos($url, $config->urls->root) !== 0) $url = $config->urls->root . ltrim($url, '/');
// if URL is not pointing to the files structure, then this is not a files URL
if(strpos($url, $config->urls->files) !== 0) return false;
// pagefileSecure option is enabled and URL pointing to files
if($config->pagefileSecure) return true;
// check if any templates allow pagefileSecure option
$allow = false;
foreach($this->wire('templates') as $template) {
if(!$template->pagefileSecure) continue;
$allow = true;
break;
}
// if at least one template supports pagefileSecure option we will return true here
return $allow;
}
*/
}