Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#1591 closed defect (bug) (fixed)

The difference in $_SERVER['PATH_INFO']

Reported by: gslin Owned by: markjaquith
Milestone: Priority: normal
Severity: normal Version: 1.6
Component: General Keywords: cgi bg|has-patch bg|squashed bg|commit
Focuses: Cc:


I run WordPress 1.6-ALPHA2-still-dont-use in DreamHost, it's default PHP setting is CGI mode (php-cgi) and I perfer this mode for security reason.

If I enable permlinks with "Custom structure" and then WordPress will write the following rules in .htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
# END WordPress

In mod_php mode $_SERVERPATH_INFO? will be NULL, and in php-cgi mode it will be '/index.php' (by .htaccess).

The attachment patches classes.php to check if $pathinfo is index.php.

Attachments (2)

classes-php.diff (450 bytes) - added by gslin 16 years ago.
wp-settings.php.diff (746 bytes) - added by markjaquith 16 years ago.
Patch for WP 1.6 SVN

Download all attachments as: .zip

Change History (12)

16 years ago

#1 @gslin
16 years ago

  • Keywords cgi added
  • Owner changed from anonymous to matt

#2 @markjaquith
16 years ago

  • Keywords bg|has-patch added

#3 @ryan
16 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [2852]) If PATH_INFO contains the index, don't use it for permalinks. Props gslin. fixes #1591

#4 @markjaquith
16 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

This is still the problem. this was my solution:

if ( strpos($_SERVER['SCRIPT_FILENAME'], 'php.cgi') == strlen($_SERVER['SCRIPT_FILENAME']) - 7 )

Fixes two problems with PHP as CGI on Dreamhost.

16 years ago

Patch for WP 1.6 SVN

#5 @markjaquith
16 years ago

Make that "This is still a problem"

#6 @markjaquith
16 years ago

  • Keywords bg|squashed bg|commit added

#7 @markjaquith
16 years ago

  • Milestone set to 1.6
  • Owner changed from matt to markjaquith
  • Status changed from reopened to new

#8 @markjaquith
16 years ago

  • Status changed from new to assigned

#9 @matt
16 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [3034]) Fixes #1591 (again)

#10 @(none)
15 years ago

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.