NYCPHP Meetup

NYPHP.org

[nycphp-talk] Bizarre PHP putenv/getenv results

Bob Klos bklos at getoffutt.com
Fri Aug 10 16:11:22 EDT 2007


I don't think that's the case because 9 times out of 10 the page loads. 
If you hit refresh a few times you'll catch the error, then refresh and
it'll work again. 

-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of csnyder
Sent: Friday, August 10, 2007 2:41 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Bizarre PHP putenv/getenv results

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/
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php






More information about the talk mailing list