WordPress.org

Make WordPress Core

Changeset 22800


Ignore:
Timestamp:
11/21/12 22:39:59 (17 months ago)
Author:
dd32
Message:

Correct get_home_path() for cases where WordPress is installed in a subdirectory called /wp/, previously it would match on /wp-admin instead of /wp causing an incorrect return path. Props SergeyBiryukov. Fixes #20449

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/file.php

    r22105 r22800  
    8484    if ( ! empty( $home ) && 0 !== strcasecmp( $home, $siteurl ) ) { 
    8585        $wp_path_rel_to_home = str_ireplace( $home, '', $siteurl ); /* $siteurl - $home */ 
    86         $pos = strripos( str_replace( '\\', '/', $_SERVER['SCRIPT_FILENAME'] ), $wp_path_rel_to_home); 
     86        $pos = strripos( str_replace( '\\', '/', $_SERVER['SCRIPT_FILENAME'] ), trailingslashit( $wp_path_rel_to_home ) ); 
    8787        $home_path = substr( $_SERVER['SCRIPT_FILENAME'], 0, $pos ); 
    8888        $home_path = trailingslashit( $home_path ); 
Note: See TracChangeset for help on using the changeset viewer.