<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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 #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#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>
<title>[12317] trunk: Fix errors when bulk actions executed on empty list,
  props nacin, see #11184</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12317">12317</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2009-12-03 01:43:49 +0000 (Thu, 03 Dec 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix errors when bulk actions executed on empty list, props nacin, see <a href="http://trac.wordpress.org/ticket/11184">#11184</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincategoriesphp">trunk/wp-admin/categories.php</a></li>
<li><a href="#trunkwpadmineditlinkcategoriesphp">trunk/wp-admin/edit-link-categories.php</a></li>
<li><a href="#trunkwpadminedittagsphp">trunk/wp-admin/edit-tags.php</a></li>
<li><a href="#trunkwpadminjsinlineeditpostdevjs">trunk/wp-admin/js/inline-edit-post.dev.js</a></li>
<li><a href="#trunkwpadminjsinlineeditpostjs">trunk/wp-admin/js/inline-edit-post.js</a></li>
<li><a href="#trunkwpadminlinkmanagerphp">trunk/wp-admin/link-manager.php</a></li>
<li><a href="#trunkwpadminpluginsphp">trunk/wp-admin/plugins.php</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincategoriesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/categories.php (12316 => 12317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/categories.php        2009-12-02 18:00:32 UTC (rev 12316)
+++ trunk/wp-admin/categories.php        2009-12-03 01:43:49 UTC (rev 12317)
</span><span class="lines">@@ -34,17 +34,20 @@
</span><span class="cx"> break;
</span><span class="cx"> 
</span><span class="cx"> case 'delete':
</span><ins>+        if ( !isset( $_GET['cat_ID'] ) ) {
+                wp_redirect('categories.php');
+                exit;
+        }
+
</ins><span class="cx">         $cat_ID = (int) $_GET['cat_ID'];
</span><span class="cx">         check_admin_referer('delete-category_' .  $cat_ID);
</span><span class="cx"> 
</span><span class="cx">         if ( !current_user_can('manage_categories') )
</span><span class="cx">                 wp_die(__('Cheatin&amp;#8217; uh?'));
</span><span class="cx"> 
</span><del>-        $cat_name = get_cat_name($cat_ID);
-
</del><span class="cx">         // Don't delete the default cats.
</span><span class="cx">         if ( $cat_ID == get_option('default_category') )
</span><del>-                wp_die(sprintf(__(&quot;Can&amp;#8217;t delete the &lt;strong&gt;%s&lt;/strong&gt; category: this is the default one&quot;), $cat_name));
</del><ins>+                wp_die( sprintf( __(&quot;Can&amp;#8217;t delete the &lt;strong&gt;%s&lt;/strong&gt; category: this is the default one&quot;), get_cat_name($cat_ID) ) );
</ins><span class="cx"> 
</span><span class="cx">         wp_delete_category($cat_ID);
</span><span class="cx"> 
</span><span class="lines">@@ -59,18 +62,20 @@
</span><span class="cx">         if ( !current_user_can('manage_categories') )
</span><span class="cx">                 wp_die( __('You are not allowed to delete categories.') );
</span><span class="cx"> 
</span><del>-        foreach ( (array) $_GET['delete'] as $cat_ID ) {
-                $cat_name = get_cat_name($cat_ID);
</del><ins>+        $cats = (array) $_GET['delete'];
+        $default_cat = get_option('default_category');
+        foreach ( $cats as $cat_ID ) {
+                $cat_ID = (int) $cat_ID;
</ins><span class="cx"> 
</span><del>-                // Don't delete the default cats.
-                if ( $cat_ID == get_option('default_category') )
-                        wp_die(sprintf(__(&quot;Can&amp;#8217;t delete the &lt;strong&gt;%s&lt;/strong&gt; category: this is the default one&quot;), $cat_name));
</del><ins>+                // Don't delete the default cat.
+                if ( $cat_ID == $default_cat )
+                        wp_die( sprintf( __(&quot;Can&amp;#8217;t delete the &lt;strong&gt;%s&lt;/strong&gt; category: this is the default one&quot;), get_cat_name($cat_ID) ) );
</ins><span class="cx"> 
</span><span class="cx">                 wp_delete_category($cat_ID);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         wp_safe_redirect( wp_get_referer() );
</span><del>-        exit();
</del><ins>+        exit;
</ins><span class="cx"> 
</span><span class="cx"> break;
</span><span class="cx"> case 'edit':
</span></span></pre></div>
<a id="trunkwpadmineditlinkcategoriesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-link-categories.php (12316 => 12317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-link-categories.php        2009-12-02 18:00:32 UTC (rev 12316)
+++ trunk/wp-admin/edit-link-categories.php        2009-12-03 01:43:49 UTC (rev 12317)
</span><span class="lines">@@ -18,13 +18,14 @@
</span><span class="cx">                 wp_die(__('Cheatin&amp;#8217; uh?'));
</span><span class="cx"> 
</span><span class="cx">         if ( 'delete' == $doaction ) {
</span><del>-                foreach( (array) $_GET['delete'] as $cat_ID ) {
-                        $cat_name = get_term_field('name', $cat_ID, 'link_category');
-                        $default_cat_id = get_option('default_link_category');
</del><ins>+                $cats = (array) $_GET['delete'];
+                $default_cat_id = get_option('default_link_category');
</ins><span class="cx"> 
</span><ins>+                foreach( $cats as $cat_ID ) {
+                        $cat_ID = (int) $cat_ID;
</ins><span class="cx">                         // Don't delete the default cats.
</span><span class="cx">                         if ( $cat_ID == $default_cat_id )
</span><del>-                                wp_die(sprintf(__(&quot;Can&amp;#8217;t delete the &lt;strong&gt;%s&lt;/strong&gt; category: this is the default one&quot;), $cat_name));
</del><ins>+                                wp_die( sprintf( __(&quot;Can&amp;#8217;t delete the &lt;strong&gt;%s&lt;/strong&gt; category: this is the default one&quot;), get_term_field('name', $cat_ID, 'link_category') ) );
</ins><span class="cx"> 
</span><span class="cx">                         wp_delete_term($cat_ID, 'link_category', array('default' =&gt; $default_cat_id));
</span><span class="cx">                 }
</span></span></pre></div>
<a id="trunkwpadminedittagsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-tags.php (12316 => 12317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-tags.php        2009-12-02 18:00:32 UTC (rev 12316)
+++ trunk/wp-admin/edit-tags.php        2009-12-03 01:43:49 UTC (rev 12317)
</span><span class="lines">@@ -44,6 +44,11 @@
</span><span class="cx"> break;
</span><span class="cx"> 
</span><span class="cx"> case 'delete':
</span><ins>+        if ( !isset( $_GET['tag_ID'] ) ) {
+                wp_redirect(&quot;edit-tags.php?taxonomy=$taxonomy&quot;);
+                exit;
+        }
+
</ins><span class="cx">         $tag_ID = (int) $_GET['tag_ID'];
</span><span class="cx">         check_admin_referer('delete-tag_' .  $tag_ID);
</span><span class="cx"> 
</span><span class="lines">@@ -70,8 +75,8 @@
</span><span class="cx">         if ( !current_user_can('manage_categories') )
</span><span class="cx">                 wp_die(__('Cheatin&amp;#8217; uh?'));
</span><span class="cx"> 
</span><del>-        $tags = $_GET['delete_tags'];
-        foreach( (array) $tags as $tag_ID ) {
</del><ins>+        $tags = (array) $_GET['delete_tags'];
+        foreach( $tags as $tag_ID ) {
</ins><span class="cx">                 wp_delete_term( $tag_ID, $taxonomy);
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminjsinlineeditpostdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/inline-edit-post.dev.js (12316 => 12317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/inline-edit-post.dev.js        2009-12-02 18:00:32 UTC (rev 12316)
+++ trunk/wp-admin/js/inline-edit-post.dev.js        2009-12-03 01:43:49 UTC (rev 12317)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">         },
</span><span class="cx"> 
</span><span class="cx">         setBulk : function() {
</span><del>-                var te = '', type = this.type, tax;
</del><ins>+                var te = '', type = this.type, tax, c = true;
</ins><span class="cx">                 this.revert();
</span><span class="cx"> 
</span><span class="cx">                 $('#bulk-edit td').attr('colspan', $('.widefat:first thead th:visible').length);
</span><span class="lines">@@ -83,12 +83,16 @@
</span><span class="cx"> 
</span><span class="cx">                 $('tbody th.check-column input[type=&quot;checkbox&quot;]').each(function(i){
</span><span class="cx">                         if ( $(this).attr('checked') ) {
</span><ins>+                                c = false;
</ins><span class="cx">                                 var id = $(this).val(), theTitle;
</span><span class="cx">                                 theTitle = $('#inline_'+id+' .post_title').text() || inlineEditL10n.notitle;
</span><span class="cx">                                 te += '&lt;div id=&quot;ttle'+id+'&quot;&gt;&lt;a id=&quot;_'+id+'&quot; class=&quot;ntdelbutton&quot; title=&quot;'+inlineEditL10n.ntdeltitle+'&quot;&gt;X&lt;/a&gt;'+theTitle+'&lt;/div&gt;';
</span><span class="cx">                         }
</span><span class="cx">                 });
</span><span class="cx"> 
</span><ins>+                if ( c )
+                        return this.revert();
+
</ins><span class="cx">                 $('#bulk-titles').html(te);
</span><span class="cx">                 $('#bulk-titles a').click(function() {
</span><span class="cx">                         var id = $(this).attr('id').substr(1);
</span></span></pre></div>
<a id="trunkwpadminjsinlineeditpostjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/inline-edit-post.js (12316 => 12317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/inline-edit-post.js        2009-12-02 18:00:32 UTC (rev 12316)
+++ trunk/wp-admin/js/inline-edit-post.js        2009-12-03 01:43:49 UTC (rev 12317)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(function($){inlineEditPost={init:function(){var t=this,qeRow=$(&quot;#inline-edit&quot;),bulkRow=$(&quot;#bulk-edit&quot;);t.type=$(&quot;table.widefat&quot;).hasClass(&quot;page&quot;)?&quot;page&quot;:&quot;post&quot;;t.what=&quot;#&quot;+t.type+&quot;-&quot;;qeRow.keyup(function(e){if(e.which==27){return inlineEditPost.revert()}});bulkRow.keyup(function(e){if(e.which==27){return inlineEditPost.revert()}});$(&quot;a.cancel&quot;,qeRow).click(function(){return inlineEditPost.revert()});$(&quot;a.save&quot;,qeRow).click(function(){return inlineEditPost.save(this)});$(&quot;td&quot;,qeRow).keydown(function(e){if(e.which==13){return inlineEditPost.save(this)}});$(&quot;a.cancel&quot;,bulkRow).click(function(){return inlineEditPost.revert()});$(&quot;#inline-edit .inline-edit-private input[value=private]&quot;).click(function(){var pw=$(&quot;input.inline-edit-password-input&quot;);if($(this).attr(&quot;checked&quot;)){pw.val(&quot;&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;)}else{pw.attr(&quot;disabled&quot;,&quot;&quot;)}});$(&quot;a.editinline&quot;).live(&quot;click&quot;,function(){inlineEditPost.edit(this);return false});$(&quot;#bulk-title-div&quot;).parents(&quot;fieldset&quot;).after($(&quot;#inline-edit fieldset.inline-edit-categories&quot;).clone()).siblings(&quot;fieldset:last&quot;).prepend($(&quot;#inline-edit label.inline-edit-tags&quot;).clone());$(&quot;span.catshow&quot;).click(function(){$(&quot;.inline-editor ul.cat-checklist&quot;).addClass(&quot;cat-hover&quot;);$(&quot;.inline-editor span.cathide&quot;).show();$(this).hide()});$(&quot;span.cathide&quot;).click(function(){$(&quot;.inline-editor ul.cat-checklist&quot;).removeClass(&quot;cat-hover&quot;);$(&quot;.inline-editor span.catshow&quot;).show();$(this).hide()});$('select[name=&quot;_status&quot;] option[value=&quot;future&quot;]',bulkRow).remove();$(&quot;#doaction, #doaction2&quot;).click(function(e){var n=$(this).attr(&quot;id&quot;).substr(2);if($('select[name=&quot;'+n+'&quot;]').val()==&quot;edit&quot;){e.preventDefault();t.setBulk()}else{if($(&quot;form#posts-filter tr.inline-editor&quot;).length&gt;0){t.revert()}}});$(&quot;#post-query-submit&quot;).click(function(e){if($(&quot;form#posts-filter tr.inline-editor&quot;).length&gt;0){t.revert()}})},toggle:function(el){var t=this;$(t.what+t.getId(el)).css(&quot;display&quot;)==&quot;none&quot;?t.revert():t.edit(el)},setBulk:function(){var te=&quot;&quot;,type=this.type,tax;this.revert();$(&quot;#bulk-edit td&quot;).attr(&quot;colspan&quot;,$(&quot;.widefat:first thead th:visible&quot;).length);$(&quot;table.widefat tbody&quot;).prepend($(&quot;#bulk-edit&quot;));$(&quot;#bulk-edit&quot;).addClass(&quot;inline-editor&quot;).show();$('tbody th.check-column input[type=&quot;checkbox&quot;]').each(function(i){if($(this).attr(&quot;checked&quot;)){var id=$(this).val(),theTitle;theTitle=$(&quot;#inline_&quot;+id+&quot; .post_title&quot;).text()||inlineEditL10n.notitle;te+='&lt;div id=&quot;ttle'+id+'&quot;&gt;&lt;a id=&quot;_'+id+'&quot; class=&quot;ntdelbutton&quot; title=&quot;'+inlineEditL10n.ntdeltitle+'&quot;&gt;X&lt;/a&gt;'+theTitle+&quot;&lt;/div&gt;&quot;}});$(&quot;#bulk-titles&quot;).html(te);$(&quot;#bulk-titles a&quot;).click(function(){var id=$(this).attr(&quot;id&quot;).substr(1);$('table.widefat input[value=&quot;'+id+'&quot;]').attr(&quot;checked&quot;,&quot;&quot;);$(&quot;#ttle&quot;+id).remove()});if(type==&quot;post&quot;){tax=&quot;post_tag&quot;;$('tr.inline-editor textarea[name=&quot;tags_input&quot;]').suggest(&quot;admin-ajax.php?action=ajax-tag-search&amp;tax=&quot;+tax,{delay:500,minchars:2,multiple:true,multipleSep:&quot;, &quot;})}},edit:function(id){var t=this,fields,editRow,rowData,cats,status,pageOpt,f,pageLevel,nextPage,pageLoop=true,nextLevel,tax;t.revert();if(typeof(id)==&quot;object&quot;){id=t.getId(id)}fields=[&quot;post_title&quot;,&quot;post_name&quot;,&quot;post_author&quot;,&quot;_status&quot;,&quot;jj&quot;,&quot;mm&quot;,&quot;aa&quot;,&quot;hh&quot;,&quot;mn&quot;,&quot;ss&quot;,&quot;post_password&quot;];if(t.type==&quot;page&quot;){fields.push(&quot;post_parent&quot;,&quot;menu_order&quot;,&quot;page_template&quot;)}if(t.type==&quot;post&quot;){fields.push(&quot;tags_input&quot;)}editRow=$(&quot;#inline-edit&quot;).clone(true);$(&quot;td&quot;,editRow).attr(&quot;colspan&quot;,$(&quot;.widefat:first thead th:visible&quot;).length);if($(t.what+id).hasClass(&quot;alternate&quot;)){$(editRow).addClass(&quot;alternate&quot;)}$(t.what+id).hide().after(editRow);rowData=$(&quot;#inline_&quot;+id);if(!$(':input[name=&quot;post_author&quot;] option[value='+$(&quot;.post_author&quot;,rowData).text()+&quot;]&quot;,editRow).val()){$(':input[name=&quot;post_author&quot;]',editRow).prepend('&lt;option value=&quot;'+$(&quot;.post_author&quot;,rowData).text()+'&quot;&gt;'+$(&quot;#&quot;+t.type+&quot;-&quot;+id+&quot; .author&quot;).text()+&quot;&lt;/option&gt;&quot;)}for(f=0;f&lt;fields.length;f++){$(':input[name=&quot;'+fields[f]+'&quot;]',editRow).val($(&quot;.&quot;+fields[f],rowData).text())}if($(&quot;.comment_status&quot;,rowData).text()==&quot;open&quot;){$('input[name=&quot;comment_status&quot;]',editRow).attr(&quot;checked&quot;,&quot;checked&quot;)}if($(&quot;.ping_status&quot;,rowData).text()==&quot;open&quot;){$('input[name=&quot;ping_status&quot;]',editRow).attr(&quot;checked&quot;,&quot;checked&quot;)}if($(&quot;.sticky&quot;,rowData).text()==&quot;sticky&quot;){$('input[name=&quot;sticky&quot;]',editRow).attr(&quot;checked&quot;,&quot;checked&quot;)}if(cats=$(&quot;.post_category&quot;,rowData).text()){$(&quot;ul.cat-checklist :checkbox&quot;,editRow).val(cats.split(&quot;,&quot;))}status=$(&quot;._status&quot;,rowData).text();if(status!=&quot;future&quot;){$('select[name=&quot;_status&quot;] option[value=&quot;future&quot;]',editRow).remove()}if(status==&quot;private&quot;){$('input[name=&quot;keep_private&quot;]',editRow).attr(&quot;checked&quot;,&quot;checked&quot;);$(&quot;input.inline-edit-password-input&quot;).val(&quot;&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;)}pageOpt=$('select[name=&quot;post_parent&quot;] option[value=&quot;'+id+'&quot;]',editRow);if(pageOpt.length&gt;0){pageLevel=pageOpt[0].className.split(&quot;-&quot;)[1];nextPage=pageOpt;while(pageLoop){nextPage=nextPage.next(&quot;option&quot;);if(nextPage.length==0){break}nextLevel=nextPage[0].className.split(&quot;-&quot;)[1];if(nextLevel&lt;=pageLevel){pageLoop=false}else{nextPage.remove();nextPage=pageOpt}}pageOpt.remove()}$(editRow).attr(&quot;id&quot;,&quot;edit-&quot;+id).addClass(&quot;inline-editor&quot;).show();$(&quot;.ptitle&quot;,editRow).focus();if(t.type==&quot;post&quot;){tax=&quot;post_tag&quot;;$('tr.inline-editor textarea[name=&quot;tags_input&quot;]').suggest(&quot;admin-ajax.php?action=ajax-tag-search&amp;tax=&quot;+tax,{delay:500,minchars:2,multiple:true,multipleSep:&quot;, &quot;})}return false},save:function(id){var params,fields,page=$(&quot;.post_status_page&quot;).val()||&quot;&quot;;if(typeof(id)==&quot;object&quot;){id=this.getId(id)}$(&quot;table.widefat .inline-edit-save .waiting&quot;).show();params={action:&quot;inline-save&quot;,post_type:this.type,post_ID:id,edit_date:&quot;true&quot;,post_status:page};fields=$(&quot;#edit-&quot;+id+&quot; :input&quot;).serialize();params=fields+&quot;&amp;&quot;+$.param(params);$.post(&quot;admin-ajax.php&quot;,params,function(r){$(&quot;table.widefat .inline-edit-save .waiting&quot;).hide();if(r){if(-1!=r.indexOf(&quot;&lt;tr&quot;)){$(inlineEditPost.what+id).remove();$(&quot;#edit-&quot;+id).before(r).remove();$(inlineEditPost.what+id).hide().fadeIn()}else{r=r.replace(/&lt;.[^&lt;&gt;]*?&gt;/g,&quot;&quot;);$(&quot;#edit-&quot;+id+&quot; .inline-edit-save&quot;).append('&lt;span class=&quot;error&quot;&gt;'+r+&quot;&lt;/span&gt;&quot;)}}else{$(&quot;#edit-&quot;+id+&quot; .inline-edit-save&quot;).append('&lt;span class=&quot;error&quot;&gt;'+inlineEditL10n.error+&quot;&lt;/span&gt;&quot;)}},&quot;html&quot;);return false},revert:function(){var id;if(id=$(&quot;table.widefat tr.inline-editor&quot;).attr(&quot;id&quot;)){$(&quot;table.widefat .inline-edit-save .waiting&quot;).hide();if(&quot;bulk-edit&quot;==id){$(&quot;table.widefat #bulk-edit&quot;).removeClass(&quot;inline-editor&quot;).hide();$(&quot;#bulk-titles&quot;).html(&quot;&quot;);$(&quot;#inlineedit&quot;).append($(&quot;#bulk-edit&quot;))}else{$(&quot;#&quot;+id).remove();id=id.substr(id.lastIndexOf(&quot;-&quot;)+1);$(this.what+id).show()}}return false},getId:function(o){var id=o.tagName==&quot;TR&quot;?o.id:$(o).parents(&quot;tr&quot;).attr(&quot;id&quot;),parts=id.split(&quot;-&quot;);return parts[parts.length-1]}};$(document).ready(function(){inlineEditPost.init()})})(jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+(function(a){inlineEditPost={init:function(){var c=this,d=a(&quot;#inline-edit&quot;),b=a(&quot;#bulk-edit&quot;);c.type=a(&quot;table.widefat&quot;).hasClass(&quot;page&quot;)?&quot;page&quot;:&quot;post&quot;;c.what=&quot;#&quot;+c.type+&quot;-&quot;;d.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});b.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});a(&quot;a.cancel&quot;,d).click(function(){return inlineEditPost.revert()});a(&quot;a.save&quot;,d).click(function(){return inlineEditPost.save(this)});a(&quot;td&quot;,d).keydown(function(f){if(f.which==13){return inlineEditPost.save(this)}});a(&quot;a.cancel&quot;,b).click(function(){return inlineEditPost.revert()});a(&quot;#inline-edit .inline-edit-private input[value=private]&quot;).click(function(){var e=a(&quot;input.inline-edit-password-input&quot;);if(a(this).attr(&quot;checked&quot;)){e.val(&quot;&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;)}else{e.attr(&quot;disabled&quot;,&quot;&quot;)}});a(&quot;a.editinline&quot;).live(&quot;click&quot;,function(){inlineEditPost.edit(this);return false});a(&quot;#bulk-title-div&quot;).parents(&quot;fieldset&quot;).after(a(&quot;#inline-edit fieldset.inline-edit-categories&quot;).clone()).siblings(&quot;fieldset:last&quot;).prepend(a(&quot;#inline-edit label.inline-edit-tags&quot;).clone());a(&quot;span.catshow&quot;).click(function(){a(&quot;.inline-editor ul.cat-checklist&quot;).addClass(&quot;cat-hover&quot;);a(&quot;.inline-editor span.cathide&quot;).show();a(this).hide()});a(&quot;span.cathide&quot;).click(function(){a(&quot;.inline-editor ul.cat-checklist&quot;).removeClass(&quot;cat-hover&quot;);a(&quot;.inline-editor span.catshow&quot;).show();a(this).hide()});a('select[name=&quot;_status&quot;] option[value=&quot;future&quot;]',b).remove();a(&quot;#doaction, #doaction2&quot;).click(function(f){var g=a(this).attr(&quot;id&quot;).substr(2);if(a('select[name=&quot;'+g+'&quot;]').val()==&quot;edit&quot;){f.preventDefault();c.setBulk()}else{if(a(&quot;form#posts-filter tr.inline-editor&quot;).length&gt;0){c.revert()}}});a(&quot;#post-query-submit&quot;).click(function(f){if(a(&quot;form#posts-filter tr.inline-editor&quot;).length&gt;0){c.revert()}})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css(&quot;display&quot;)==&quot;none&quot;?b.revert():b.edit(c)},setBulk:function(){var e=&quot;&quot;,d=this.type,b,f=true;this.revert();a(&quot;#bulk-edit td&quot;).attr(&quot;colspan&quot;,a(&quot;.widefat:first thead th:visible&quot;).length);a(&quot;table.widefat tbody&quot;).prepend(a(&quot;#bulk-edit&quot;));a(&quot;#bulk-edit&quot;).addClass(&quot;inline-editor&quot;).show();a('tbody th.check-column input[type=&quot;checkbox&quot;]').each(function(g){if(a(this).attr(&quot;checked&quot;)){f=false;var h=a(this).val(),c;c=a(&quot;#inline_&quot;+h+&quot; .post_title&quot;).text()||inlineEditL10n.notitle;e+='&lt;div id=&quot;ttle'+h+'&quot;&gt;&lt;a id=&quot;_'+h+'&quot; class=&quot;ntdelbutton&quot; title=&quot;'+inlineEditL10n.ntdeltitle+'&quot;&gt;X&lt;/a&gt;'+c+&quot;&lt;/div&gt;&quot;}});if(f){return this.revert()}a(&quot;#bulk-titles&quot;).html(e);a(&quot;#bulk-titles a&quot;).click(function(){var c=a(this).attr(&quot;id&quot;).substr(1);a('table.widefat input[value=&quot;'+c+'&quot;]').attr(&quot;checked&quot;,&quot;&quot;);a(&quot;#ttle&quot;+c).remove()});if(d==&quot;post&quot;){b=&quot;post_tag&quot;;a('tr.inline-editor textarea[name=&quot;tags_input&quot;]').suggest(&quot;admin-ajax.php?action=ajax-tag-search&amp;tax=&quot;+b,{delay:500,minchars:2,multiple:true,multipleSep:&quot;, &quot;})}},edit:function(b){var o=this,j,d,g,n,i,h,k,m,l,c=true,p,e;o.revert();if(typeof(b)==&quot;object&quot;){b=o.getId(b)}j=[&quot;post_title&quot;,&quot;post_name&quot;,&quot;post_author&quot;,&quot;_status&quot;,&quot;jj&quot;,&quot;mm&quot;,&quot;aa&quot;,&quot;hh&quot;,&quot;mn&quot;,&quot;ss&quot;,&quot;post_password&quot;];if(o.type==&quot;page&quot;){j.push(&quot;post_parent&quot;,&quot;menu_order&quot;,&quot;page_template&quot;)}if(o.type==&quot;post&quot;){j.push(&quot;tags_input&quot;)}d=a(&quot;#inline-edit&quot;).clone(true);a(&quot;td&quot;,d).attr(&quot;colspan&quot;,a(&quot;.widefat:first thead th:visible&quot;).length);if(a(o.what+b).hasClass(&quot;alternate&quot;)){a(d).addClass(&quot;alternate&quot;)}a(o.what+b).hide().after(d);g=a(&quot;#inline_&quot;+b);if(!a(':input[name=&quot;post_author&quot;] option[value='+a(&quot;.post_author&quot;,g).text()+&quot;]&quot;,d).val()){a(':input[name=&quot;post_author&quot;]',d).prepend('&lt;option value=&quot;'+a(&quot;.post_author&quot;,g).text()+'&quot;&gt;'+a(&quot;#&quot;+o.type+&quot;-&quot;+b+&quot; .author&quot;).text()+&quot;&lt;/option&gt;&quot;)}for(k=0;k&lt;j.length;k++){a(':input[name=&quot;'+j[k]+'&quot;]',d).val(a(&quot;.&quot;+j[k],g).text())}if(a(&quot;.comment_status&quot;,g).text()==&quot;open&quot;){a('input[name=&quot;comment_status&quot;]',d).attr(&quot;checked&quot;,&quot;checked&quot;)}if(a(&quot;.ping_status&quot;,g).text()==&quot;open&quot;){a('input[name=&quot;ping_status&quot;]',d).attr(&quot;checked&quot;,&quot;checked&quot;)}if(a(&quot;.sticky&quot;,g).text()==&quot;sticky&quot;){a('input[name=&quot;sticky&quot;]',d).attr(&quot;checked&quot;,&quot;checked&quot;)}if(n=a(&quot;.post_category&quot;,g).text()){a(&quot;ul.cat-checklist :checkbox&quot;,d).val(n.split(&quot;,&quot;))}i=a(&quot;._status&quot;,g).text();if(i!=&quot;future&quot;){a('select[name=&quot;_status&quot;] option[value=&quot;future&quot;]',d).remove()}if(i==&quot;private&quot;){a('input[name=&quot;keep_private&quot;]',d).attr(&quot;checked&quot;,&quot;checked&quot;);a(&quot;input.inline-edit-password-input&quot;).val(&quot;&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;)}h=a('select[name=&quot;post_parent&quot;] option[value=&quot;'+b+'&quot;]',d);if(h.length&gt;0){m=h[0].className.split(&quot;-&quot;)[1];l=h;while(c){l=l.next(&quot;option&quot;);if(l.length==0){break}p=l[0].className.split(&quot;-&quot;)[1];if(p&lt;=m){c=false}else{l.remove();l=h}}h.remove()}a(d).attr(&quot;id&quot;,&quot;edit-&quot;+b).addClass(&quot;inline-editor&quot;).show();a(&quot;.ptitle&quot;,d).focus();if(o.type==&quot;post&quot;){e=&quot;post_tag&quot;;a('tr.inline-editor textarea[name=&quot;tags_input&quot;]').suggest(&quot;admin-ajax.php?action=ajax-tag-search&amp;tax=&quot;+e,{delay:500,minchars:2,multiple:true,multipleSep:&quot;, &quot;})}return false},save:function(e){var d,b,c=a(&quot;.post_status_page&quot;).val()||&quot;&quot;;if(typeof(e)==&quot;object&quot;){e=this.getId(e)}a(&quot;table.widefat .inline-edit-save .waiting&quot;).show();d={action:&quot;inline-save&quot;,post_type:this.type,post_ID:e,edit_date:&quot;true&quot;,post_status:c};b=a(&quot;#edit-&quot;+e+&quot; :input&quot;).serialize();d=b+&quot;&amp;&quot;+a.param(d);a.post(&quot;admin-ajax.php&quot;,d,function(f){a(&quot;table.widefat .inline-edit-save .waiting&quot;).hide();if(f){if(-1!=f.indexOf(&quot;&lt;tr&quot;)){a(inlineEditPost.what+e).remove();a(&quot;#edit-&quot;+e).before(f).remove();a(inlineEditPost.what+e).hide().fadeIn()}else{f=f.replace(/&lt;.[^&lt;&gt;]*?&gt;/g,&quot;&quot;);a(&quot;#edit-&quot;+e+&quot; .inline-edit-save&quot;).append('&lt;span class=&quot;error&quot;&gt;'+f+&quot;&lt;/span&gt;&quot;)}}else{a(&quot;#edit-&quot;+e+&quot; .inline-edit-save&quot;).append('&lt;span class=&quot;error&quot;&gt;'+inlineEditL10n.error+&quot;&lt;/span&gt;&quot;)}},&quot;html&quot;);return false},revert:function(){var b;if(b=a(&quot;table.widefat tr.inline-editor&quot;).attr(&quot;id&quot;)){a(&quot;table.widefat .inline-edit-save .waiting&quot;).hide();if(&quot;bulk-edit&quot;==b){a(&quot;table.widefat #bulk-edit&quot;).removeClass(&quot;inline-editor&quot;).hide();a(&quot;#bulk-titles&quot;).html(&quot;&quot;);a(&quot;#inlineedit&quot;).append(a(&quot;#bulk-edit&quot;))}else{a(&quot;#&quot;+b).remove();b=b.substr(b.lastIndexOf(&quot;-&quot;)+1);a(this.what+b).show()}}return false},getId:function(c){var d=c.tagName==&quot;TR&quot;?c.id:a(c).parents(&quot;tr&quot;).attr(&quot;id&quot;),b=d.split(&quot;-&quot;);return b[b.length-1]}};a(document).ready(function(){inlineEditPost.init()})})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminlinkmanagerphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/link-manager.php (12316 => 12317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/link-manager.php        2009-12-02 18:00:32 UTC (rev 12316)
+++ trunk/wp-admin/link-manager.php        2009-12-03 01:43:49 UTC (rev 12317)
</span><span class="lines">@@ -18,13 +18,14 @@
</span><span class="cx">                 wp_die( __('You do not have sufficient permissions to edit the links for this blog.') );
</span><span class="cx"> 
</span><span class="cx">         if ( 'delete' == $doaction ) {
</span><del>-                foreach ( (array) $_GET['linkcheck'] as $link_id ) {
</del><ins>+                $bulklinks = (array) $_GET['linkcheck'];
+                foreach ( $bulklinks as $link_id ) {
</ins><span class="cx">                         $link_id = (int) $link_id;
</span><span class="cx"> 
</span><span class="cx">                         wp_delete_link($link_id);
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                wp_redirect( wp_get_referer() );
</del><ins>+                wp_safe_redirect( wp_get_referer() );
</ins><span class="cx">                 exit;
</span><span class="cx">         }
</span><span class="cx"> } elseif ( isset($_GET['_wp_http_referer']) &amp;&amp; ! empty($_GET['_wp_http_referer']) ) {
</span></span></pre></div>
<a id="trunkwpadminpluginsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/plugins.php (12316 => 12317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/plugins.php        2009-12-02 18:00:32 UTC (rev 12316)
+++ trunk/wp-admin/plugins.php        2009-12-03 01:43:49 UTC (rev 12317)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> 
</span><span class="cx">                         check_admin_referer('bulk-manage-plugins');
</span><span class="cx"> 
</span><del>-                        $plugins = (array) $_POST['checked'];
</del><ins>+                        $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
</ins><span class="cx">                         $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Only activate plugins which are not already active.
</span><span class="cx">                         if ( empty($plugins) ) {
</span><span class="cx">                                 wp_redirect(&quot;plugins.php?plugin_status=$status&amp;paged=$page&quot;);
</span><span class="lines">@@ -115,7 +115,7 @@
</span><span class="cx"> 
</span><span class="cx">                         check_admin_referer('bulk-manage-plugins');
</span><span class="cx"> 
</span><del>-                        $plugins = (array) $_POST['checked'];
</del><ins>+                        $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
</ins><span class="cx">                         $plugins = array_filter($plugins, 'is_plugin_active'); //Do not deactivate plugins which are already deactivated.
</span><span class="cx">                         if ( empty($plugins) ) {
</span><span class="cx">                                 wp_redirect(&quot;plugins.php?plugin_status=$status&amp;paged=$page&quot;);
</span><span class="lines">@@ -138,7 +138,8 @@
</span><span class="cx"> 
</span><span class="cx">                         check_admin_referer('bulk-manage-plugins');
</span><span class="cx"> 
</span><del>-                        $plugins = (array) $_REQUEST['checked']; //$_POST = from the plugin form; $_GET = from the FTP details screen.
</del><ins>+                        //$_POST = from the plugin form; $_GET = from the FTP details screen.
+                        $plugins = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
</ins><span class="cx">                         $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Do not allow to delete Activated plugins.
</span><span class="cx">                         if ( empty($plugins) ) {
</span><span class="cx">                                 wp_redirect(&quot;plugins.php?plugin_status=$status&amp;paged=$page&quot;);
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (12316 => 12317)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2009-12-02 18:00:32 UTC (rev 12316)
+++ trunk/wp-includes/script-loader.php        2009-12-03 01:43:49 UTC (rev 12317)
</span><span class="lines">@@ -342,7 +342,7 @@
</span><span class="cx">                 $scripts-&gt;add( 'theme-preview', &quot;/wp-admin/js/theme-preview$suffix.js&quot;, array( 'thickbox', 'jquery' ), '20090319' );
</span><span class="cx">                 $scripts-&gt;add_data( 'theme-preview', 'group', 1 );
</span><span class="cx"> 
</span><del>-                $scripts-&gt;add( 'inline-edit-post', &quot;/wp-admin/js/inline-edit-post$suffix.js&quot;, array( 'jquery', 'suggest' ), '20091016' );
</del><ins>+                $scripts-&gt;add( 'inline-edit-post', &quot;/wp-admin/js/inline-edit-post$suffix.js&quot;, array( 'jquery', 'suggest' ), '20091202' );
</ins><span class="cx">                 $scripts-&gt;add_data( 'inline-edit-post', 'group', 1 );
</span><span class="cx">                 $scripts-&gt;localize( 'inline-edit-post', 'inlineEditL10n', array(
</span><span class="cx">                         'error' =&gt; __('Error while saving the changes.'),
</span></span></pre>
</div>
</div>

</body>
</html>