Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.10.1

Request #16510 HTML_Safe for PHP 5.3 strict
Submitted: 2009-08-10 23:12 UTC
From: demrit Assigned: demrit
Status: Closed Package: HTML_Safe (version SVN)
PHP Version: 5.3.0 OS: Any
Roadmaps: (Not assigned)    
Subscription  


 [2009-08-10 23:12 UTC] demrit (Miguel Vazquez Gocobachi)
Description: ------------ Now package have 5.3 E_STRICT support and allow tags has been added, using setAllowTags() method. Test script: --------------- $doc = '<html><body><p>my text</p></body></html>'; $safe = new HTML_Safe; $safe->setAllowTags(array('body')); $doc = $safe->parse($doc); Expected result: ---------------- <body><p>my text</p></body> Actual result: -------------- <p>my text</p>

Comments

 [2009-08-10 23:13 UTC] demrit (Miguel Vazquez Gocobachi)
The following patch has been added/updated: Patch Name: upgrade-support Revision: 1249927984 URL: http://pear.php.net/bugs/patch-display.php?bug=16510&patch=upgrade-support&revision=1249927984&display=1
 [2009-08-11 06:36 UTC] doconnor (Daniel O'Connor)
1) Avoid the use of private (protected is your friend) - it's harder to extend, test, etc. 2) Since things now have scope, we can lose the _ prefixes Ie, var $_listScope can become protected $listScope 3) Some of the things used to be public, ie: * @var array - * @access public */ - var $closeParagraph = array( + private $_closeParagraph = array( 'address', 'blockquote', 'center', 'dd', 'dir', 'div', 'dl', 'dt', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'isindex', 'listing', 'marquee', 'menu', 'multicol', 'ol', 'p', 'plaintext', 'pre', 'table', 'ul', 'xmp', - ); + ); 4) Oh dear, no one has put this in SVN.
 [2009-08-11 06:36 UTC] doconnor (Daniel O'Connor)
5) I don't suppose there's any chance of unit test coverage *before* you refactor, to catch any mistakes?
 [2009-08-11 06:39 UTC] doconnor (Daniel O'Connor)
Alrighty Miguel, I've added a copy of the last release to SVN. svn checkout http://svn.php.net/repository/pear/packages/HTML_Safe/trunk should work
 [2009-08-11 07:00 UTC] doconnor (Daniel O'Connor)
[287069] adds a stub of the allow tags method - test coverage too, but no actual implementation.
 [2009-08-11 13:17 UTC] demrit (Miguel Vazquez Gocobachi)
1) Avoid the use of private (protected is your friend) - it's harder to extend, test, etc. Agree and changed. Everything private has been moved to protected. 2) Since things now have scope, we can lose the _ prefixes Ie, var done 3) Some of the things used to be public, ie: hmm, i think it must be access by get/set methods, but for now it is ok. Everything handle has been changed from private to public because third party package requires (HTMLSax3). 4) Oh dear, no one has put this in SVN. Ah, well I have a patch again for the source that you provides. 5) I don't suppose there's any chance of unit test coverage *before* you refactor, to catch any mistakes? I will do it with my new code for stable version before. First it and use the current unit.
 [2009-08-11 13:18 UTC] demrit (Miguel Vazquez Gocobachi)
The following patch has been added/updated: Patch Name: 53support Revision: 1249978696 URL: http://pear.php.net/bugs/patch-display.php?bug=16510&patch=53support&revision=1249978696&display=1
 [2009-08-24 12:37 UTC] demrit (Miguel Vazquez Gocobachi)
-Assigned To: +Assigned To: demrit
 [2009-10-23 04:55 UTC] demrit (Miguel Vazquez Gocobachi)
-Status: Assigned +Status: Closed -Package Version: CVS +Package Version: SVN
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Patch has been added.