Make WordPress Core

Changeset 19697


Ignore:
Timestamp:
01/06/2012 01:46:22 PM (13 years ago)
Author:
dd32
Message:

Fix edge case in get_home_path() where the incorrect path may be returned. Props ptahdunbar. Fixes #18768

File:
1 edited

Legend:

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

    r19596 r19697  
    8282    if ( $home != '' && $home != $siteurl ) {
    8383        $wp_path_rel_to_home = str_replace($home, '', $siteurl); /* $siteurl - $home */
    84         $pos = strpos($_SERVER["SCRIPT_FILENAME"], $wp_path_rel_to_home);
     84        $pos = strrpos($_SERVER["SCRIPT_FILENAME"], $wp_path_rel_to_home);
    8585        $home_path = substr($_SERVER["SCRIPT_FILENAME"], 0, $pos);
    8686        $home_path = trailingslashit( $home_path );
Note: See TracChangeset for help on using the changeset viewer.