From 7c1050e82a925e430a57fc4094667b87c10b98ca Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Thu, 24 Sep 2015 16:47:43 +0200 Subject: [PATCH] fix serving presets --- mdref/Action.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mdref/Action.php b/mdref/Action.php index 05e007f..19cf910 100644 --- a/mdref/Action.php +++ b/mdref/Action.php @@ -97,6 +97,7 @@ class Action { /** * Serve a preset * @param \stdClass $pld + * @return true to continue serving the payload * @throws Exception */ private function servePreset($pld) { @@ -105,7 +106,7 @@ class Action { case "LICENSE": case "VERSION": $pld->text = file_get_contents(ROOT."/$pld->ref"); - break; + return true; case "index.css": $this->serveStylesheet(); break; @@ -115,6 +116,7 @@ class Action { default: throw new Exception(404, "$pld->ref not found"); } + return false; } private function serve() { @@ -138,8 +140,8 @@ class Action { /* direct match */ $pld->entry = $repo->getEntry($pld->ref); } - } else { - return $this->servePreset($pld); + } elseif (!$this->servePreset($pld)) { + return; } } -- 2.30.2