[wp-trac] [WordPress Trac] #22639: Multisite in a subdirectory suggests the wrong location for .htaccess
WordPress Trac
noreply at wordpress.org
Sun Dec 2 22:30:22 UTC 2012
#22639: Multisite in a subdirectory suggests the wrong location for .htaccess
--------------------------+--------------------
Reporter: nacin | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.5
Component: Multisite | Version: trunk
Severity: normal | Resolution:
Keywords: |
--------------------------+--------------------
Comment (by evansolomon):
Replying to [comment:1 ryan]:
> When not running in a subdir, $wp_dir_from_root can be '/'. Thus, the
following code will remove all slashes from ABSPATH:
>
> {{{
> str_replace( $wp_dir_from_root, '', ABSPATH )
> }}}
Good catch. Maybe we should be a little more defensive even. In theory,
you could install WordPress in a path like
`/www/wordpress/public_html/wordpress/`, in which case just removing
`/wordpress` would actually break things. Maybe something like this.
{{{
preg_replace( '#' . preg_quote( $wp_dir_from_root ) . '$#', '', ABSPATH )
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22639#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list