#1591 closed defect (bug) (fixed)
The difference in $_SERVER['PATH_INFO']
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 1.6 |
Component: | General | Keywords: | cgi bg|has-patch bg|squashed bg|commit |
Focuses: | Cc: |
Description
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 </IfModule> # 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)
Change History (12)
#4
@
19 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 ) $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED']; if ( $_SERVER['PATH_INFO'] == $_SERVER['PHP_SELF'] ) unset($_SERVER['PATH_INFO']);
Fixes two problems with PHP as CGI on Dreamhost.
#7
@
19 years ago
- Milestone set to 1.6
- Owner changed from matt to markjaquith
- Status changed from reopened to new
Note: See
TracTickets for help on using
tickets.
(In [2852]) If PATH_INFO contains the index, don't use it for permalinks. Props gslin. fixes #1591