X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=mdref%2FAction.php;h=3addfa0527fe4880259d57e3f4ab964ff9c04ae2;hb=081cec2c9cfe879588d5989bcc09a34412f1d9c9;hp=da3a4da871c5dd6c354af8990b8d66f879d9e1a0;hpb=9e29e618d95d400ebcaa949ae06feb859a3a0562;p=mdref%2Fmdref diff --git a/mdref/Action.php b/mdref/Action.php index da3a4da..3addfa0 100644 --- a/mdref/Action.php +++ b/mdref/Action.php @@ -180,6 +180,9 @@ class Action { include ROOT."/views/layout.phtml"; $this->response->addHeader("Link", "<" . $this->baseUrl->path . "index.css>; rel=preload; as=style"); $this->response->addHeader("Link", "<" . $this->baseUrl->path . "index.js>; rel=preload; as=script"); + if (isset($exception) && $exception->getCode()) { + $this->response->setResponseCode($exception->getCode()); + } if (is_resource($this->output)) { $this->response->send($this->output); } else { @@ -194,10 +197,10 @@ class Action { try { $pld = $this->createPayload(); - if (strlen($pld->ref)) { + if (isset($pld->ref) && strlen($pld->ref)) { $cnn = null; if (($repo = $this->reference->getRepoForEntry($pld->ref, $cnn))) { - if (strlen($cnn)) { + if (isset($cnn) && strlen($cnn)) { /* redirect */ $this->serveCanonical($cnn); return;