[isf-wifidog] Fixing the bug concerning ID containing periods

Proulx François fproulx at edito.qc.ca
Mer 31 Aou 22:48:39 EDT 2005

Damn !

I just remembered PHP auto-converts HTTP vars with periods and space  
to underscores.

Quoted from : http://ca3.php.net/manual/en/faq.html.php#faq.html.form- 
Because foo.x and foo.y would make invalid variable names in PHP,  
they are automagically converted to foo_x and foo_y. That is, the  
periods are replaced with underscores. So, you'd access these  
variables like any other described within the section on retrieving  
variables from outside of PHP. For example, $_GET['foo_x'].

Note: Spaces in request variable names are converted to underscores.

So that means if a node_id (and the issue is only possible for node  
id since they are user-defined, other id are numeric or hash-based),  
an ID containing whitespaces, periods or underscores might confuse  
PHP... How should we treat this. Since this naming scheme is only  
used for making sure var names are unique... we could simply MD5 the  
node_id before concatenating it into the http var name ... since it's  
only used as a reference between getAdminUI and processAdminUI  

Benoit, what do you think of this solution ?

On 31-Aug-2005, at 22:35 , Proulx François wrote:

> I was investigating on the "bway.net" node ID bug that Dana  
> encountered. Solving this problem implies URL-encoding the node_id  
> before concatenating it for use as an HTTP form variable. This is  
> because HTTP does not allow variables to contain - _ or .    It is  
> quite trivial and I will fix it, right away.
> See ya
> _______________________________________________
> WiFiDog mailing list
> WiFiDog at listes.ilesansfil.org
> http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog

-------------- section suivante --------------
Une pièce jointe HTML a été enlevée...
URL: http://listes.ilesansfil.org/pipermail/wifidog/attachments/20050831/ad609457/attachment.html

More information about the WiFiDog mailing list