Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1597)
+++ branches/2.8.x/CHANGELOG	(revision 1598)
@@ -11,6 +11,9 @@
 ! = Update/Change
 
 =========================== add small Features 2.8.2 ==========================
+06 Feb-2012 Build 1598 Dietmar Woellbrink (Luisehahne)
+# fixed undefined fragment index in initialize.php 
+! add $_SESSION['HTTP_REFERER'] storing active pagelink if page_id != 0
 05 Feb-2012 Build 1597 Dietmar Woellbrink (Luisehahne)
 # fixed issues with get_magic_quotes_gpc and FCKeditor
 04 Feb-2012 Build 1596 Dietmar Woellbrink (Luisehahne)
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1597)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1598)
@@ -51,5 +51,5 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.2');
-if(!defined('REVISION')) define('REVISION', '1597');
+if(!defined('REVISION')) define('REVISION', '1598');
 if(!defined('SP')) define('SP', 'SP2');
Index: branches/2.8.x/wb/framework/initialize.php
===================================================================
--- branches/2.8.x/wb/framework/initialize.php	(revision 1597)
+++ branches/2.8.x/wb/framework/initialize.php	(revision 1598)
@@ -27,18 +27,19 @@
 	$sTmpReferer = '';
 	if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] != '') {
 	        $tmp0 = parse_url($_SERVER['HTTP_REFERER']);
-	        if ($tmp0 !== false) {
-	                $tmp0['host'] = isset($tmp0['host']) ? $tmp0['host'] : '';
-	                $tmp0['path'] = isset($tmp0['path']) ? $tmp0['path'] : '';
-	                $tmp1 = parse_url(WB_URL);
-	                if ($tmp1 !== false) {
-	                        $tmp1['host'] = isset($tmp1['host']) ? $tmp1['host'] : '';
-	                        $tmp1['path'] = isset($tmp1['path']) ? $tmp1['path'] : '';
-	                        if (strpos($tmp0['host'].'/'.$tmp0['path'], $tmp1['host'].'/'.$tmp1['path'])) {
-	                                $sTmpReferer = WB_URL.$tmp['path'].$tmp[fragment];
-	                        }
-	                }
-	        }
+       if ($tmp0 !== false) {
+                $tmp0['host'] = isset($tmp0['host']) ? $tmp0['host'] : '';
+                $tmp0['path'] = isset($tmp0['path']) ? $tmp0['path'] : '';
+                $tmp0['fragment'] = isset($tmp0['fragment']) ? '#'.$tmp0['fragment'] : '';
+                $tmp1 = parse_url(WB_URL);
+                if ($tmp1 !== false) {
+                        $tmp1['host'] = isset($tmp1['host']) ? $tmp1['host'] : '';
+                        $tmp1['path'] = isset($tmp1['path']) ? $tmp1['path'] : '';
+                        if (strpos($tmp0['host'].$tmp0['path'], $tmp1['host'].$tmp1['path']) !== false) {
+                                $sTmpReferer = WB_URL.$tmp0['path'].$tmp0['fragment'];
+                        }
+                }
+        }
 	}
 	$_SERVER['HTTP_REFERER'] = $sTmpReferer;
 	date_default_timezone_set('UTC');
@@ -157,6 +158,4 @@
 
 	define('EDITOR_WIDTH', 0);
 
-}
-
-?>
\ No newline at end of file
+}
\ No newline at end of file
Index: branches/2.8.x/wb/framework/class.frontend.php
===================================================================
--- branches/2.8.x/wb/framework/class.frontend.php	(revision 1597)
+++ branches/2.8.x/wb/framework/class.frontend.php	(revision 1598)
@@ -186,6 +186,8 @@
 			$this->page_keywords=$this->page['keywords'];
 			// Page link
 			$this->link=$this->page_link($this->page['link']);
+			$_SESSION['PAGE_ID'] = $this->page_id;
+			$_SESSION['HTTP_REFERER'] = $this->link;
 
 		// End code to set details as either variables of constants
 		}
Index: branches/2.8.x/wb/framework/frontend.functions.php
===================================================================
--- branches/2.8.x/wb/framework/frontend.functions.php	(revision 1597)
+++ branches/2.8.x/wb/framework/frontend.functions.php	(revision 1598)
@@ -266,6 +266,7 @@
 		if(!defined('PAGE_CONTENT') OR $block!=1)
         {
 			$page_id = intval($wb->page_id);
+/* move to class.frontend
             // set session variable to save page_id only if PAGE_CONTENT is empty
             $_SESSION['PAGE_ID'] = !isset($_SESSION['PAGE_ID']) ? $page_id : $_SESSION['PAGE_ID'];
             // set to new value if page_id changed and not 0
@@ -273,6 +274,7 @@
             {
 	            $_SESSION['PAGE_ID'] = $page_id;
             }
+*/
 		// First get all sections for this page
 			$sql  = 'SELECT `section_id`, `module`, `publ_start`, `publ_end` ';
 			$sql .= 'FROM `'.TABLE_PREFIX.'sections` ';
