Don't attach hash if there isn't any anchor.
authorJan Schneider <jan@horde.org>
Fri, 15 Oct 2010 12:10:24 +0000 (14:10 +0200)
committerJan Schneider <jan@horde.org>
Fri, 15 Oct 2010 12:10:24 +0000 (14:10 +0200)
wicked/lib/Text_Wiki/Render/Xhtml/Wikilink2.php

index 4a2ad7d..e959dc7 100644 (file)
@@ -47,7 +47,10 @@ class Text_Wiki_Render_Xhtml_Wikilink2 extends Text_Wiki_Render_Xhtml_Wikilink {
             }
         }
 
-        $anchor = '#' . $this->urlEncode(substr($anchor, 1));
+        $anchor = $this->urlEncode(substr($anchor, 1));
+        if (strlen($anchor)) {
+            $anchor = '#' . $anchor;
+        }
 
         // Does the page exist?
         if ($exists) {