<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[19976] trunk/wp-includes/kses.php: Reduce memory usage in wp-includes/kses.php by switching unnecessary empty arrays to boolean.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/19976">19976</a></dd>
<dt>Author</dt> <dd>duck_</dd>
<dt>Date</dt> <dd>2012-02-21 20:33:44 +0000 (Tue, 21 Feb 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Reduce memory usage in wp-includes/kses.php by switching unnecessary empty arrays to boolean. Fixes <a href="http://core.trac.wordpress.org/ticket/20017">#20017</a>.

safecss_filter_attr() block for style tags must be moved out of the is_array() only branch of wp_kses_attr() to accommodate for this.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesksesphp">trunk/wp-includes/kses.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesksesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/kses.php (19975 => 19976)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/kses.php        2012-02-21 20:20:50 UTC (rev 19975)
+++ trunk/wp-includes/kses.php        2012-02-21 20:33:44 UTC (rev 19976)
</span><span class="lines">@@ -51,348 +51,390 @@
</span><span class="cx">         $allowedposttags = array(
</span><span class="cx">                 'address' =&gt; array(),
</span><span class="cx">                 'a' =&gt; array(
</span><del>-                        'class' =&gt; array (),
-                        'href' =&gt; array (),
-                        'id' =&gt; array (),
-                        'title' =&gt; array (),
-                        'rel' =&gt; array (),
-                        'rev' =&gt; array (),
-                        'name' =&gt; array (),
-                        'target' =&gt; array()),
</del><ins>+                        'class' =&gt; true,
+                        'href' =&gt; true,
+                        'id' =&gt; true,
+                        'title' =&gt; true,
+                        'rel' =&gt; true,
+                        'rev' =&gt; true,
+                        'name' =&gt; true,
+                        'target' =&gt; true,
+                ),
</ins><span class="cx">                 'abbr' =&gt; array(
</span><del>-                        'class' =&gt; array (),
-                        'title' =&gt; array ()),
</del><ins>+                        'class' =&gt; true,
+                        'title' =&gt; true,
+                ),
</ins><span class="cx">                 'acronym' =&gt; array(
</span><del>-                        'title' =&gt; array ()),
</del><ins>+                        'title' =&gt; true,
+                ),
</ins><span class="cx">                 'article' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'dir' =&gt; array (),
-                        'lang' =&gt; array(),
-                        'style' =&gt; array (),
-                        'xml:lang' =&gt; array(),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'lang' =&gt; true,
+                        'style' =&gt; true,
+                        'xml:lang' =&gt; true,
</ins><span class="cx">                 ),
</span><span class="cx">                 'aside' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'dir' =&gt; array (),
-                        'lang' =&gt; array(),
-                        'style' =&gt; array (),
-                        'xml:lang' =&gt; array(),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'lang' =&gt; true,
+                        'style' =&gt; true,
+                        'xml:lang' =&gt; true,
</ins><span class="cx">                 ),
</span><span class="cx">                 'b' =&gt; array(),
</span><span class="cx">                 'big' =&gt; array(),
</span><span class="cx">                 'blockquote' =&gt; array(
</span><del>-                        'id' =&gt; array (),
-                        'cite' =&gt; array (),
-                        'class' =&gt; array(),
-                        'lang' =&gt; array(),
-                        'xml:lang' =&gt; array()),
</del><ins>+                        'id' =&gt; true,
+                        'cite' =&gt; true,
+                        'class' =&gt; true,
+                        'lang' =&gt; true,
+                        'xml:lang' =&gt; true,
+                ),
</ins><span class="cx">                 'br' =&gt; array (
</span><del>-                        'class' =&gt; array ()),
</del><ins>+                        'class' =&gt; true,
+                ),
</ins><span class="cx">                 'button' =&gt; array(
</span><del>-                        'disabled' =&gt; array (),
-                        'name' =&gt; array (),
-                        'type' =&gt; array (),
-                        'value' =&gt; array ()),
</del><ins>+                        'disabled' =&gt; true,
+                        'name' =&gt; true,
+                        'type' =&gt; true,
+                        'value' =&gt; true,
+                ),
</ins><span class="cx">                 'caption' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                ),
</ins><span class="cx">                 'cite' =&gt; array (
</span><del>-                        'class' =&gt; array(),
-                        'dir' =&gt; array(),
-                        'lang' =&gt; array(),
-                        'title' =&gt; array ()),
</del><ins>+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'lang' =&gt; true,
+                        'title' =&gt; true,
+                ),
</ins><span class="cx">                 'code' =&gt; array (
</span><del>-                        'style' =&gt; array()),
</del><ins>+                        'style' =&gt; true,
+                ),
</ins><span class="cx">                 'col' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'char' =&gt; array (),
-                        'charoff' =&gt; array (),
-                        'span' =&gt; array (),
-                        'dir' =&gt; array(),
-                        'style' =&gt; array (),
-                        'valign' =&gt; array (),
-                        'width' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'char' =&gt; true,
+                        'charoff' =&gt; true,
+                        'span' =&gt; true,
+                        'dir' =&gt; true,
+                        'style' =&gt; true,
+                        'valign' =&gt; true,
+                        'width' =&gt; true,
+                ),
</ins><span class="cx">                 'del' =&gt; array(
</span><del>-                        'datetime' =&gt; array ()),
</del><ins>+                        'datetime' =&gt; true,
+                ),
</ins><span class="cx">                 'dd' =&gt; array(),
</span><span class="cx">                 'details' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'dir' =&gt; array (),
-                        'lang' =&gt; array(),
-                        'open' =&gt; array (),
-                        'style' =&gt; array (),
-                        'xml:lang' =&gt; array(),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'lang' =&gt; true,
+                        'open' =&gt; true,
+                        'style' =&gt; true,
+                        'xml:lang' =&gt; true,
</ins><span class="cx">                 ),
</span><span class="cx">                 'div' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'dir' =&gt; array (),
-                        'lang' =&gt; array(),
-                        'style' =&gt; array (),
-                        'xml:lang' =&gt; array()),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'lang' =&gt; true,
+                        'style' =&gt; true,
+                        'xml:lang' =&gt; true,
+                ),
</ins><span class="cx">                 'dl' =&gt; array(),
</span><span class="cx">                 'dt' =&gt; array(),
</span><span class="cx">                 'em' =&gt; array(),
</span><span class="cx">                 'fieldset' =&gt; array(),
</span><span class="cx">                 'figure' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'dir' =&gt; array (),
-                        'lang' =&gt; array(),
-                        'style' =&gt; array (),
-                        'xml:lang' =&gt; array(),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'lang' =&gt; true,
+                        'style' =&gt; true,
+                        'xml:lang' =&gt; true,
</ins><span class="cx">                 ),
</span><span class="cx">                 'figcaption' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'dir' =&gt; array (),
-                        'lang' =&gt; array(),
-                        'style' =&gt; array (),
-                        'xml:lang' =&gt; array(),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'lang' =&gt; true,
+                        'style' =&gt; true,
+                        'xml:lang' =&gt; true,
</ins><span class="cx">                 ),
</span><span class="cx">                 'font' =&gt; array(
</span><del>-                        'color' =&gt; array (),
-                        'face' =&gt; array (),
-                        'size' =&gt; array ()),
</del><ins>+                        'color' =&gt; true,
+                        'face' =&gt; true,
+                        'size' =&gt; true,
+                ),
</ins><span class="cx">                 'footer' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'dir' =&gt; array (),
-                        'lang' =&gt; array(),
-                        'style' =&gt; array (),
-                        'xml:lang' =&gt; array(),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'lang' =&gt; true,
+                        'style' =&gt; true,
+                        'xml:lang' =&gt; true,
</ins><span class="cx">                 ),
</span><span class="cx">                 'form' =&gt; array(
</span><del>-                        'action' =&gt; array (),
-                        'accept' =&gt; array (),
-                        'accept-charset' =&gt; array (),
-                        'enctype' =&gt; array (),
-                        'method' =&gt; array (),
-                        'name' =&gt; array (),
-                        'target' =&gt; array ()),
</del><ins>+                        'action' =&gt; true,
+                        'accept' =&gt; true,
+                        'accept-charset' =&gt; true,
+                        'enctype' =&gt; true,
+                        'method' =&gt; true,
+                        'name' =&gt; true,
+                        'target' =&gt; true,
+                ),
</ins><span class="cx">                 'h1' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'id'    =&gt; array (),
-                        'style' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'id'    =&gt; true,
+                        'style' =&gt; true,
+                ),
</ins><span class="cx">                 'h2' =&gt; array (
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'id'    =&gt; array (),
-                        'style' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'id'    =&gt; true,
+                        'style' =&gt; true,
+                ),
</ins><span class="cx">                 'h3' =&gt; array (
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'id'    =&gt; array (),
-                        'style' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'id'    =&gt; true,
+                        'style' =&gt; true,
+                ),
</ins><span class="cx">                 'h4' =&gt; array (
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'id'    =&gt; array (),
-                        'style' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'id'    =&gt; true,
+                        'style' =&gt; true,
+                ),
</ins><span class="cx">                 'h5' =&gt; array (
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'id'    =&gt; array (),
-                        'style' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'id'    =&gt; true,
+                        'style' =&gt; true,
+                ),
</ins><span class="cx">                 'h6' =&gt; array (
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'id'    =&gt; array (),
-                        'style' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'id'    =&gt; true,
+                        'style' =&gt; true,
+                ),
</ins><span class="cx">                 'header' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'dir' =&gt; array (),
-                        'lang' =&gt; array(),
-                        'style' =&gt; array (),
-                        'xml:lang' =&gt; array(),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'lang' =&gt; true,
+                        'style' =&gt; true,
+                        'xml:lang' =&gt; true,
</ins><span class="cx">                 ),
</span><span class="cx">                 'hgroup' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'dir' =&gt; array (),
-                        'lang' =&gt; array(),
-                        'style' =&gt; array (),
-                        'xml:lang' =&gt; array(),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'lang' =&gt; true,
+                        'style' =&gt; true,
+                        'xml:lang' =&gt; true,
</ins><span class="cx">                 ),
</span><span class="cx">                 'hr' =&gt; array (
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'noshade' =&gt; array (),
-                        'size' =&gt; array (),
-                        'width' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'noshade' =&gt; true,
+                        'size' =&gt; true,
+                        'width' =&gt; true,
+                ),
</ins><span class="cx">                 'i' =&gt; array(),
</span><span class="cx">                 'img' =&gt; array(
</span><del>-                        'alt' =&gt; array (),
-                        'align' =&gt; array (),
-                        'border' =&gt; array (),
-                        'class' =&gt; array (),
-                        'height' =&gt; array (),
-                        'hspace' =&gt; array (),
-                        'longdesc' =&gt; array (),
-                        'vspace' =&gt; array (),
-                        'src' =&gt; array (),
-                        'style' =&gt; array (),
-                        'width' =&gt; array ()),
</del><ins>+                        'alt' =&gt; true,
+                        'align' =&gt; true,
+                        'border' =&gt; true,
+                        'class' =&gt; true,
+                        'height' =&gt; true,
+                        'hspace' =&gt; true,
+                        'longdesc' =&gt; true,
+                        'vspace' =&gt; true,
+                        'src' =&gt; true,
+                        'style' =&gt; true,
+                        'width' =&gt; true,
+                ),
</ins><span class="cx">                 'ins' =&gt; array(
</span><del>-                        'datetime' =&gt; array (),
-                        'cite' =&gt; array ()),
</del><ins>+                        'datetime' =&gt; true,
+                        'cite' =&gt; true,
+                ),
</ins><span class="cx">                 'kbd' =&gt; array(),
</span><span class="cx">                 'label' =&gt; array(
</span><del>-                        'for' =&gt; array ()),
</del><ins>+                        'for' =&gt; true,
+                ),
</ins><span class="cx">                 'legend' =&gt; array(
</span><del>-                        'align' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                ),
</ins><span class="cx">                 'li' =&gt; array (
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                ),
</ins><span class="cx">                 'menu' =&gt; array (
</span><del>-                        'class' =&gt; array (),
-                        'style' =&gt; array (),
-                        'type' =&gt; array ()),
</del><ins>+                        'class' =&gt; true,
+                        'style' =&gt; true,
+                        'type' =&gt; true,
+                ),
</ins><span class="cx">                 'nav' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'dir' =&gt; array (),
-                        'lang' =&gt; array(),
-                        'style' =&gt; array (),
-                        'xml:lang' =&gt; array(),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'lang' =&gt; true,
+                        'style' =&gt; true,
+                        'xml:lang' =&gt; true,
</ins><span class="cx">                 ),
</span><span class="cx">                 'p' =&gt; array(
</span><del>-                        'class' =&gt; array (),
-                        'align' =&gt; array (),
-                        'dir' =&gt; array(),
-                        'lang' =&gt; array(),
-                        'style' =&gt; array (),
-                        'xml:lang' =&gt; array()),
</del><ins>+                        'class' =&gt; true,
+                        'align' =&gt; true,
+                        'dir' =&gt; true,
+                        'lang' =&gt; true,
+                        'style' =&gt; true,
+                        'xml:lang' =&gt; true,
+                ),
</ins><span class="cx">                 'pre' =&gt; array(
</span><del>-                        'style' =&gt; array(),
-                        'width' =&gt; array ()),
</del><ins>+                        'style' =&gt; true,
+                        'width' =&gt; true,
+                ),
</ins><span class="cx">                 'q' =&gt; array(
</span><del>-                        'cite' =&gt; array ()),
</del><ins>+                        'cite' =&gt; true,
+                ),
</ins><span class="cx">                 's' =&gt; array(),
</span><span class="cx">                 'span' =&gt; array (
</span><del>-                        'class' =&gt; array (),
-                        'dir' =&gt; array (),
-                        'align' =&gt; array (),
-                        'lang' =&gt; array (),
-                        'style' =&gt; array (),
-                        'title' =&gt; array (),
-                        'xml:lang' =&gt; array()),
</del><ins>+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'align' =&gt; true,
+                        'lang' =&gt; true,
+                        'style' =&gt; true,
+                        'title' =&gt; true,
+                        'xml:lang' =&gt; true,
+                ),
</ins><span class="cx">                 'section' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'dir' =&gt; array (),
-                        'lang' =&gt; array(),
-                        'style' =&gt; array (),
-                        'xml:lang' =&gt; array(),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'lang' =&gt; true,
+                        'style' =&gt; true,
+                        'xml:lang' =&gt; true,
</ins><span class="cx">                 ),
</span><span class="cx">                 'strike' =&gt; array(),
</span><span class="cx">                 'strong' =&gt; array(),
</span><span class="cx">                 'sub' =&gt; array(),
</span><span class="cx">                 'summary' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'class' =&gt; array (),
-                        'dir' =&gt; array (),
-                        'lang' =&gt; array(),
-                        'style' =&gt; array (),
-                        'xml:lang' =&gt; array(),
</del><ins>+                        'align' =&gt; true,
+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'lang' =&gt; true,
+                        'style' =&gt; true,
+                        'xml:lang' =&gt; true,
</ins><span class="cx">                 ),
</span><span class="cx">                 'sup' =&gt; array(),
</span><span class="cx">                 'table' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'bgcolor' =&gt; array (),
-                        'border' =&gt; array (),
-                        'cellpadding' =&gt; array (),
-                        'cellspacing' =&gt; array (),
-                        'class' =&gt; array (),
-                        'dir' =&gt; array(),
-                        'id' =&gt; array(),
-                        'rules' =&gt; array (),
-                        'style' =&gt; array (),
-                        'summary' =&gt; array (),
-                        'width' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'bgcolor' =&gt; true,
+                        'border' =&gt; true,
+                        'cellpadding' =&gt; true,
+                        'cellspacing' =&gt; true,
+                        'class' =&gt; true,
+                        'dir' =&gt; true,
+                        'id' =&gt; true,
+                        'rules' =&gt; true,
+                        'style' =&gt; true,
+                        'summary' =&gt; true,
+                        'width' =&gt; true,
+                ),
</ins><span class="cx">                 'tbody' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'char' =&gt; array (),
-                        'charoff' =&gt; array (),
-                        'valign' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'char' =&gt; true,
+                        'charoff' =&gt; true,
+                        'valign' =&gt; true,
+                ),
</ins><span class="cx">                 'td' =&gt; array(
</span><del>-                        'abbr' =&gt; array (),
-                        'align' =&gt; array (),
-                        'axis' =&gt; array (),
-                        'bgcolor' =&gt; array (),
-                        'char' =&gt; array (),
-                        'charoff' =&gt; array (),
-                        'class' =&gt; array (),
-                        'colspan' =&gt; array (),
-                        'dir' =&gt; array(),
-                        'headers' =&gt; array (),
-                        'height' =&gt; array (),
-                        'nowrap' =&gt; array (),
-                        'rowspan' =&gt; array (),
-                        'scope' =&gt; array (),
-                        'style' =&gt; array (),
-                        'valign' =&gt; array (),
-                        'width' =&gt; array ()),
</del><ins>+                        'abbr' =&gt; true,
+                        'align' =&gt; true,
+                        'axis' =&gt; true,
+                        'bgcolor' =&gt; true,
+                        'char' =&gt; true,
+                        'charoff' =&gt; true,
+                        'class' =&gt; true,
+                        'colspan' =&gt; true,
+                        'dir' =&gt; true,
+                        'headers' =&gt; true,
+                        'height' =&gt; true,
+                        'nowrap' =&gt; true,
+                        'rowspan' =&gt; true,
+                        'scope' =&gt; true,
+                        'style' =&gt; true,
+                        'valign' =&gt; true,
+                        'width' =&gt; true,
+                ),
</ins><span class="cx">                 'textarea' =&gt; array(
</span><del>-                        'cols' =&gt; array (),
-                        'rows' =&gt; array (),
-                        'disabled' =&gt; array (),
-                        'name' =&gt; array (),
-                        'readonly' =&gt; array ()),
</del><ins>+                        'cols' =&gt; true,
+                        'rows' =&gt; true,
+                        'disabled' =&gt; true,
+                        'name' =&gt; true,
+                        'readonly' =&gt; true,
+                ),
</ins><span class="cx">                 'tfoot' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'char' =&gt; array (),
-                        'class' =&gt; array (),
-                        'charoff' =&gt; array (),
-                        'valign' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'char' =&gt; true,
+                        'class' =&gt; true,
+                        'charoff' =&gt; true,
+                        'valign' =&gt; true,
+                ),
</ins><span class="cx">                 'th' =&gt; array(
</span><del>-                        'abbr' =&gt; array (),
-                        'align' =&gt; array (),
-                        'axis' =&gt; array (),
-                        'bgcolor' =&gt; array (),
-                        'char' =&gt; array (),
-                        'charoff' =&gt; array (),
-                        'class' =&gt; array (),
-                        'colspan' =&gt; array (),
-                        'headers' =&gt; array (),
-                        'height' =&gt; array (),
-                        'nowrap' =&gt; array (),
-                        'rowspan' =&gt; array (),
-                        'scope' =&gt; array (),
-                        'valign' =&gt; array (),
-                        'width' =&gt; array ()),
</del><ins>+                        'abbr' =&gt; true,
+                        'align' =&gt; true,
+                        'axis' =&gt; true,
+                        'bgcolor' =&gt; true,
+                        'char' =&gt; true,
+                        'charoff' =&gt; true,
+                        'class' =&gt; true,
+                        'colspan' =&gt; true,
+                        'headers' =&gt; true,
+                        'height' =&gt; true,
+                        'nowrap' =&gt; true,
+                        'rowspan' =&gt; true,
+                        'scope' =&gt; true,
+                        'valign' =&gt; true,
+                        'width' =&gt; true,
+                ),
</ins><span class="cx">                 'thead' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'char' =&gt; array (),
-                        'charoff' =&gt; array (),
-                        'class' =&gt; array (),
-                        'valign' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'char' =&gt; true,
+                        'charoff' =&gt; true,
+                        'class' =&gt; true,
+                        'valign' =&gt; true,
+                ),
</ins><span class="cx">                 'title' =&gt; array(),
</span><span class="cx">                 'tr' =&gt; array(
</span><del>-                        'align' =&gt; array (),
-                        'bgcolor' =&gt; array (),
-                        'char' =&gt; array (),
-                        'charoff' =&gt; array (),
-                        'class' =&gt; array (),
-                        'style' =&gt; array (),
-                        'valign' =&gt; array ()),
</del><ins>+                        'align' =&gt; true,
+                        'bgcolor' =&gt; true,
+                        'char' =&gt; true,
+                        'charoff' =&gt; true,
+                        'class' =&gt; true,
+                        'style' =&gt; true,
+                        'valign' =&gt; true,
+                ),
</ins><span class="cx">                 'tt' =&gt; array(),
</span><span class="cx">                 'u' =&gt; array(),
</span><span class="cx">                 'ul' =&gt; array (
</span><del>-                        'class' =&gt; array (),
-                        'style' =&gt; array (),
-                        'type' =&gt; array ()),
</del><ins>+                        'class' =&gt; true,
+                        'style' =&gt; true,
+                        'type' =&gt; true,
+                ),
</ins><span class="cx">                 'ol' =&gt; array (
</span><del>-                        'class' =&gt; array (),
-                        'start' =&gt; array (),
-                        'style' =&gt; array (),
-                        'type' =&gt; array ()),
-                'var' =&gt; array ());
</del><ins>+                        'class' =&gt; true,
+                        'start' =&gt; true,
+                        'style' =&gt; true,
+                        'type' =&gt; true,
+                ),
+                'var' =&gt; array(),
+        );
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * Kses allowed HTML elements.
</span><span class="lines">@@ -402,20 +444,25 @@
</span><span class="cx">          */
</span><span class="cx">         $allowedtags = array(
</span><span class="cx">                 'a' =&gt; array(
</span><del>-                        'href' =&gt; array (),
-                        'title' =&gt; array ()),
</del><ins>+                        'href' =&gt; true,
+                        'title' =&gt; true,
+                ),
</ins><span class="cx">                 'abbr' =&gt; array(
</span><del>-                        'title' =&gt; array ()),
</del><ins>+                        'title' =&gt; true,
+                ),
</ins><span class="cx">                 'acronym' =&gt; array(
</span><del>-                        'title' =&gt; array ()),
</del><ins>+                        'title' =&gt; true,
+                ),
</ins><span class="cx">                 'b' =&gt; array(),
</span><span class="cx">                 'blockquote' =&gt; array(
</span><del>-                        'cite' =&gt; array ()),
</del><ins>+                        'cite' =&gt; true,
+                ),
</ins><span class="cx">                 //        'br' =&gt; array(),
</span><del>-                'cite' =&gt; array (),
</del><ins>+                'cite' =&gt; array(),
</ins><span class="cx">                 'code' =&gt; array(),
</span><span class="cx">                 'del' =&gt; array(
</span><del>-                        'datetime' =&gt; array ()),
</del><ins>+                        'datetime' =&gt; true,
+                ),
</ins><span class="cx">                 //        'dd' =&gt; array(),
</span><span class="cx">                 //        'dl' =&gt; array(),
</span><span class="cx">                 //        'dt' =&gt; array(),
</span><span class="lines">@@ -425,7 +472,8 @@
</span><span class="cx">                 //        'ol' =&gt; array(),
</span><span class="cx">                 //        'p' =&gt; array(),
</span><span class="cx">                 'q' =&gt; array(
</span><del>-                        'cite' =&gt; array ()),
</del><ins>+                        'cite' =&gt; true,
+                ),
</ins><span class="cx">                 'strike' =&gt; array(),
</span><span class="cx">                 'strong' =&gt; array(),
</span><span class="cx">                 //        'sub' =&gt; array(),
</span><span class="lines">@@ -674,6 +722,17 @@
</span><span class="cx">                 if ( $current == '' )
</span><span class="cx">                         continue; # the attribute is not allowed
</span><span class="cx"> 
</span><ins>+                if ( strtolower( $arreach['name'] ) == 'style' ) {
+                        $orig_value = $arreach['value'];
+                        $value = safecss_filter_attr( $orig_value );
+
+                        if ( empty( $value ) )
+                                continue;
+
+                        $arreach['value'] = $value;
+                        $arreach['whole'] = str_replace( $orig_value, $value, $arreach['whole'] );
+                }
+
</ins><span class="cx">                 if ( ! is_array($current) ) {
</span><span class="cx">                         $attr2 .= ' '.$arreach['whole'];
</span><span class="cx">                 # there are no checks
</span><span class="lines">@@ -688,18 +747,7 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx"> 
</span><del>-                        if ( strtolower($arreach['name']) == 'style' ) {
-                                $orig_value = $arreach['value'];
-                                $value = safecss_filter_attr($orig_value);
-
-                                if ( empty($value) )
-                                        continue;
-
-                                $arreach['value'] = $value;
-                                $arreach['whole'] = str_replace($orig_value, $value, $arreach['whole']);
-                        }
-
-                        if ($ok)
</del><ins>+                        if ( $ok )
</ins><span class="cx">                                 $attr2 .= ' '.$arreach['whole']; # it passed them
</span><span class="cx">                 } # if !is_array($current)
</span><span class="cx">         } # foreach
</span></span></pre>
</div>
</div>

</body>
</html>