Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#64 Rawheaders only taken into account at first request

open
nobody
None
5
2007-08-07
2007-08-07
Anonymous
No

Reason:

After looping through the array with "each()" the array pointer is at the end, so at second passage of this code piece the while loop stops immediately.

Solution:

Add

reset($this->rawheaders)

before the corresponding while loops in _httprequest() and _httpsrequest().

----
pmwikidev (at) sigproc DOT de

Discussion

  • Quietust
    Quietust
    2007-10-18

    Logged In: YES
    user_id=56060
    Originator: NO

    Alternatively, just don't use "while list()=each()" syntax - use foreach instead.

    Before:
    "while (list(,$a) = each($b))"
    "while (list($x,$y) = each($z))"

    After:
    "foreach ($b as $a)"
    "foreach ($z as $x => $y)"