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

Proulx François fproulx at edito.qc.ca
Mer 31 Aou 23:49:15 EDT 2005

URL encoding does not work in this case.

Quote from PHP.net :
(urlencode) Returns a string in which all non-alphanumeric characters  
except -_. have been replaced with a percent (%) sign followed by two  
hex digits and spaces encoded as plus (+) signs.

So, if there was a period it'll be left untouched by urlencode. The  
hash is thus needed to circumvent the problem.

On 31-Aug-2005, at 23:38 , Benoit Grégoire wrote:

>> 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
>> methods...
>> Benoit, what do you think of this solution ?
> I prefer the urlencode solution (it keeps the node_id somewhat  
> readable, and
> it's not longer to code), but I don't feel strongly either way.
> -- 
> Benoit Grégoire, http://benoitg.coeus.ca/

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

More information about the WiFiDog mailing list