Bugs item #450749, was opened at 2001-08-14 02:48
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=403611&aid=450749&group_id=31885
Category: None
Group: None
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Richard Archer (richardarcher)
Assigned to: Richard Archer (richardarcher)
Summary: possible prob in session.inc/add_query()
Initial Comment:
reposted from mailing list...
I really can't see this being a *real* problem after
all this time, but the code hasn't changed so we should
double-check. The logic in that function looks pretty
dodgy to me.
At 11:53 AM +0100 9/2/00, Detlev Wagner wrote:
>The add_query() function produces URLs like
>filename.php3&var1=123&var2=abc when used together
with the purl()
>function while in cookie mode. I think this is caused
by the if-clause
>of the function, which should not read (like now):
> if ((isset($QUERY_STRING) && ("" != $QUERY_STRING))
> || ($this->mode == "get")) {
> ....}
>but:
> if ((isset($QUERY_STRING) && ("" != $QUERY_STRING)) &&
>(!($this->mode == "cookie"))
> || ($this->mode == "get")) {
> ....}
>This doesn't affect the use of the function in get
mode (fallback) and
>it works properly in cookie mode, too.
>phplib version 7.2 used.
>
>Detlev
----------------------------------------------------------------------
>Comment By: Richard Archer (richardarcher)
Date: 2001-08-18 01:56
Message:
Logged In: YES
user_id=279311
The docs say: Intended usage is like this:
<a href="<<?
$sess->pself_url().$sess->padd_query(array("again"=>"yes"))
?>"> Reload</a> and log in?
Apart from the typo, this makes it clear that the function
is not necessarily intended to work with the purl function.
The ay it works is that if there is an existing
QUERY_STRING, add_url() expects self_url() to have already
ouput it. So it uses & as the sepchar and adds the extra
vars onto the end.
If add_query() is called after purl() and with a value in
QUERY_STRING, add_query() assumes QUERY_STRING has been
output, so uses & as sepchar. In fact purl() won't have
output the QUERY_STRING, so add_query() does the wrong thing.
Another problem with add_query() is that it can't be called
twice. If called a second time with nothing in QUERY_STRING,
a ? will erroneously be used as the sepchar again. If you
need multiple added query strings, add_query must be called
with all these values in $qarray.
There needs to be a series of methods that allow query
strings to be added to arbitrary URLs.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=403611&aid=450749&group_id=31885
|