From 3d804b7c153990d081d5acfaee7e594873666f13 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 14 Oct 2014 18:24:37 +0200 Subject: [PATCH 1/1] fix redirect --- mdref/Action.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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); } -- 2.30.2