|
|||
|
Hi again, I have no problem in declaring allowed Tags but I have difficulties in declaring allowed Attributes in Zend_Filter_StripTags.
I use this code: Code:
$allowedTags = array( 'b','i','br','font' ); $allowedAttributes = array( 'size','face' ); $filter = new Zend_Filter_StripTags($allowedTags,$allowedAttributes); Code:
<font size="7" face="impact">foobar</font> Code:
<font>foobar</font> Any help about the rule in creating allowed Attributes and use it since I didn't find anywhere in the web. and by the way, I've tried HTMLPurifier and it can solve all my problem. But I just wanna do all the Zend way hehe... Thanks again! Last edited by Tommy1402 : 06-13-2007 at 09:13 AM. |
|
|||
|
Hi again...
I think I found problem. It's because the magic_quotes_gpc is On. But, if I add line php_flag magic_quotes_gpc Off in my .HTACCESS file, I got Internal Server Error. I google for it, then I found out that I have to put file PHP.INI in the same directory with my bootstrap file. It then displayed Code:
<font face="7">foobar</font> btw, I tried to insert malformed input like Code:
<font size="7 face="impact>test</font> Code:
<font>test</font> Last edited by Tommy1402 : 06-14-2007 at 03:52 AM. |
|
||||
|
Magic quotes strikes again
.Using a .htaccess does work - but not if you run PHP as a CGI process. Fortunately, magic_quotes just adds slashes. You can add a screening function to your bootstrap (something like below). PHP Code:
Last edited by Maugrim The Reaper : 06-14-2007 at 09:32 AM. Reason: missed a function! |
![]() |
| Thread Tools | |
| Display Modes | |
|
|