NYCPHP Meetup

[nycphp-talk] Bizarre PHP putenv/getenv results

csnyder chsnyder at gmail.com
Fri Aug 10 14:41:20 EDT 2007


On 8/9/07, Bob Klos <bklos at getoffutt.com> wrote:
>
> Occasionally, the  environment variables are corrupted,
> usually ending up with a blank page since  the app has
> no or corrupt information to work from.
>
> a simple example  would be:
>
> putenv("QUERY_STRING=$url");
> putenv("HTTP_COOKIE=$HTTP_COOKIE");
>

I have near-zero experience with putenv(), but my first impression on
looking at the code is that it looks like it will break if shell
metacharacters or anything other than low ascii is in the php vars.

Could there be stray newlines or some other characters in the values
that would cause breakage?

-- 
Chris Snyder
http://chxo.com/



More information about the talk mailing list