OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug 62339] proxy-fcgi-pathinfo=unescape breaks PATH_INFO and SCRIPT_NAME


https://bz.apache.org/bugzilla/show_bug.cgi?id=62339

--- Comment #4 from Eric Covener <covener@xxxxxxxxx> ---
(In reply to Mathieu from comment #0)
> To get a PATH_INFO environment variable available to PHP-FPM, the doc
> http://httpd.apache.org/docs/current/mod/mod_proxy_fcgi.html#env says to add
> this line in the conf:
> 
>   SetEnvIf REQUEST_URI "^/.*\.php/.*$" proxy-fcgi-pathinfo
> 
> It does works for ASCII values in PATH_INFO:
>   /phpinfo.php/simple-path_info → PATH_INFO = /simple-path_info
> 
> However, for values containing spaces or non-ASCII values, it does urlencode
> them:
>   "/phpinfo.php/spaced path_info" → PATH_INFO="/spaced%20path_info"
>   "/phpinfo.php/é_accent" → PATH_INFO="/%C3%A9_accent"
> 
> So, as I need a PATH_INFO unescaped, and still according to the doc, I
> valued proxy-fcgi-pathinfo to "unescape":
>   SetEnvIf REQUEST_URI "^/.*\.php/.*$" proxy-fcgi-pathinfo=unescape

OK, this is coming back to me a little bit. I think these settings are intended
for non-FPM scenarios, IOW where no external component is trying to
second-guess/rewrite these variables.  It is hard to backtrack from the results
when FPM may be changing them on the fly. It's likely that FPM's fixups might
be confused by one of SCRIPT_NAME and PATH_INFO (and not both) shrinking due to
the unescape.

http://people.apache.org/~covener/fakefpm.pl was posted on an older bug and
allows you to dump the unconverted vars.

> 
> This does unescape, but it does break strings too:
>   "http://example.com/phpinfo.php/spaced path_info"
>   → PATH_INFO = hp/spaced path_info
>                 ^^ Why the last 2 chars of "/phpinfo.php" are here?
>   → SCRIPT_NAME = /var/www/html/phpinfo.p
>                                         ^^^ It's missing the above "hp".

Are they logged this way in the error_log or just in the script?  I couldn't
get this to happen with fpm and a basic config.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: bugs-help@xxxxxxxxxxxxxxxx