From 6234be88b02ae465381d26e2d33f93180aae7643 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sun, 24 Apr 2016 04:06:04 +0200 Subject: [PATCH] Always use `on404Content...` execution path when serving a 404.md --- lib/Pico.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Pico.php b/lib/Pico.php index f566a06..c498faf 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -298,7 +298,8 @@ class Pico // load raw file content $this->triggerEvent('onContentLoading', array(&$this->requestFile)); - if (file_exists($this->requestFile)) { + $notFoundFile = '404' . $this->getConfig('content_ext'); + if (file_exists($this->requestFile) && (basename($this->requestFile) !== $notFoundFile)) { $this->rawContent = $this->loadFileContent($this->requestFile); } else { $this->triggerEvent('on404ContentLoading', array(&$this->requestFile));