From c10dcb7d61c1cabd12c41124630070c388cafbc7 Mon Sep 17 00:00:00 2001
From: Andreas Gohr <andi@splitbrain.org>
Date: Sat, 26 Jun 2010 14:16:50 +0200
Subject: [PATCH] Workaround for IE& redirect to hash bug FS#1647

This needs testing. We need feedback from someone where this is
reproducible broken before applying this patch.
---
 inc/common.php | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/inc/common.php b/inc/common.php
index 25d743e0b..1db362f08 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -1475,6 +1475,17 @@ function send_redirect($url){
     // always close the session
     session_write_close();
 
+    // work around IE bug
+    // http://www.ianhoar.com/2008/11/16/internet-explorer-6-and-redirected-anchor-links/
+    list($url,$hash) = explode('#',$url);
+    if($hash){
+        if(strpos($url,'?')){
+            $url = $url.'&#'.$hash;
+        }else{
+            $url = $url.'?&#'.$hash;
+        }
+    }
+
     // check if running on IIS < 6 with CGI-PHP
     if( isset($_SERVER['SERVER_SOFTWARE']) && isset($_SERVER['GATEWAY_INTERFACE']) &&
         (strpos($_SERVER['GATEWAY_INTERFACE'],'CGI') !== false) &&
-- 
GitLab