parent
1d250a2f7c
commit
447479d973
1 changed files with 2 additions and 3 deletions
|
@ -455,8 +455,9 @@ class Pico
|
||||||
// load raw file content
|
// load raw file content
|
||||||
$this->triggerEvent('onContentLoading');
|
$this->triggerEvent('onContentLoading');
|
||||||
|
|
||||||
|
$requestedPageId = $this->getPageId($this->requestFile) ?: $this->requestFile;
|
||||||
$hiddenFileRegex = '/(?:^|\/)(?:_|404' . preg_quote($this->getConfig('content_ext'), '/') . '$)/';
|
$hiddenFileRegex = '/(?:^|\/)(?:_|404' . preg_quote($this->getConfig('content_ext'), '/') . '$)/';
|
||||||
if (is_file($this->requestFile) && !preg_match($hiddenFileRegex, $this->requestFile)) {
|
if (is_file($this->requestFile) && !preg_match($hiddenFileRegex, $requestedPageId)) {
|
||||||
$this->rawContent = $this->loadFileContent($this->requestFile);
|
$this->rawContent = $this->loadFileContent($this->requestFile);
|
||||||
} else {
|
} else {
|
||||||
$this->triggerEvent('on404ContentLoading');
|
$this->triggerEvent('on404ContentLoading');
|
||||||
|
@ -2330,14 +2331,12 @@ class Pico
|
||||||
{
|
{
|
||||||
$contentDir = $this->getConfig('content_dir');
|
$contentDir = $this->getConfig('content_dir');
|
||||||
$contentDirLength = strlen($contentDir);
|
$contentDirLength = strlen($contentDir);
|
||||||
|
|
||||||
if (substr($path, 0, $contentDirLength) !== $contentDir) {
|
if (substr($path, 0, $contentDirLength) !== $contentDir) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$contentExt = $this->getConfig('content_ext');
|
$contentExt = $this->getConfig('content_ext');
|
||||||
$contentExtLength = strlen($contentExt);
|
$contentExtLength = strlen($contentExt);
|
||||||
|
|
||||||
if (substr($path, -$contentExtLength) !== $contentExt) {
|
if (substr($path, -$contentExtLength) !== $contentExt) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue