[wp-trac] [WordPress Trac] #4971: use of PATH_TRANSLATED in wp-settings.php

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 13 23:09:17 GMT 2007


#4971: use of PATH_TRANSLATED in wp-settings.php
----------------------+-----------------------------------------------------
 Reporter:  aronbeal  |       Owner:  anonymous                       
     Type:  defect    |      Status:  new                             
 Priority:  normal    |   Milestone:  2.2.3                           
Component:  General   |     Version:  2.2.2                           
 Severity:  normal    |    Keywords:  PATH_TRANSLATED, wp-settings.php
----------------------+-----------------------------------------------------
 In the latest SVN tagged revision (2.2.2) (and earlier, I believe), the
 wp-settings.php file makes use of the $_SERVER variable
 '''PATH_TRANSLATED'''.  This variable seems to have been deprecated, as
 stated on the [http://us2.php.net/ini.core php.ini core directives] page.

 This is similar to a prior issue for a different file,
 [http://trac.wordpress.org/changeset/1995 posted] in the trac awhile back.

 This arises around line 40 in wp-settings.php on the copy I have; it
 should not have been modified since I checked it out from svn. It appears
 also in the latest subversion trunk revision (6110).

 The particular usage is to assign its value to the server value for
 '''SCRIPT_FILENAME''', even though php recommends explicitly using
 '''SCRIPT_FILENAME''' instead of '''PATH_TRANSLATED'''.

 Relevant code in wp-settings.php (starting at line 38, [whitespace
 modified]):
 {{{
 // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something
 // ending in php.cgi for all requests
 if ( isset($_SERVER['SCRIPT_FILENAME']) &&
      ( strpos($_SERVER['SCRIPT_FILENAME'], 'php.cgi') ==
        strlen($_SERVER['SCRIPT_FILENAME']) - 7 )
    )
         $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'];
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4971>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list