[wp-trac] [WordPress Trac] #14904: Install page not redirecting to wp-admin/ on IIS6

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 28 06:40:12 UTC 2010


#14904: Install page not redirecting to wp-admin/ on IIS6
-----------------------------+----------------------------------------------
 Reporter:  knutsp           |        Owner:                 
     Type:  defect (bug)     |       Status:  closed         
 Priority:  normal           |    Milestone:  Awaiting Review
Component:  Upgrade/Install  |      Version:  3.0.1          
 Severity:  normal           |   Resolution:  duplicate      
 Keywords:                   |  
-----------------------------+----------------------------------------------
Changes (by knutsp):

  * status:  new => closed
  * resolution:  => duplicate


Comment:

 I just found out that WP_SITEURL will never be defined by WordPress. An
 absolute URL for the redirect to install.php may be constructed from
 $_SERVER.

 I suggest this change for pluggable.php:
 {{{
 function wp_redirect($location, $status = 302) {

         $location = apply_filters('wp_redirect', $location, $status);
         $status = apply_filters('wp_redirect_status', $status, $location);

         if ( !$location ) // allows the wp_redirect filter to cancel a
 redirect
                 return false;

         $location = wp_sanitize_redirect($location);

         if ( php_sapi_name() != 'cgi-fcgi' )
                 status_header($status); // This causes problems on IIS and
 some FastCGI setups
         header("Location: $location", true, $status);
 }
 endif;
 }}}
 and this change for load.php:
 {{{
 function wp_not_installed() {
         if ( is_multisite() ) {
                 if ( ! is_blog_installed() && ! defined( 'WP_INSTALLING' )
 )
                         wp_die( __( 'The site you have requested is not
 installed properly. Please contact the system administrator.' ) );
         } elseif ( ! is_blog_installed() && false === strpos(
 $_SERVER['PHP_SELF'], 'install.php' ) && !defined( 'WP_INSTALLING' ) ) {
                 if ( defined( 'WP_SITEURL' ) )
                         $link = WP_SITEURL . '/wp-admin/install.php';
                 elseif ( false !== strpos( $_SERVER['PHP_SELF'], 'wp-
 admin' ) )
                         $link = is_ssl() ? 'https://' :
 'http://'.$_SERVER['HTTP_HOST'] . preg_replace( '|/wp-admin/?.*?$|', '/',
 $_SERVER['PHP_SELF'] ) . 'wp-admin/install.php';
                 else
                         $link = is_ssl() ? 'https://' :
 'http://'.$_SERVER['HTTP_HOST'] . preg_replace( '|/[^/]+?$|', '/',
 $_SERVER['PHP_SELF'] ) . 'wp-admin/install.php';
                 require( ABSPATH . WPINC . '/kses.php' );
                 require( ABSPATH . WPINC . '/pluggable.php' );
                 require( ABSPATH . WPINC . '/formatting.php' );
                 wp_redirect( $link );
                 die();
         }
 }
 }}}

 After writing the above I see your last comment, and agree that this issue
 is really a duplicate.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14904#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list