Re: note 8373 added to htmlspecialchars
| From: | J. M. Castagnetto | Date: | Fri, 08 Sep 2000 23:01:52 +0000 |
| Subject: | Re: note 8373 added to htmlspecialchars | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-4576@lists.php.net to get a copy of this message | ||
Jon,
--- Rasmus Lerdorf <rasmus@linuxcare.com> wrote:
> htmlspecialchars() in 4.0.2 does translate '
>
> This change has however been reverted because it
> broke too many existing
> apps. We either need a separate function or an
> optional second argument
> to enable this.
>
> -Rasmus
>
> On Fri, 8 Sep 2000, Jon Ribbens wrote:
>
> > "J. M. Castagnetto" <jcastagnetto@yahoo.com>
> wrote:
> > > Not really. You can use addslashes if you need
> to do that.
> >
> > What on earth are you talking about? addslashes
> would not have any useful
If what you want is to get the single quote entity,
why not just use htmlentities()? Then you will not
have a problem, unless of course you do want to use
htmlentities() to fix bad HTML, and if so and it is a
bunch of files that were already made, just run tidy
on them (www.w3c.org).
Having the single quote entity will be a nicety for
fixing old/bad HTML, or when dealing w/ XML w/ a
strict DTD, othewise I do not see the point.
> > effect whatsoever. Backslashes are not relevant to
> HTML.
The text in your previous note said (verbatim):
...
NOTE: To be entirely correct, this function should
escape the "'"
character also.
To get this functionality, use:
str_replace("'", "'", htmlspecialchars($foo))
...
Escaping a char is not the same as translating it to
its equivalent entity.
> >
> > > Your note has been deleted.
> >
> > I have added it again. Do not delete it again
> until you understand it.
Explain to me more clearly why is this such an
important need, perhaps I am missing something that
you did (or did not) mention in your previous note.
Perhaps Rasmus understood something I did not, and I
will really like to understand.
=====
--- Jesus M. Castagnetto (jcastagnetto@yahoo.com)
__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/