r9963 - apps/gobi/trunk/code/Redirect

[email protected] Tue, 22 Sep 2009 14:50:03 +0200 (CEST)
Newsgroups gmane.comp.java.helma.cvs
Message-ID <20090922125003.88E183D0E2@mia>
Author: hannes
Date: 2009-09-22 14:50:03 +0200 (Tue, 22 Sep 2009)
New Revision: 9963

Modified:
   apps/gobi/trunk/code/Redirect/Redirect.js
Log:
Make nested redirects work with relative local target URLs

Details at http://dev.helma.org/trac/helma/changeset/9963

Modified: apps/gobi/trunk/code/Redirect/Redirect.js
===================================================================
--- apps/gobi/trunk/code/Redirect/Redirect.js	2009-09-22 12:32:53 UTC (rev 9962)
+++ apps/gobi/trunk/code/Redirect/Redirect.js	2009-09-22 12:50:03 UTC (rev 9963)
@@ -33,7 +33,11 @@
             url = root.href() + url.substring(1);
         } else {
             // local redirect with relative path
-            url = this.getParent().href() + url;
+            var parent = this.getParent();
+            while (parent instanceof Redirect) {
+                parent = parent.getParent();
+            }
+            url = parent.href() + url;
         }
     }
     return url;