[isf-wifidog] Fixing the bug concerning ID containing periods
fproulx at edito.qc.ca
Mer 31 Aou 22:48:39 EDT 2005
I just remembered PHP auto-converts HTTP vars with periods and space
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
-------------- section suivante --------------
Une pièce jointe HTML a été enlevée...
More information about the WiFiDog