Re: [fp-dev] [PATCH] proper use of htmlentities
Moved to GitHub: https://github.com/flatpressblog/flatpress
Brought to you by:
real_nowhereman
|
From: NoWhereMan <now...@fl...> - 2006-11-17 20:20:55
|
----- Original Message -----
From: "Naoki Hiroshima" <n...@h7...>
> NoWhereMan wrote:
>> wp_specialchars() work better?
> Ah, I didn't realize this function. Yes, this works better. But I have
> a question. What is the below for?
>
> $text = preg_replace('/&([^#])(?![a-z12]{1,8};)/', '&$1', $text);
it looks like a way to unescape sequences of entities... something like
that...
if it finds &entity; it won't change it into &entity; maybe... :P
so the whole code for that func should be ok...
>> The reason for this mess is an horrible horrible editor on Windows (which
>> once I used to love, SciTE) which was supposed to handle correctly line
>> ends.
>
> I was using xemacs when I used to work on Windows :-)
cool, let's start a flamewar about vim (I use vim) :D
> Another oneliner I would like to suggest is:
>
> $ find . \( -name "*.php" -o -name "*.tpl" \) | xargs perl -pi -e
> 's/<form /<form accept-charset="utf-8" /'
Is this really needed? I thought it would have better if the user agents
could figure it out theirselves from the page encoding. BTW if we really
drop other encs for utf... :/
I'm not sure...
bye
|