|
From: FlorinCB <ory...@us...> - 2008-09-06 16:57:52
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30056 Modified Files: Tag: core28x mx_functions_phpbb.php Log Message: mx_append_sid( ) made standallone since I have troble with this Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/Attic/mx_functions_phpbb.php,v retrieving revision 1.32.2.18 retrieving revision 1.32.2.19 diff -C2 -d -r1.32.2.18 -r1.32.2.19 *** mx_functions_phpbb.php 28 Aug 2008 18:50:56 -0000 1.32.2.18 --- mx_functions_phpbb.php 6 Sep 2008 16:57:46 -0000 1.32.2.19 *************** *** 632,642 **** * @return string */ ! function mx_append_sid( $url, $non_html_amp = false, $mod_rewrite_only = false ) { ! global $portal_config, $mx_mod_rewrite; - // // Is mod_rewrite enabled? If so, do some url rewrites... - // if (is_object($mx_mod_rewrite)) { --- 632,640 ---- * @return string */ ! function mx_append_sid($url, $non_html_amp = false, $mod_rewrite_only = false) { ! global $SID, $_SID, $mx_mod_rewrite, $userdata; // Is mod_rewrite enabled? If so, do some url rewrites... if (is_object($mx_mod_rewrite)) { *************** *** 644,658 **** } ! // ! // Replaces same function in sessions.php ! // if ($mod_rewrite_only) { return $url; } ! else { ! return append_sid( $url, $non_html_amp ); } } --- 642,675 ---- } ! // Replaces same function in mx_sessions_phpbbx.php if ($mod_rewrite_only) { return $url; } ! ! /* ! if ( !empty($_SID) && !preg_match('#sid=#', $url) ) { ! $url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID; } + */ + + //Will this make troble if it's correct? + if ( !empty($SID) && !preg_match('#sid=#', $url) ) + { + $url .= ( (strpos($url, '?') === false) ? '?' : (( $non_html_amp ) ? '&' : '&' ) ) . $SID; + } + + if ( !empty($_SID) && !preg_match('#sid=#', $url) ) + { + $url .= ( (strpos($url, '?') === false) ? '?' : (( $non_html_amp ) ? '&' : '&' ) ) . 'sid=' . $_SID; + } + + if (defined('IN_ADMIN') && !preg_match('#sid=#', $url)) + { + $url .= ( (strpos($url, '?') === false) ? '?' : (( $non_html_amp ) ? '&' : '&' ) ) . 'sid=' . $userdata['session_id']; + } + + return $url; } |