From f15216f53efcacc3d93636c3c5a7601af7bff4be Mon Sep 17 00:00:00 2001 From: donncha Date: Tue, 27 Jun 2006 14:45:13 +0000 Subject: Applied redirection patch from bug #27. In blogs display, use $path if using subdirs git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@604 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/wpmu-functions.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'wp-includes/wpmu-functions.php') diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php index c85d654..376b9fc 100644 --- a/wp-includes/wpmu-functions.php +++ b/wp-includes/wpmu-functions.php @@ -780,25 +780,25 @@ function wpmu_get_cache( $key, $path ) { // wpmu admin functions function wpmu_admin_do_redirect( $url = '' ) { + $url = wpmu_admin_redirect_add_updated_param( $url ); if( isset( $_GET[ 'redirect' ] ) ) { if( substr( $_GET[ 'redirect' ], 0, 2 ) == 's_' ) { - header( "Location: {$url}?updated=true&action=blogs&s=". wp_specialchars( substr( $_GET[ 'redirect' ], 2 ) ) ); - die(); + $url .= "&action=blogs&s=". wp_specialchars( substr( $_GET[ 'redirect' ], 2 ) ); } } elseif( isset( $_POST[ 'redirect' ] ) ) { - $url = $_POST[ 'redirect' ]; - if( strpos( $url, 'updated=true' ) === false ) { - if( strpos( $url, '?' ) === true ) { - $url .= '&updated=true'; - } else { - $url .= '?updated=true'; - } + $url = wpmu_admin_redirect_add_updated_param( $_POST[ 'redirect' ] ); + } + header( "Location: {$url}" ); + die(); +} +function wpmu_admin_redirect_add_updated_param( $url = '' ) { + if( strpos( $url, 'updated=true' ) === false ) { + if( strpos( $url, '?' ) === false ) { + return $url . '?updated=true'; + } else { + return $url . '&updated=true'; } - header( "Location: {$url}" ); - die(); - } else { - header( "Location: {$url}?updated=true" ); - die(); + return $url; } } -- cgit