[wp-trac] [WordPress Trac] #11120: Issue with ABSPATH already defined

WordPress Trac wp-trac at lists.automattic.com
Wed Dec 30 03:13:02 UTC 2009


#11120: Issue with ABSPATH already defined
--------------------------+-------------------------------------------------
 Reporter:  ontic         |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:  2.8.5     
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
Changes (by mikeschinkel):

 * cc: mikeschinkel@… (added)


Comment:

 I've run into the same problem and need the same fix.

 @dd32 I think your justification for why it shouldn't be fixed is flawed,
 at least in some cases.   Just because he chose to use a poorly selected
 expression to get the $root doesn't make this patch any less valid.

 I'm trying to load admin.php prior to calling any bootstrap code and for
 that I need to know the root directory in ABSPATH, for that I'm using:

 {{{
 define('ABSPATH',$_SERVER['DOCUMENT_ROOT'] .'/');
 }}}

 I believe this is a patch that is needed, especially considering how it is
 inconsistent when the code in admin.php that presumes that ABSPATH may
 already be defined and then precedes to call wp-load.php that assumes
 ABSPATH was not predefined.

 The patch provided by @ontic is simple and can't cause an unexpected bug
 unless someone is doing something that would cause an error already.

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


More information about the wp-trac mailing list