[fpc-pascal] fpWeb and html and uri escaping/unescapingelements

ik idokan at gmail.com
Wed May 25 09:21:57 CEST 2011


On Wed, May 25, 2011 at 10:09, Ludo Brands <ludo.brands at free.fr> wrote:

>  You should not unescape recursively.
> Input to EscapeHTML: '<' Output: '&lt;' : Correct
> UnescapeHTML: input  '&lt;' Output '<'   Wrong.
> This is because you replace '&' with '&' resulting in '<' which is
> translated to '< ' in the next line.
>

So you suggest to place the & translation last.


>
> Ludo
>
>
>
>  -----Message d'origine-----
> *De :* fpc-pascal-bounces at lists.freepascal.org [mailto:
> fpc-pascal-bounces at lists.freepascal.org] *De la part de* ik
> *Envoyé :* mercredi 25 mai 2011 08:34
> *À :* FPC-Pascal users discussions
> *Objet :* Re: Re[2]: [fpc-pascal] fpWeb and html and uri
> escaping/unescapingelements
>
>
>
>
> On Tue, May 24, 2011 at 12:21, José Mejuto <joshyfun at gmail.com> wrote:
>
>> Hello FPC-Pascal,
>>
>> Tuesday, May 24, 2011, 10:09:03 AM, you wrote:
>>
>> i> I've created a patch with the Escape and unEscape functions, and place
>> it
>> i> here: http://bugs.freepascal.org/view.php?id=19407
>>
>> Un/escapeHTML parsing must be in one go, specially the "&amp" one. Test
>> against:
>>
>> "&lt;"
>>
>
> I'm not sure what you mean here.
>
> If you have already html entities you should not escape them. If you do not
> have html entities you should escape them.
> The Escaping and unescaping works well, I already tested them before I sent
> them.
>
>
>
>>
>> Right unescape "<", your code "<".
>>
>> --
>> Best regards,
>>  José
>>
>
> Ido
>
>
>>
>> _______________________________________________
>> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>
>
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110525/e4ca5667/attachment.html>


More information about the fpc-pascal mailing list