Browse files

Fix redirection to login page after install

When installation is started from login page (redirected to install from
core.php), the link to 'Continue to log into Mantis' goes back to
install page instead of login page.

Resolved problem by adding a no-cache header.

Also changed Location header response to 307 instead of default 302.

Fixes #16510
  • Loading branch information...
1 parent 15fc661 commit 4c0ba6e13152886c2ae5d547547cc00cffafbde9 @dregad dregad committed Oct 20, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 core.php
View
5 core.php
@@ -226,7 +226,10 @@ function __autoload( $className ) {
if ( !( isset( $_SERVER['SCRIPT_NAME'] ) && ( 0 < strpos( $_SERVER['SCRIPT_NAME'], 'admin' ) ) ) ) {
header( 'Content-Type: text/html' );
- header( "Location: admin/install.php" );
+ # Temporary redirect (307) instead of Found (302) default
+ header( 'Location: admin/install.php', true, 307 );
+ # Make sure it's not cached
+ header( 'Cache-Control: no-store, no-cache, must-revalidate' );
exit;
}
}

0 comments on commit 4c0ba6e

Please sign in to comment.