X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=mdref%2FAction.php;fp=mdref%2FAction.php;h=19cf9106f363c9edb6e89e1b83a9cd6fa6aa5ac0;hb=7c1050e82a925e430a57fc4094667b87c10b98ca;hp=05e007fe37b0ea176dda8d9be8b738c2e273294e;hpb=7e4229e92b7d26183f9099ba646b64528023ab8c;p=mdref%2Fmdref 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; } }