From: Michael Wallner Date: Thu, 24 Sep 2015 14:47:43 +0000 (+0200) Subject: fix serving presets X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=7c1050e82a925e430a57fc4094667b87c10b98ca;p=mdref%2Fmdref fix serving presets --- 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; } }