PHP has a few "clever" and "helpful" features. For example, a posted hub.verify 
is accessed as $_POST['hub_verify']. Besides Jay's observation, it also munges 
the period character into an underscore during parsing. I believe it does the 
same thing for a few other characters. So yes, self implemented parsing is 
almost a given for protocols like Pubsubhubbub. Normal web apps design around 
all this by force of habit - it's surprising how many PHP developers aren't 
even aware it's a problem...

I really love PHP, but it can try even my patience sometimes ;).

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative





________________________________
From: Jay Rossiter <[email protected]>
To: "[email protected]" <[email protected]>
Sent: Mon, October 19, 2009 8:47:19 PM
Subject: [pubsubhubbub] Re: hub.verify - clarification on repeated  
keywords/parameters?

  On 10/19/2009 9:12 AM, Brett Slatkin wrote:

Python's CGI module will give you back a set of key/list pairs, with
>the values listed in the order they appeared in the string.
>Query-string encoding does enough variable munging that we shouldn't
>have to add yet another level of parsing on top of that, which is why
>we're going with #1. How hard is it to make this work right in PHP for
>clients?
>
    The issue with PHP is their inane refusal to natively support
repeated parameters.   Repeated parameters must be passed in an array
format.

    hub.verify[]=sync&hub.verify[]=async

    If passed in a normally specified way (hub.verify=&hub.verify=)
.. the latter parameters simply overwrite the former.  Variable
stomping.

    You have to fread "php://input" (the raw POST stream) and parse it
into variables on your own.



-- 


Jay Rossiter | Software
Engineer/System Administrator
Pioneering RSS Advertising
Solutions

[email protected] | Phone: 503.896.6187 | Fax: 503.235.2216
Website: www.pheedo.com | RSS: www.pheedo.info/index.xml

Reply via email to