Odd problem with compose ...

Chris chris@jeks.net
Thu, 18 Jan 2001 16:04:17 -0800


Just had a real odd one with the compose window. Tried different versions
of PHP before settling on digging through IMP code ... it's been a while ;o)

Found a weird on with the IMP::composeLink code.

It puts arguments into the URL even if there are no values. i.e. constructing
a url like:

compose.php?to=&subject=&etcetc

This would screw up my PHP session, meaning compose couldn't login. Once this
happened the session would be deleted, so trying to send would result in the
login screen coming up in the compose window. Any further action in the main 
window would lead to the logout screen because the session is now gone.

Tried a quick hack:

changed ...

    foreach ($args as $key => $val) {
	$key = urlencode($key);
	$val = urlencode($val);
	$params .= "$key=$val&";
    }

to ...

    foreach ($args as $key => $val) {
	$key = urlencode($key);
	$val = urlencode($val);
	if ($val) {
		$params .= "$key=$val&";
	}
    }

.. and this took care of it.

Any comments on why this code should screw my sessions at the mo? Anyone else
have this?

Tried latest CVS of PHP, and 4.0.4pl1 ... IMP code is straight out of CVS.

 Chris

-- 
~ ~ ~
Chris Hyde

In the beginning the Universe was created. This has made a lot of
people very angry and been widely regarded as a bad move... HHG

~ ~ ~