#21253 [Opn->Bgs]: strip_tags does not produce expected result with less than sign in link-text

From: Date: Sat, 28 Dec 2002 21:44:56 +0000
Subject: #21253 [Opn->Bgs]: strip_tags does not produce expected result with less than sign in link-text
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-28621@lists.php.net to get a copy of this message
ID: 21253 Updated by: pollita@php.net Reported By: pw0kt32001@sneakemail.com -Status: Open +Status: Bogus Bug Type: Strings related Operating System: Windows XP PHP Version: 4.3.0 New Comment: <a href=index.php?mode=item&id=382>Titan 120mm fan, <36dBa, 74.15CFM</a> The above is an improperly formatted SGML string (and by extension invalid HTML syntax). When using a "<" as printable text rather than an opening character to a tag the "&lt;" entity should be used. Without this convention, no parser (be it PHP or a web browser) can be certain if you intend for the "<" to be printed or if it is detoning an opening tag named "36dBa,". As I'm sure you're about to mention, many browsers WILL attempt to work with this broken syntax and display it when possible, but such shortcuts should not be counted on by any designer. The behavior of strip_tags which you descibe is the correct and expected behavior. Previous Comments: ------------------------------------------------------------------------ [2002-12-28 15:22:34] pw0kt32001@sneakemail.com The text after the "less than" sign is not returned in this example. print strip_tags("<a href=index.php?mode=item&id=382>Titan 120mm fan, <36dBa, 74.15CFM</a>"); My result is "Titan 120mm fan, " instead of expected "Titan 120mm fan, <36dBa, 74.15CFM" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21253&edit=1

« previous php.bugs (#28621) next »