Bug #12860 Updated: problem with strip_tags()

From: Date: Mon, 20 Aug 2001 15:02:28 +0000
Subject: Bug #12860 Updated: problem with strip_tags()
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-63849@lists.php.net to get a copy of this message
ID: 12860 Updated by: swm Reported By: costrova@prdel.cz Old Status: Open Status: Feedback Bug Type: Strings related Operating System: Linux and Win PHP Version: 4.0.6 New Comment: This markup is not XHTML 1.0 compliant, from my readying. That is, I'm pretty sure <?xml ...> must be the first line of the document. This, however, is not the reason why strip_tags is failing. It is failing because it recognises '<?' (from <?xml ) as the beginning of PHP code - not xml. This presents problems with applying strip_tags to xhtml. The reason why this probably hasn't been picked up is that correct (??) XML declarations are of the form <?xml ... ?> - which should not contain anything to be out put anyway. If you/anyone can show that this is valid we can work around it (by demoting the PHP strip_tags state to an HTML state). Previous Comments: ------------------------------------------------------------------------ [2001-08-20 09:45:13] costrova@prdel.cz When I have text exported from MS Word to HTML where is "<?xml:namespace..." (see $string) and I want strip tags from it, I get text before it only. example: <? $string = <<<EOD <BODY><P class=MsoNormal><B><U>I am hungry<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /></U></B></P> <P class=MsoNormal>I am really hungry<o:p></o:p></SPAN></BODY> EOD; var_dump(strip_tags($string)); ?> output is: string(11) "I am hungry" ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=12860&edit=1

« previous php.dev (#63849) next »