note 82180 added to function.strip-tags

From: Date: Sun, 30 Mar 2008 22:05:58 +0000
Subject: note 82180 added to function.strip-tags
Groups: php.notes 
Request: Send a blank email to php-notes+get-137774@lists.php.net to get a copy of this message
This adds alot of missing javascript events on the strip_tags_attributes() function from below entries. Props to MSDN for lots of them ;) <?php function strip_tags_attributes($sSource, $aAllowedTags = array(), $aDisabledAttributes = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavaible', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragdrop', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterupdate', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmoveout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload')) { if (empty($aDisabledAttributes)) return strip_tags($sSource, implode('', $aAllowedTags)); return preg_replace('/<(.*?)>/ie', "'<' . preg_replace(array('/javascript:[^\"\']*/i', '/(" . implode('|', $aDisabledAttributes) . ")[ \\t\\n]*=[ \\t\\n]*[\"\'][^\"\']*[\"\']/i', '/\s+/'), array('', '', ' '), stripslashes('\\1')) . '>'", strip_tags($sSource, implode('', $aAllowedTags))); } ?> ---- Server IP: 212.63.193.10 Probable Submitter: 81.216.205.138 ---- Manual Page -- http://www.php.net/manual/en/function.strip-tags.php Edit -- https://master.php.net/note/edit/82180 Del: integrated -- https://master.php.net/note/delete/82180/integrated Del: useless -- https://master.php.net/note/delete/82180/useless Del: bad code -- https://master.php.net/note/delete/82180/bad+code Del: spam -- https://master.php.net/note/delete/82180/spam Del: non-english -- https://master.php.net/note/delete/82180/non-english Del: in docs -- https://master.php.net/note/delete/82180/in+docs Del: other reasons-- https://master.php.net/note/delete/82180 Reject -- https://master.php.net/note/reject/82180 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#137774) next »