[wp-trac] [WordPress Trac] #23073: Wrong RewriteRule in a local Multisite installation

WordPress Trac noreply at wordpress.org
Thu Jan 3 22:50:41 UTC 2013


#23073: Wrong RewriteRule in a local Multisite installation
--------------------------------------------+--------------------
 Reporter:  Guy_fr                          |       Owner:
     Type:  defect (bug)                    |      Status:  new
 Priority:  normal                          |   Milestone:  3.5.1
Component:  Multisite                       |     Version:  3.5
 Severity:  normal                          |  Resolution:
 Keywords:  dev-feedback reporter-feedback  |
--------------------------------------------+--------------------

Comment (by guy_fr):

 Replying to [comment:12 Rarst]:
 > Hit same issue. This is not caused by symlink in my case, but by where
 data is taken from - causing separator mismatch that makes
 `$wp_dir_from_root  = preg_replace( '#^' . preg_quote(
 $_SERVER['DOCUMENT_ROOT'], '#' ) . '#', '', ABSPATH );` replacement
 produce incorrect result (absolute path).
 >
 >  - `ABSPATH` is defined as `dirname(__FILE__)` which is generated by PHP
 >  - `$_SERVER['DOCUMENT_ROOT']` seems to be taken verbatim from Apache
 configuration
 >
 > Naturally there is no guarantee that the two use the same separator
 convention. Can't even rely on OS to determine which one Apache config
 uses since it can be typed in freeform.
 >
 > So either data needs to come from compatible sources or separators need
 to be force equalized before running replacement.


 That is right, and I think the better fix would be to change all ABSPATH
 definitions to ensure separators are the same everywhere, better than only
 change in one place as I described previously. Something like that:
 {{{
 define( 'ABSPATH', preg_replace('/\\\\/', '/', dirname(__FILE__) . '/'));
 }}}

 but.... ABSPATH is used in so many places that it could be "dangerous" to
 modify that.

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


More information about the wp-trac mailing list