From: Michael Wallner Date: Tue, 14 Oct 2014 16:24:37 +0000 (+0200) Subject: fix redirect X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=3d804b7c153990d081d5acfaee7e594873666f13;hp=6478b415c59070f70ed860f3a592377eef9783b1;p=mdref%2Fmdref fix redirect --- diff --git a/mdref/Action.php b/mdref/Action.php index dafc8e5..dcd8fcb 100644 --- a/mdref/Action.php +++ b/mdref/Action.php @@ -135,12 +135,15 @@ class Action extends Observer { return; } + $cnn = null; if (($repo = $this->reference->getRepoForEntry($pld->ref, $cnn))) { - /* direct match */ - $pld->entry = $repo->getEntry($pld->ref); - } else if (strlen($cnn)) { - /* redirect */ - $this->serveCanonical($ctl, $cnn); + if (strlen($cnn)) { + /* redirect */ + $this->serveCanonical($ctl, $cnn); + } else { + /* direct match */ + $pld->entry = $repo->getEntry($pld->ref); + } } else { $this->servePreset($ctl, $pld); }