[PHPLIB-DEV] [Fwd: PHP-LIB potential bug] From: Kristian Köhntopp (kk <email protected>)
Date: 10/26/99

Will someone please look into this?

Busy,
        Kristian

-- 
Kristian Köhntopp, NetUSE Kommunikationstechnologie GmbH
Siemenswall, D-24107 Kiel, Germany, +49 431 386 436 00
Using PHP3? See our web development library at
http://phplib.netuse.de/ (We have moved! Update your bookmarks!)

attached mail follows:


Kristian,

Thanks for the great work of php-lib it has saved me a great deal of time developing web applications and provides a solid base to work from.

In using sessions I think I have come across a small bug within the add_query function of session.inc

Code is currently as follows...

function add_query($qarray) { global $PHP_SELF; global $QUERY_STRING;

if ((isset($QUERY_STRING) && ("" != $QUERY_STRING)) || ($this->mode == "get")) { $sep_char = "&"; } else { $sep_char = "?"; }

while (list($k, $v) = each($qarray)) { $qstring = $sep_char . urlencode($k) . "=" . urlencode($v); $sep_char = "&"; }

return $qstring; }

The problem with this is that the query string only ends up with the last item in the array being in the returned string.

I believe the following line...

$qstring = $sep_char . urlencode($k) . "=" . urlencode($v);

should be

$qstring = $qstring . $sep_char . urlencode($k) . "=" . urlencode($v);

Hope this is of some use. Please keep up the good work.

Regards Simon Hawkins

Velvet Software Limited.

______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com

- PHPLIB Developers Mailing List. Send messages to <phplib-dev <email protected>>. To unsubscribe, send "unsubscribe" to <phplib-dev-request <email protected>> in the body, not the subject, of your message.