fix redirect
authorMichael Wallner <mike@php.net>
Tue, 14 Oct 2014 16:24:37 +0000 (18:24 +0200)
committerMichael Wallner <mike@php.net>
Tue, 14 Oct 2014 16:24:37 +0000 (18:24 +0200)
mdref/Action.php

index dafc8e55f493346e5f324fd9592bba7b2c69ce1f..dcd8fcbed025d24f4725c9b9c0976a2c19d8e2ba 100644 (file)
@@ -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);
                }