Iagree with this approach. On the formpage, tell the user that the field must non-accented alphanumeric, andany other characters will be stripped out. Justlike the thousands of username and password fields throughout theinternet have certain restrictions. Leave it on theuser to enter the info correctly. Then just run Donovan's grep routineto make sure it's clean. If you try toaccommodate every possible character someone will throw at you, you'llsurely miss something.
Terry
On Mon, 15 Feb 2010 13:16:07 -0600
DonovanBrooke <dbrooke@euca.us> wrote:
> Lawrence wrote:
>> hi,
>> here is myproblem...
>> I need to create folders on the server using a name the
>>clients save
>>through a form. Then clients upload images, and the
>>Imagemagick make its
>> manipulations. (noproblem yet)
>> My problem is if people use non ASCII caracters like :
>>=C3=A9=C3=A0=C3=AF or<spaces>
>> Because then [MOVEFILE] won't process, so neither
>>Imagemagik...
>>
>> So I created a database to convert chars
>> =C3=A0=3Da; =C3=AF=3Di; =C3=A9=3De
>> but when I apply the asciiconvert I get very strange
>>character back
>> like : i=EF=BF=BDi=EF=BF=BDi=EF=BF=BDi=EF=BF=BD
>> I use UTF8 encoding inthe pages and the same for the
>>database.
>> I tried to append the name of the folder in the db
>>replacing the non
>> ascii characters
>> ®ate_url=3D[ConvertChars
>>db=3D^ascii.db][Nom_regate][/ConvertChars]
>> but instead of =C3=AF=C3=B4=C3=A9=C3=A0 I have in the db:i=EF=BF==BDi=EF=BF=BDi=EF=BF=BDi=EF=BF=BD and I
>>would like ioea...
>>
>> I found a solution using [grep] but it's not very clean,
>>and I need to
>> apply plenty of [grep] for each kind of character...
>>
>> Asany body got an idea of what can be wrong or any
>>other solution...
>> Thanks
>>Lawrence
>
> what about simply something like:
>
> [grep search=3D[^A-Za-z_-]&replace=3D][fnames][/grep]
>
>For cleaning your input.
> Donovan
>
> --
> Donovan Brooke
> Euca DesignCenter
> [Practical-Ethical-Efficient]
> ww=w.euca.us
> egg.bz
> artglass-forum.com
>---------------------------------------------------------
> This message is sent to you because you are subscribed
>to
> the mailing list <talk@webdna.us>.
> To unsubscribe, E-mail to:&=lt;talk-leave@webdna.us>
> archives: http://mail.webdna.us/list/talk@webdna.us=
> old archives:http://dev.webdna.us/TalkListArchive/
> Bug Reporting:
>http://forum.webdna.us/eucabb.=html?page=3Dtopics&category=3D288
=C2=A0
|
Iagree with this approach. On the formpage, tell the user that the field must non-accented alphanumeric, andany other characters will be stripped out. Justlike the thousands of username and password fields throughout theinternet have certain restrictions. Leave it on theuser to enter the info correctly. Then just run Donovan's grep routineto make sure it's clean. If you try toaccommodate every possible character someone will throw at you, you'llsurely miss something.
Terry
On Mon, 15 Feb 2010 13:16:07 -0600
DonovanBrooke <dbrooke@euca.us> wrote:
> Lawrence wrote:
>> hi,
>> here is myproblem...
>> I need to create folders on the server using a name the
>>clients save
>>through a form. Then clients upload images, and the
>>Imagemagick make its
>> manipulations. (noproblem yet)
>> My problem is if people use non ASCII caracters like :
>>=C3=A9=C3=A0=C3=AF or<spaces>
>> Because then [movefile] won't process, so neither
>>Imagemagik...
>>
>> So I created a database to convert chars
>> =C3=A0=3Da; =C3=AF=3Di; =C3=A9=3De
>> but when I apply the asciiconvert I get very strange
>>character back
>> like : i=EF=BF=BDi=EF=BF=BDi=EF=BF=BDi=EF=BF=BD
>> I use UTF8 encoding inthe pages and the same for the
>>database.
>> I tried to append the name of the folder in the db
>>replacing the non
>> ascii characters
>> ®ate_url=3D[ConvertChars
>>db=3D^ascii.db][Nom_regate][/ConvertChars]
>> but instead of =C3=AF=C3=B4=C3=A9=C3=A0 I have in the db:i=EF=BF==BDi=EF=BF=BDi=EF=BF=BDi=EF=BF=BD and I
>>would like ioea...
>>
>> I found a solution using [grep] but it's not very clean,
>>and I need to
>> apply plenty of [grep] for each kind of character...
>>
>> Asany body got an idea of what can be wrong or any
>>other solution...
>> Thanks
>>Lawrence
>
> what about simply something like:
>
> [grep search=3D[^A-Za-z_-]&replace=3D][fnames][/grep]
>
>For cleaning your input.
> Donovan
>
> --
> Donovan Brooke
> Euca DesignCenter
> [Practical-Ethical-Efficient]
> ww=w.euca.us
> egg.bz
> artglass-forum.com
>---------------------------------------------------------
> This message is sent to you because you are subscribed
>to
> the mailing list <talk@webdna.us>.
> To unsubscribe, E-mail to:&=lt;talk-leave@webdna.us>
> archives: http://mail.webdna.us/list/talk@webdna.us=
> old archives:http://dev.webdna.us/TalkListArchive/
> Bug Reporting:
>http://forum.webdna.us/eucabb.=html?page=3Dtopics&category=3D288
=C2=A0
DOWNLOAD WEBDNA NOW!
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...