Fixed top/bottom anchors not working properly
authorAlexander Ebert <ebert@woltlab.com>
Thu, 7 Jun 2012 21:14:20 +0000 (23:14 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 7 Jun 2012 21:14:20 +0000 (23:14 +0200)
wcfsetup/install/files/js/WCF.js
wcfsetup/install/files/lib/system/WCF.class.php

index 7625f68c5ede6914a42966b460427d98b32f7c98..baad301f169046e5fc386ebf3633eb76c0a25ec5 100644 (file)
@@ -3357,6 +3357,8 @@ WCF.Effect.SmoothScroll = WCF.Effect.Scroll.extend({
                $('a[href$=#top],a[href$=#bottom]').click(function() {
                        var $target = $(this.hash);
                        self.scrollTo($target, true);
+                       
+                       return false;
                });
        }
 });
index a9f9dda1aba4669f7750e58c3de37d4e60bbba16..03f532c4b24ec0a6ee80cbd7ab9eea9b62f36bda 100644 (file)
@@ -643,7 +643,7 @@ class WCF {
                        $scriptName = substr($scriptName, 0, strrpos($scriptName, '/'));
                }
                
-               $path = str_replace($scriptName, '', $_SERVER['REQUEST_URI']);
+               $path = str_replace('/index.php', '', str_replace($scriptName, '', $_SERVER['REQUEST_URI']));
                $baseHref = self::getTPL()->get('baseHref');
                
                return $baseHref . 'index.php' . $path . '#' . $fragment;