From 23ac02979427870d7e21735c4d2c041ac73a6b1f Mon Sep 17 00:00:00 2001 From: ozhozh Date: Thu, 21 Oct 2010 19:54:06 +0000 Subject: [PATCH] Tweak internal redirects: use 302 instead of 301 to help prevent browser cache problems. Fixes issue 529. Might help issue 528 too. git-svn-id: http://yourls.googlecode.com/svn/trunk@515 12232710-3e20-11de-b438-597f59cd7555 --- admin/plugins.php | 4 ++-- includes/load-yourls.php | 4 ++-- yourls-go.php | 2 +- yourls-infos.php | 4 ++-- yourls-loader.php | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/admin/plugins.php b/admin/plugins.php index b498b58..b1a6446 100644 --- a/admin/plugins.php +++ b/admin/plugins.php @@ -23,14 +23,14 @@ case 'activate': $result = yourls_activate_plugin( $_GET['plugin'].'/plugin.php' ); if( $result === true ) - yourls_redirect( yourls_admin_url( 'plugins.php?success=activated' ) ); + yourls_redirect( yourls_admin_url( 'plugins.php?success=activated' ), 302 ); break; case 'deactivate': $result = yourls_deactivate_plugin( $_GET['plugin'].'/plugin.php' ); if( $result === true ) - yourls_redirect( yourls_admin_url( 'plugins.php?success=deactivated' ) ); + yourls_redirect( yourls_admin_url( 'plugins.php?success=deactivated' ), 302 ); break; diff --git a/includes/load-yourls.php b/includes/load-yourls.php index 447e073..85a8ebf 100644 --- a/includes/load-yourls.php +++ b/includes/load-yourls.php @@ -139,7 +139,7 @@ // Check if need to redirect to install procedure if( !yourls_is_installed() && ( !defined('YOURLS_INSTALLING') || YOURLS_INSTALLING != true ) ) { - yourls_redirect( YOURLS_SITE .'/admin/install.php' ); + yourls_redirect( yourls_admin_url( 'install.php' ), 302 ); } // Check if upgrade is needed. @@ -151,7 +151,7 @@ ( !defined('YOURLS_INSTALLING') || YOURLS_INSTALLING != true ) ) { if ( yourls_upgrade_is_needed() ) { - yourls_redirect( YOURLS_SITE .'/admin/upgrade.php' ); + yourls_redirect( YOURLS_SITE .'/admin/upgrade.php', 302 ); } } diff --git a/yourls-go.php b/yourls-go.php index f742167..0b9e2a1 100644 --- a/yourls-go.php +++ b/yourls-go.php @@ -40,7 +40,7 @@ } else { yourls_do_action( 'redirect_keyword_not_found', $keyword ); - yourls_redirect( YOURLS_SITE, 307 ); // no 404 to tell browser this might change, and also to not pollute logs + yourls_redirect( YOURLS_SITE, 302 ); // no 404 to tell browser this might change, and also to not pollute logs } } exit(); diff --git a/yourls-infos.php b/yourls-infos.php index 679b5ea..1f205fe 100644 --- a/yourls-infos.php +++ b/yourls-infos.php @@ -13,7 +13,7 @@ if ( !isset( $keyword ) ) { yourls_do_action( 'infos_no_keyword' ); - yourls_redirect( YOURLS_SITE, 307 ); + yourls_redirect( YOURLS_SITE, 302 ); } // Get basic infos for this shortened URL @@ -31,7 +31,7 @@ if ( $longurl === false ) { yourls_do_action( 'infos_keyword_not_found' ); - yourls_redirect( YOURLS_SITE, 307 ); + yourls_redirect( YOURLS_SITE, 302 ); } if( yourls_do_log_redirect() ) { diff --git a/yourls-loader.php b/yourls-loader.php index 2591fb5..8082252 100644 --- a/yourls-loader.php +++ b/yourls-loader.php @@ -53,11 +53,11 @@ if( preg_match( "@^[a-zA-Z]+://.+@", $request, $matches ) ) { $url = yourls_sanitize_url( $matches[0] ); yourls_do_action( 'load_template_redirect_admin', $url ); - yourls_redirect( yourls_admin_url('index.php').'?u='.rawurlencode( $url ) ); + yourls_redirect( yourls_admin_url('index.php').'?u='.rawurlencode( $url ), 302 ); exit; } // Past this point this is a request the loader could not understand yourls_do_action( 'loader_failed', $request ); -yourls_redirect( YOURLS_SITE, 307 ); +yourls_redirect( YOURLS_SITE, 302 ); exit; \ No newline at end of file -- 2.45.0