<!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>[19444] trunk: Switch to sanitize_title_for_query() for Query sanitization (allows for pre-3.3 page slugs to be viewable), Don't update page slugs to new slug-types when the slug is not being changed, Don't issue a XHR if the page slug hasn't changed.</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/19444">19444</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2011-11-24 00:20:21 +0000 (Thu, 24 Nov 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>Switch to sanitize_title_for_query() for Query sanitization (allows for pre-3.3 page slugs to be viewable), Don't update page slugs to new slug-types when the slug is not being changed, Don't issue a XHR if the page slug hasn't changed. Group effort props xknown, markjaquith, nacin. See <a href="http://core.trac.wordpress.org/ticket/19292">#19292</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminjspostdevjs">trunk/wp-admin/js/post.dev.js</a></li>
<li><a href="#trunkwpadminjspostjs">trunk/wp-admin/js/post.js</a></li>
<li><a href="#trunkwpincludespostphp">trunk/wp-includes/post.php</a></li>
<li><a href="#trunkwpincludesqueryphp">trunk/wp-includes/query.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="trunkwpadminjspostdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/post.dev.js (19443 => 19444)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post.dev.js        2011-11-23 23:49:33 UTC (rev 19443)
+++ trunk/wp-admin/js/post.dev.js        2011-11-24 00:20:21 UTC (rev 19444)
</span><span class="lines">@@ -547,6 +547,9 @@
</span><span class="cx">                         b.html('&lt;a href=&quot;#&quot; class=&quot;save button&quot;&gt;'+postL10n.ok+'&lt;/a&gt; &lt;a class=&quot;cancel&quot; href=&quot;#&quot;&gt;'+postL10n.cancel+'&lt;/a&gt;');
</span><span class="cx">                         b.children('.save').click(function() {
</span><span class="cx">                                 var new_slug = e.children('input').val();
</span><ins>+                                if ( new_slug == $('#editable-post-name-full').text() ) {
+                                        return $('.cancel', '#edit-slug-buttons').click();
+                                }
</ins><span class="cx">                                 $.post(ajaxurl, {
</span><span class="cx">                                         action: 'sample-permalink',
</span><span class="cx">                                         post_id: post_id,
</span></span></pre></div>
<a id="trunkwpadminjspostjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/post.js (19443 => 19444)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/post.js        2011-11-23 23:49:33 UTC (rev 19443)
+++ trunk/wp-admin/js/post.js        2011-11-24 00:20:21 UTC (rev 19444)
</span><span class="lines">@@ -1 +1 @@
</span><del>-var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail,wptitlehint;function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&amp;&amp;jQuery.inArray(d,c)==-1){c.push(d)}});return c}(function(a){tagBox={clean:function(b){return b.replace(/\s*,\s*/g,&quot;,&quot;).replace(/,+/g,&quot;,&quot;).replace(/[,\s]+$/,&quot;&quot;).replace(/^[,\s]+/,&quot;&quot;)},parseTags:function(e){var h=e.id,b=h.split(&quot;-check-num-&quot;)[1],d=a(e).closest(&quot;.tagsdiv&quot;),g=d.find(&quot;.the-tags&quot;),c=g.val().split(&quot;,&quot;),f=[];delete c[b];a.each(c,function(i,j){j=a.trim(j);if(j){f.push(j)}});g.val(this.clean(f.join(&quot;,&quot;)));this.quickClicks(d);return false},quickClicks:function(d){var g=a(&quot;.the-tags&quot;,d),e=a(&quot;.tagchecklist&quot;,d),f=a(d).attr(&quot;id&quot;),b,c;if(!g.length){return}c=g.prop(&quot;disabled&quot;);b=g.val().split(&quot;,&quot;);e.empt
 y();a.each(b,function(i,k){var j,h;k=a.trim(k);if(!k){return}j=a(&quot;&lt;span /&gt;&quot;).text(k);if(!c){h=a('&lt;a id=&quot;'+f+&quot;-check-num-&quot;+i+'&quot; class=&quot;ntdelbutton&quot;&gt;X&lt;/a&gt;');h.click(function(){tagBox.parseTags(this)});j.prepend(&quot;&amp;nbsp;&quot;).prepend(h)}e.append(j)})},flushTags:function(e,b,g){b=b||false;var i,c=a(&quot;.the-tags&quot;,e),h=a(&quot;input.newtag&quot;,e),d;i=b?a(b).text():h.val();tagsval=c.val();d=tagsval?tagsval+&quot;,&quot;+i:i;d=this.clean(d);d=array_unique_noempty(d.split(&quot;,&quot;)).join(&quot;,&quot;);c.val(d);this.quickClicks(e);if(!b){h.val(&quot;&quot;)}if(&quot;undefined&quot;==typeof(g)){h.focus()}return false},get:function(c){var b=c.substr(c.indexOf(&quot;-&quot;)+1);a.post(ajaxurl,{action:&quot;get-tagcloud&quot;,tax:b},function(e,d){if(0==e||&quot;success&quot;!=d){e=wpAjax.broken}e=a('&lt;p id=&quot;tagcloud-'+b+'&quot; class=&quot;the-tagcloud&quot;&gt;'+e+&quot;&lt;/p&gt;&quot;);a(&quot;a&
 quot;,e).click(function(){tagBox.flushTags(a(this).closest(&quot;.inside&quot;).children(&quot;.tagsdiv&quot;),this);return false});a(&quot;#&quot;+c).after(e)})},init:function(){var b=this,c=a(&quot;div.ajaxtag&quot;);a(&quot;.tagsdiv&quot;).each(function(){tagBox.quickClicks(this)});a(&quot;input.tagadd&quot;,c).click(function(){b.flushTags(a(this).closest(&quot;.tagsdiv&quot;))});a(&quot;div.taghint&quot;,c).click(function(){a(this).css(&quot;visibility&quot;,&quot;hidden&quot;).parent().siblings(&quot;.newtag&quot;).focus()});a(&quot;input.newtag&quot;,c).blur(function(){if(this.value==&quot;&quot;){a(this).parent().siblings(&quot;.taghint&quot;).css(&quot;visibility&quot;,&quot;&quot;)}}).focus(function(){a(this).parent().siblings(&quot;.taghint&quot;).css(&quot;visibility&quot;,&quot;hidden&quot;)}).keyup(function(d){if(13==d.which){tagBox.flushTags(a(this).closest(&quot;.tagsdiv&quot;));return false}}).keypress(function(d){if(13==d.which){d.preventDefault();return fal
 se}}).each(function(){var d=a(this).closest(&quot;div.tagsdiv&quot;).attr(&quot;id&quot;);a(this).suggest(ajaxurl+&quot;?action=ajax-tag-search&amp;tax=&quot;+d,{delay:500,minchars:2,multiple:true,multipleSep:&quot;,&quot;})});a(&quot;#post&quot;).submit(function(){a(&quot;div.tagsdiv&quot;).each(function(){tagBox.flushTags(this,false,1)})});a(&quot;a.tagcloud-link&quot;).click(function(){tagBox.get(a(this).attr(&quot;id&quot;));a(this).unbind().click(function(){a(this).siblings(&quot;.the-tagcloud&quot;).toggle();return false});return false})}};commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a(&quot;#commentsdiv img.waiting&quot;).show();e={action:&quot;get-comments&quot;,mode:&quot;single&quot;,_ajax_nonce:a(&quot;#add_comment_nonce&quot;).val(),p:a(&quot;#post_ID&quot;).val(),start:b,number:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a(&quot;#commentsdiv .widefat&quot;).show();a(&quot;#commentsdiv img.waiting&quot;
 ).hide();if(&quot;object&quot;==typeof f&amp;&amp;f.responses[0]){a(&quot;#the-comment-list&quot;).append(f.responses[0].data);theList=theExtraList=null;a(&quot;a[className*=':']&quot;).unbind();if(commentsBox.st&gt;commentsBox.total){a(&quot;#show-comments&quot;).hide()}else{a(&quot;#show-comments&quot;).html(postL10n.showcomm)}return}else{if(1==f){a(&quot;#show-comments&quot;).parent().html(postL10n.endcomm);return}}a(&quot;#the-comment-list&quot;).append('&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;'+wpAjax.broken+&quot;&lt;/td&gt;&lt;/tr&gt;&quot;)});return false}};WPSetThumbnailHTML=function(b){a(&quot;.inside&quot;,&quot;#postimagediv&quot;).html(b)};WPSetThumbnailID=function(c){var b=a('input[value=&quot;_thumbnail_id&quot;]',&quot;#list-table&quot;);if(b.size()&gt;0){a(&quot;#meta\\[&quot;+b.attr(&quot;id&quot;).match(/[0-9]+/)+&quot;\\]\\[value\\]&quot;).text(c)}};WPRemoveThumbnail=function(b){a.post(ajaxurl,{action:&quot;set-post-thumbnail&quot;,post_id:a(&quot;#post
 _ID&quot;).val(),thumbnail_id:-1,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(c){if(c==&quot;0&quot;){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(c)}})}})(jQuery);jQuery(document).ready(function(f){var b,a,g=&quot;&quot;,e=0,h=f(&quot;#content&quot;);postboxes.add_postbox_toggles(pagenow);if(f(&quot;#tagsdiv-post_tag&quot;).length){tagBox.init()}else{f(&quot;#side-sortables, #normal-sortables, #advanced-sortables&quot;).children(&quot;div.postbox&quot;).each(function(){if(this.id.indexOf(&quot;tagsdiv-&quot;)===0){tagBox.init();return false}})}f(&quot;.categorydiv&quot;).each(function(){var n=f(this).attr(&quot;id&quot;),j=false,m,o,l,i,k;l=n.split(&quot;-&quot;);l.shift();i=l.join(&quot;-&quot;);k=i+&quot;_tab&quot;;if(i==&quot;category&quot;){k=&quot;cats&quot;}f(&quot;a&quot;,&quot;#&quot;+i+&quot;-tabs&quot;).click(function(){var p=f(this).attr(&quot;href&quot;);f(this).parent().addClass(&quot;tabs&quot;).siblings(&quot;li&quot;).remov
 eClass(&quot;tabs&quot;);f(&quot;#&quot;+i+&quot;-tabs&quot;).siblings(&quot;.tabs-panel&quot;).hide();f(p).show();if(&quot;#&quot;+i+&quot;-all&quot;==p){deleteUserSetting(k)}else{setUserSetting(k,&quot;pop&quot;)}return false});if(getUserSetting(k)){f('a[href=&quot;#'+i+'-pop&quot;]',&quot;#&quot;+i+&quot;-tabs&quot;).click()}f(&quot;#new&quot;+i).one(&quot;focus&quot;,function(){f(this).val(&quot;&quot;).removeClass(&quot;form-input-tip&quot;)});f(&quot;#&quot;+i+&quot;-add-submit&quot;).click(function(){f(&quot;#new&quot;+i).focus()});m=function(){if(j){return}j=true;var p=jQuery(this),r=p.is(&quot;:checked&quot;),q=p.val().toString();f(&quot;#in-&quot;+i+&quot;-&quot;+q+&quot;, #in-&quot;+i+&quot;-category-&quot;+q).prop(&quot;checked&quot;,r);j=false};catAddBefore=function(p){if(!f(&quot;#new&quot;+i).val()){return false}p.data+=&quot;&amp;&quot;+f(&quot;:checked&quot;,&quot;#&quot;+i+&quot;checklist&quot;).serialize();return p};o=function(u,t){var q,p=f(&quot;#new&quo
 t;+i+&quot;_parent&quot;);if(&quot;undefined&quot;!=t.parsed.responses[0]&amp;&amp;(q=t.parsed.responses[0].supplemental.newcat_parent)){p.before(q);p.remove()}};f(&quot;#&quot;+i+&quot;checklist&quot;).wpList({alt:&quot;&quot;,response:i+&quot;-ajax-response&quot;,addBefore:catAddBefore,addAfter:o});f(&quot;#&quot;+i+&quot;-add-toggle&quot;).click(function(){f(&quot;#&quot;+i+&quot;-adder&quot;).toggleClass(&quot;wp-hidden-children&quot;);f('a[href=&quot;#'+i+'-all&quot;]',&quot;#&quot;+i+&quot;-tabs&quot;).click();f(&quot;#new&quot;+i).focus();return false});f(&quot;#&quot;+i+&quot;checklist li.popular-category :checkbox, #&quot;+i+&quot;checklist-pop :checkbox&quot;).live(&quot;click&quot;,function(){var p=f(this),r=p.is(&quot;:checked&quot;),q=p.val();if(q&amp;&amp;p.parents(&quot;#taxonomy-&quot;+i).length){f(&quot;#in-&quot;+i+&quot;-&quot;+q+&quot;, #in-popular-&quot;+i+&quot;-&quot;+q).prop(&quot;checked&quot;,r)}})});if(f(&quot;#postcustom&quot;).length){f(&quot;#th
 e-list&quot;).wpList({addAfter:function(i,j){f(&quot;table#list-table&quot;).show()},addBefore:function(i){i.data+=&quot;&amp;post_id=&quot;+f(&quot;#post_ID&quot;).val();return i}})}if(f(&quot;#submitdiv&quot;).length){b=f(&quot;#timestamp&quot;).html();a=f(&quot;#post-visibility-display&quot;).html();function d(){var i=f(&quot;#post-visibility-select&quot;);if(f(&quot;input:radio:checked&quot;,i).val()!=&quot;public&quot;){f(&quot;#sticky&quot;).prop(&quot;checked&quot;,false);f(&quot;#sticky-span&quot;).hide()}else{f(&quot;#sticky-span&quot;).show()}if(f(&quot;input:radio:checked&quot;,i).val()!=&quot;password&quot;){f(&quot;#password-span&quot;).hide()}else{f(&quot;#password-span&quot;).show()}}function c(){var p,q,j,s,r=f(&quot;#post_status&quot;),k=f('option[value=&quot;publish&quot;]',r),i=f(&quot;#aa&quot;).val(),n=f(&quot;#mm&quot;).val(),o=f(&quot;#jj&quot;).val(),m=f(&quot;#hh&quot;).val(),l=f(&quot;#mn&quot;).val();p=new Date(i,n-1,o,m,l);q=new Date(f(&quot;#hidd
 en_aa&quot;).val(),f(&quot;#hidden_mm&quot;).val()-1,f(&quot;#hidden_jj&quot;).val(),f(&quot;#hidden_hh&quot;).val(),f(&quot;#hidden_mn&quot;).val());j=new Date(f(&quot;#cur_aa&quot;).val(),f(&quot;#cur_mm&quot;).val()-1,f(&quot;#cur_jj&quot;).val(),f(&quot;#cur_hh&quot;).val(),f(&quot;#cur_mn&quot;).val());if(p.getFullYear()!=i||(1+p.getMonth())!=n||p.getDate()!=o||p.getMinutes()!=l){f(&quot;.timestamp-wrap&quot;,&quot;#timestampdiv&quot;).addClass(&quot;form-invalid&quot;);return false}else{f(&quot;.timestamp-wrap&quot;,&quot;#timestampdiv&quot;).removeClass(&quot;form-invalid&quot;)}if(p&gt;j&amp;&amp;f(&quot;#original_post_status&quot;).val()!=&quot;future&quot;){s=postL10n.publishOnFuture;f(&quot;#publish&quot;).val(postL10n.schedule)}else{if(p&lt;=j&amp;&amp;f(&quot;#original_post_status&quot;).val()!=&quot;publish&quot;){s=postL10n.publishOn;f(&quot;#publish&quot;).val(postL10n.publish)}else{s=postL10n.publishOnPast;f(&quot;#publish&quot;).val(postL10n.update)}}if(q.t
 oUTCString()==p.toUTCString()){f(&quot;#timestamp&quot;).html(b)}else{f(&quot;#timestamp&quot;).html(s+&quot; &lt;b&gt;&quot;+f('option[value=&quot;'+f(&quot;#mm&quot;).val()+'&quot;]',&quot;#mm&quot;).text()+&quot; &quot;+o+&quot;, &quot;+i+&quot; @ &quot;+m+&quot;:&quot;+l+&quot;&lt;/b&gt; &quot;)}if(f(&quot;input:radio:checked&quot;,&quot;#post-visibility-select&quot;).val()==&quot;private&quot;){f(&quot;#publish&quot;).val(postL10n.update);if(k.length==0){r.append('&lt;option value=&quot;publish&quot;&gt;'+postL10n.privatelyPublished+&quot;&lt;/option&gt;&quot;)}else{k.html(postL10n.privatelyPublished)}f('option[value=&quot;publish&quot;]',r).prop(&quot;selected&quot;,true);f(&quot;.edit-post-status&quot;,&quot;#misc-publishing-actions&quot;).hide()}else{if(f(&quot;#original_post_status&quot;).val()==&quot;future&quot;||f(&quot;#original_post_status&quot;).val()==&quot;draft&quot;){if(k.length){k.remove();r.val(f(&quot;#hidden_post_status&quot;).val())}}else{k.html(postL
 10n.published)}if(r.is(&quot;:hidden&quot;)){f(&quot;.edit-post-status&quot;,&quot;#misc-publishing-actions&quot;).show()}}f(&quot;#post-status-display&quot;).html(f(&quot;option:selected&quot;,r).text());if(f(&quot;option:selected&quot;,r).val()==&quot;private&quot;||f(&quot;option:selected&quot;,r).val()==&quot;publish&quot;){f(&quot;#save-post&quot;).hide()}else{f(&quot;#save-post&quot;).show();if(f(&quot;option:selected&quot;,r).val()==&quot;pending&quot;){f(&quot;#save-post&quot;).show().val(postL10n.savePending)}else{f(&quot;#save-post&quot;).show().val(postL10n.saveDraft)}}return true}f(&quot;.edit-visibility&quot;,&quot;#visibility&quot;).click(function(){if(f(&quot;#post-visibility-select&quot;).is(&quot;:hidden&quot;)){d();f(&quot;#post-visibility-select&quot;).slideDown(&quot;fast&quot;);f(this).hide()}return false});f(&quot;.cancel-post-visibility&quot;,&quot;#post-visibility-select&quot;).click(function(){f(&quot;#post-visibility-select&quot;).slideUp(&quot;fast
 &quot;);f(&quot;#visibility-radio-&quot;+f(&quot;#hidden-post-visibility&quot;).val()).prop(&quot;checked&quot;,true);f(&quot;#post_password&quot;).val(f(&quot;#hidden_post_password&quot;).val());f(&quot;#sticky&quot;).prop(&quot;checked&quot;,f(&quot;#hidden-post-sticky&quot;).prop(&quot;checked&quot;));f(&quot;#post-visibility-display&quot;).html(a);f(&quot;.edit-visibility&quot;,&quot;#visibility&quot;).show();c();return false});f(&quot;.save-post-visibility&quot;,&quot;#post-visibility-select&quot;).click(function(){var i=f(&quot;#post-visibility-select&quot;);i.slideUp(&quot;fast&quot;);f(&quot;.edit-visibility&quot;,&quot;#visibility&quot;).show();c();if(f(&quot;input:radio:checked&quot;,i).val()!=&quot;public&quot;){f(&quot;#sticky&quot;).prop(&quot;checked&quot;,false)}if(true==f(&quot;#sticky&quot;).prop(&quot;checked&quot;)){g=&quot;Sticky&quot;}else{g=&quot;&quot;}f(&quot;#post-visibility-display&quot;).html(postL10n[f(&quot;input:radio:checked&quot;,i).val()+g]);
 return false});f(&quot;input:radio&quot;,&quot;#post-visibility-select&quot;).change(function(){d()});f(&quot;#timestampdiv&quot;).siblings(&quot;a.edit-timestamp&quot;).click(function(){if(f(&quot;#timestampdiv&quot;).is(&quot;:hidden&quot;)){f(&quot;#timestampdiv&quot;).slideDown(&quot;fast&quot;);f(this).hide()}return false});f(&quot;.cancel-timestamp&quot;,&quot;#timestampdiv&quot;).click(function(){f(&quot;#timestampdiv&quot;).slideUp(&quot;fast&quot;);f(&quot;#mm&quot;).val(f(&quot;#hidden_mm&quot;).val());f(&quot;#jj&quot;).val(f(&quot;#hidden_jj&quot;).val());f(&quot;#aa&quot;).val(f(&quot;#hidden_aa&quot;).val());f(&quot;#hh&quot;).val(f(&quot;#hidden_hh&quot;).val());f(&quot;#mn&quot;).val(f(&quot;#hidden_mn&quot;).val());f(&quot;#timestampdiv&quot;).siblings(&quot;a.edit-timestamp&quot;).show();c();return false});f(&quot;.save-timestamp&quot;,&quot;#timestampdiv&quot;).click(function(){if(c()){f(&quot;#timestampdiv&quot;).slideUp(&quot;fast&quot;);f(&quot;#timesta
 mpdiv&quot;).siblings(&quot;a.edit-timestamp&quot;).show()}return false});f(&quot;#post-status-select&quot;).siblings(&quot;a.edit-post-status&quot;).click(function(){if(f(&quot;#post-status-select&quot;).is(&quot;:hidden&quot;)){f(&quot;#post-status-select&quot;).slideDown(&quot;fast&quot;);f(this).hide()}return false});f(&quot;.save-post-status&quot;,&quot;#post-status-select&quot;).click(function(){f(&quot;#post-status-select&quot;).slideUp(&quot;fast&quot;);f(&quot;#post-status-select&quot;).siblings(&quot;a.edit-post-status&quot;).show();c();return false});f(&quot;.cancel-post-status&quot;,&quot;#post-status-select&quot;).click(function(){f(&quot;#post-status-select&quot;).slideUp(&quot;fast&quot;);f(&quot;#post_status&quot;).val(f(&quot;#hidden_post_status&quot;).val());f(&quot;#post-status-select&quot;).siblings(&quot;a.edit-post-status&quot;).show();c();return false})}if(f(&quot;#edit-slug-box&quot;).length){editPermalink=function(j){var k,n=0,m=f(&quot;#editable-pos
 t-name&quot;),o=m.html(),r=f(&quot;#post_name&quot;),s=r.val(),p=f(&quot;#edit-slug-buttons&quot;),q=p.html(),l=f(&quot;#editable-post-name-full&quot;).html();f(&quot;#view-post-btn&quot;).hide();p.html('&lt;a href=&quot;#&quot; class=&quot;save button&quot;&gt;'+postL10n.ok+'&lt;/a&gt; &lt;a class=&quot;cancel&quot; href=&quot;#&quot;&gt;'+postL10n.cancel+&quot;&lt;/a&gt;&quot;);p.children(&quot;.save&quot;).click(function(){var i=m.children(&quot;input&quot;).val();f.post(ajaxurl,{action:&quot;sample-permalink&quot;,post_id:j,new_slug:i,new_title:f(&quot;#title&quot;).val(),samplepermalinknonce:f(&quot;#samplepermalinknonce&quot;).val()},function(t){f(&quot;#edit-slug-box&quot;).html(t);p.html(q);r.val(i);makeSlugeditClickable();f(&quot;#view-post-btn&quot;).show()});return false});f(&quot;.cancel&quot;,&quot;#edit-slug-buttons&quot;).click(function(){f(&quot;#view-post-btn&quot;).show();m.html(o);p.html(q);r.val(s);return false});for(k=0;k&lt;l.length;++k){if(&quot;%&quot
 ;==l.charAt(k)){n++}}slug_value=(n&gt;l.length/4)?&quot;&quot;:l;m.html('&lt;input type=&quot;text&quot; id=&quot;new-post-slug&quot; value=&quot;'+slug_value+'&quot; /&gt;').children(&quot;input&quot;).keypress(function(t){var i=t.keyCode||0;if(13==i){p.children(&quot;.save&quot;).click();return false}if(27==i){p.children(&quot;.cancel&quot;).click();return false}r.val(this.value)}).focus()};makeSlugeditClickable=function(){f(&quot;#editable-post-name&quot;).click(function(){f(&quot;#edit-slug-buttons&quot;).children(&quot;.edit-slug&quot;).click()})};makeSlugeditClickable()}if(typeof(wpWordCount)!=&quot;undefined&quot;){f(document).triggerHandler(&quot;wpcountwords&quot;,[h.val()]);h.keyup(function(j){var i=j.keyCode||j.charCode;if(i==e){return true}if(13==i||8==e||46==e){f(document).triggerHandler(&quot;wpcountwords&quot;,[h.val()])}e=i;return true})}wptitlehint=function(k){k=k||&quot;title&quot;;var i=f(&quot;#&quot;+k),j=f(&quot;#&quot;+k+&quot;-prompt-text&quot;);if(i.
 val()==&quot;&quot;){j.css(&quot;visibility&quot;,&quot;&quot;)}j.click(function(){f(this).css(&quot;visibility&quot;,&quot;hidden&quot;);i.focus()});i.blur(function(){if(this.value==&quot;&quot;){j.css(&quot;visibility&quot;,&quot;&quot;)}}).focus(function(){j.css(&quot;visibility&quot;,&quot;hidden&quot;)}).keydown(function(l){j.css(&quot;visibility&quot;,&quot;hidden&quot;);f(this).unbind(l)})};wptitlehint()});
</del><span class="cx">\ No newline at end of file
</span><ins>+var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail,wptitlehint;function array_unique_noempty(a){var out=[];jQuery.each(a,function(key,val){val=jQuery.trim(val);if(val&amp;&amp;jQuery.inArray(val,out)==-1){out.push(val);}});return out;}(function($){tagBox={clean:function(tags){return tags.replace(/\s*,\s*/g,&quot;,&quot;).replace(/,+/g,&quot;,&quot;).replace(/[,\s]+$/,&quot;&quot;).replace(/^[,\s]+/,&quot;&quot;);},parseTags:function(el){var id=el.id,num=id.split(&quot;-check-num-&quot;)[1],taxbox=$(el).closest(&quot;.tagsdiv&quot;),thetags=taxbox.find(&quot;.the-tags&quot;),current_tags=thetags.val().split(&quot;,&quot;),new_tags=[];delete current_tags[num];$.each(current_tags,function(key,val){val=$.trim(val);if(val){new_tags.push(val);}});thetags.val(this.clean(new_tags.join(&quot;,&quot;)));this.quickClicks(taxbox);return false;},quickClicks:function(el){var thetags=$(&quot;.the-tags&quot;,el),tagch
 ecklist=$(&quot;.tagchecklist&quot;,el),id=$(el).attr(&quot;id&quot;),current_tags,disabled;if(!thetags.length){return;}disabled=thetags.prop(&quot;disabled&quot;);current_tags=thetags.val().split(&quot;,&quot;);tagchecklist.empty();$.each(current_tags,function(key,val){var span,xbutton;val=$.trim(val);if(!val){return;}span=$(&quot;&lt;span /&gt;&quot;).text(val);if(!disabled){xbutton=$('&lt;a id=&quot;'+id+&quot;-check-num-&quot;+key+'&quot; class=&quot;ntdelbutton&quot;&gt;X&lt;/a&gt;');xbutton.click(function(){tagBox.parseTags(this);});span.prepend(&quot;&amp;nbsp;&quot;).prepend(xbutton);}tagchecklist.append(span);});},flushTags:function(el,a,f){a=a||false;var text,tags=$(&quot;.the-tags&quot;,el),newtag=$(&quot;input.newtag&quot;,el),newtags;text=a?$(a).text():newtag.val();tagsval=tags.val();newtags=tagsval?tagsval+&quot;,&quot;+text:text;newtags=this.clean(newtags);newtags=array_unique_noempty(newtags.split(&quot;,&quot;)).join(&quot;,&quot;);tags.val(newtags);this.qui
 ckClicks(el);if(!a){newtag.val(&quot;&quot;);}if(&quot;undefined&quot;==typeof(f)){newtag.focus();}return false;},get:function(id){var tax=id.substr(id.indexOf(&quot;-&quot;)+1);$.post(ajaxurl,{action:&quot;get-tagcloud&quot;,tax:tax},function(r,stat){if(0==r||&quot;success&quot;!=stat){r=wpAjax.broken;}r=$('&lt;p id=&quot;tagcloud-'+tax+'&quot; class=&quot;the-tagcloud&quot;&gt;'+r+&quot;&lt;/p&gt;&quot;);$(&quot;a&quot;,r).click(function(){tagBox.flushTags($(this).closest(&quot;.inside&quot;).children(&quot;.tagsdiv&quot;),this);return false;});$(&quot;#&quot;+id).after(r);});},init:function(){var t=this,ajaxtag=$(&quot;div.ajaxtag&quot;);$(&quot;.tagsdiv&quot;).each(function(){tagBox.quickClicks(this);});$(&quot;input.tagadd&quot;,ajaxtag).click(function(){t.flushTags($(this).closest(&quot;.tagsdiv&quot;));});$(&quot;div.taghint&quot;,ajaxtag).click(function(){$(this).css(&quot;visibility&quot;,&quot;hidden&quot;).parent().siblings(&quot;.newtag&quot;).focus();});$(&quot;
 input.newtag&quot;,ajaxtag).blur(function(){if(this.value==&quot;&quot;){$(this).parent().siblings(&quot;.taghint&quot;).css(&quot;visibility&quot;,&quot;&quot;);}}).focus(function(){$(this).parent().siblings(&quot;.taghint&quot;).css(&quot;visibility&quot;,&quot;hidden&quot;);}).keyup(function(e){if(13==e.which){tagBox.flushTags($(this).closest(&quot;.tagsdiv&quot;));return false;}}).keypress(function(e){if(13==e.which){e.preventDefault();return false;}}).each(function(){var tax=$(this).closest(&quot;div.tagsdiv&quot;).attr(&quot;id&quot;);$(this).suggest(ajaxurl+&quot;?action=ajax-tag-search&amp;tax=&quot;+tax,{delay:500,minchars:2,multiple:true,multipleSep:&quot;,&quot;});});$(&quot;#post&quot;).submit(function(){$(&quot;div.tagsdiv&quot;).each(function(){tagBox.flushTags(this,false,1);});});$(&quot;a.tagcloud-link&quot;).click(function(){tagBox.get($(this).attr(&quot;id&quot;));$(this).unbind().click(function(){$(this).siblings(&quot;.the-tagcloud&quot;).toggle();return 
 false;});return false;});}};commentsBox={st:0,get:function(total,num){var st=this.st,data;if(!num){num=20;}this.st+=num;this.total=total;$(&quot;#commentsdiv img.waiting&quot;).show();data={action:&quot;get-comments&quot;,mode:&quot;single&quot;,_ajax_nonce:$(&quot;#add_comment_nonce&quot;).val(),p:$(&quot;#post_ID&quot;).val(),start:st,number:num};$.post(ajaxurl,data,function(r){r=wpAjax.parseAjaxResponse(r);$(&quot;#commentsdiv .widefat&quot;).show();$(&quot;#commentsdiv img.waiting&quot;).hide();if(&quot;object&quot;==typeof r&amp;&amp;r.responses[0]){$(&quot;#the-comment-list&quot;).append(r.responses[0].data);theList=theExtraList=null;$(&quot;a[className*=':']&quot;).unbind();if(commentsBox.st&gt;commentsBox.total){$(&quot;#show-comments&quot;).hide();}else{$(&quot;#show-comments&quot;).html(postL10n.showcomm);}return;}else{if(1==r){$(&quot;#show-comments&quot;).parent().html(postL10n.endcomm);return;}}$(&quot;#the-comment-list&quot;).append('&lt;tr&gt;&lt;td colspan=&q
 uot;2&quot;&gt;'+wpAjax.broken+&quot;&lt;/td&gt;&lt;/tr&gt;&quot;);});return false;}};WPSetThumbnailHTML=function(html){$(&quot;.inside&quot;,&quot;#postimagediv&quot;).html(html);};WPSetThumbnailID=function(id){var field=$('input[value=&quot;_thumbnail_id&quot;]',&quot;#list-table&quot;);if(field.size()&gt;0){$(&quot;#meta\\[&quot;+field.attr(&quot;id&quot;).match(/[0-9]+/)+&quot;\\]\\[value\\]&quot;).text(id);}};WPRemoveThumbnail=function(nonce){$.post(ajaxurl,{action:&quot;set-post-thumbnail&quot;,post_id:$(&quot;#post_ID&quot;).val(),thumbnail_id:-1,_ajax_nonce:nonce,cookie:encodeURIComponent(document.cookie)},function(str){if(str==&quot;0&quot;){alert(setPostThumbnailL10n.error);}else{WPSetThumbnailHTML(str);}});};})(jQuery);jQuery(document).ready(function($){var stamp,visibility,sticky=&quot;&quot;,last=0,co=$(&quot;#content&quot;);postboxes.add_postbox_toggles(pagenow);if($(&quot;#tagsdiv-post_tag&quot;).length){tagBox.init();}else{$(&quot;#side-sortables, #normal-sor
 tables, #advanced-sortables&quot;).children(&quot;div.postbox&quot;).each(function(){if(this.id.indexOf(&quot;tagsdiv-&quot;)===0){tagBox.init();return false;}});}$(&quot;.categorydiv&quot;).each(function(){var this_id=$(this).attr(&quot;id&quot;),noSyncChecks=false,syncChecks,catAddAfter,taxonomyParts,taxonomy,settingName;taxonomyParts=this_id.split(&quot;-&quot;);taxonomyParts.shift();taxonomy=taxonomyParts.join(&quot;-&quot;);settingName=taxonomy+&quot;_tab&quot;;if(taxonomy==&quot;category&quot;){settingName=&quot;cats&quot;;}$(&quot;a&quot;,&quot;#&quot;+taxonomy+&quot;-tabs&quot;).click(function(){var t=$(this).attr(&quot;href&quot;);$(this).parent().addClass(&quot;tabs&quot;).siblings(&quot;li&quot;).removeClass(&quot;tabs&quot;);$(&quot;#&quot;+taxonomy+&quot;-tabs&quot;).siblings(&quot;.tabs-panel&quot;).hide();$(t).show();if(&quot;#&quot;+taxonomy+&quot;-all&quot;==t){deleteUserSetting(settingName);}else{setUserSetting(settingName,&quot;pop&quot;);}return false;});
 if(getUserSetting(settingName)){$('a[href=&quot;#'+taxonomy+'-pop&quot;]',&quot;#&quot;+taxonomy+&quot;-tabs&quot;).click();}$(&quot;#new&quot;+taxonomy).one(&quot;focus&quot;,function(){$(this).val(&quot;&quot;).removeClass(&quot;form-input-tip&quot;);});$(&quot;#&quot;+taxonomy+&quot;-add-submit&quot;).click(function(){$(&quot;#new&quot;+taxonomy).focus();});syncChecks=function(){if(noSyncChecks){return;}noSyncChecks=true;var th=jQuery(this),c=th.is(&quot;:checked&quot;),id=th.val().toString();$(&quot;#in-&quot;+taxonomy+&quot;-&quot;+id+&quot;, #in-&quot;+taxonomy+&quot;-category-&quot;+id).prop(&quot;checked&quot;,c);noSyncChecks=false;};catAddBefore=function(s){if(!$(&quot;#new&quot;+taxonomy).val()){return false;}s.data+=&quot;&amp;&quot;+$(&quot;:checked&quot;,&quot;#&quot;+taxonomy+&quot;checklist&quot;).serialize();return s;};catAddAfter=function(r,s){var sup,drop=$(&quot;#new&quot;+taxonomy+&quot;_parent&quot;);if(&quot;undefined&quot;!=s.parsed.responses[0]&amp;&a
 mp;(sup=s.parsed.responses[0].supplemental.newcat_parent)){drop.before(sup);drop.remove();}};$(&quot;#&quot;+taxonomy+&quot;checklist&quot;).wpList({alt:&quot;&quot;,response:taxonomy+&quot;-ajax-response&quot;,addBefore:catAddBefore,addAfter:catAddAfter});$(&quot;#&quot;+taxonomy+&quot;-add-toggle&quot;).click(function(){$(&quot;#&quot;+taxonomy+&quot;-adder&quot;).toggleClass(&quot;wp-hidden-children&quot;);$('a[href=&quot;#'+taxonomy+'-all&quot;]',&quot;#&quot;+taxonomy+&quot;-tabs&quot;).click();$(&quot;#new&quot;+taxonomy).focus();return false;});$(&quot;#&quot;+taxonomy+&quot;checklist li.popular-category :checkbox, #&quot;+taxonomy+&quot;checklist-pop :checkbox&quot;).live(&quot;click&quot;,function(){var t=$(this),c=t.is(&quot;:checked&quot;),id=t.val();if(id&amp;&amp;t.parents(&quot;#taxonomy-&quot;+taxonomy).length){$(&quot;#in-&quot;+taxonomy+&quot;-&quot;+id+&quot;, #in-popular-&quot;+taxonomy+&quot;-&quot;+id).prop(&quot;checked&quot;,c);}});});if($(&quot;#postc
 ustom&quot;).length){$(&quot;#the-list&quot;).wpList({addAfter:function(xml,s){$(&quot;table#list-table&quot;).show();},addBefore:function(s){s.data+=&quot;&amp;post_id=&quot;+$(&quot;#post_ID&quot;).val();return s;}});}if($(&quot;#submitdiv&quot;).length){stamp=$(&quot;#timestamp&quot;).html();visibility=$(&quot;#post-visibility-display&quot;).html();function updateVisibility(){var pvSelect=$(&quot;#post-visibility-select&quot;);if($(&quot;input:radio:checked&quot;,pvSelect).val()!=&quot;public&quot;){$(&quot;#sticky&quot;).prop(&quot;checked&quot;,false);$(&quot;#sticky-span&quot;).hide();}else{$(&quot;#sticky-span&quot;).show();}if($(&quot;input:radio:checked&quot;,pvSelect).val()!=&quot;password&quot;){$(&quot;#password-span&quot;).hide();}else{$(&quot;#password-span&quot;).show();}}function updateText(){var attemptedDate,originalDate,currentDate,publishOn,postStatus=$(&quot;#post_status&quot;),optPublish=$('option[value=&quot;publish&quot;]',postStatus),aa=$(&quot;#aa&q
 uot;).val(),mm=$(&quot;#mm&quot;).val(),jj=$(&quot;#jj&quot;).val(),hh=$(&quot;#hh&quot;).val(),mn=$(&quot;#mn&quot;).val();attemptedDate=new Date(aa,mm-1,jj,hh,mn);originalDate=new Date($(&quot;#hidden_aa&quot;).val(),$(&quot;#hidden_mm&quot;).val()-1,$(&quot;#hidden_jj&quot;).val(),$(&quot;#hidden_hh&quot;).val(),$(&quot;#hidden_mn&quot;).val());currentDate=new Date($(&quot;#cur_aa&quot;).val(),$(&quot;#cur_mm&quot;).val()-1,$(&quot;#cur_jj&quot;).val(),$(&quot;#cur_hh&quot;).val(),$(&quot;#cur_mn&quot;).val());if(attemptedDate.getFullYear()!=aa||(1+attemptedDate.getMonth())!=mm||attemptedDate.getDate()!=jj||attemptedDate.getMinutes()!=mn){$(&quot;.timestamp-wrap&quot;,&quot;#timestampdiv&quot;).addClass(&quot;form-invalid&quot;);return false;}else{$(&quot;.timestamp-wrap&quot;,&quot;#timestampdiv&quot;).removeClass(&quot;form-invalid&quot;);}if(attemptedDate&gt;currentDate&amp;&amp;$(&quot;#original_post_status&quot;).val()!=&quot;future&quot;){publishOn=postL10n.publishO
 nFuture;$(&quot;#publish&quot;).val(postL10n.schedule);}else{if(attemptedDate&lt;=currentDate&amp;&amp;$(&quot;#original_post_status&quot;).val()!=&quot;publish&quot;){publishOn=postL10n.publishOn;$(&quot;#publish&quot;).val(postL10n.publish);}else{publishOn=postL10n.publishOnPast;$(&quot;#publish&quot;).val(postL10n.update);}}if(originalDate.toUTCString()==attemptedDate.toUTCString()){$(&quot;#timestamp&quot;).html(stamp);}else{$(&quot;#timestamp&quot;).html(publishOn+&quot; &lt;b&gt;&quot;+$('option[value=&quot;'+$(&quot;#mm&quot;).val()+'&quot;]',&quot;#mm&quot;).text()+&quot; &quot;+jj+&quot;, &quot;+aa+&quot; @ &quot;+hh+&quot;:&quot;+mn+&quot;&lt;/b&gt; &quot;);}if($(&quot;input:radio:checked&quot;,&quot;#post-visibility-select&quot;).val()==&quot;private&quot;){$(&quot;#publish&quot;).val(postL10n.update);if(optPublish.length==0){postStatus.append('&lt;option value=&quot;publish&quot;&gt;'+postL10n.privatelyPublished+&quot;&lt;/option&gt;&quot;);}else{optPublish.html(
 postL10n.privatelyPublished);}$('option[value=&quot;publish&quot;]',postStatus).prop(&quot;selected&quot;,true);$(&quot;.edit-post-status&quot;,&quot;#misc-publishing-actions&quot;).hide();}else{if($(&quot;#original_post_status&quot;).val()==&quot;future&quot;||$(&quot;#original_post_status&quot;).val()==&quot;draft&quot;){if(optPublish.length){optPublish.remove();postStatus.val($(&quot;#hidden_post_status&quot;).val());}}else{optPublish.html(postL10n.published);}if(postStatus.is(&quot;:hidden&quot;)){$(&quot;.edit-post-status&quot;,&quot;#misc-publishing-actions&quot;).show();}}$(&quot;#post-status-display&quot;).html($(&quot;option:selected&quot;,postStatus).text());if($(&quot;option:selected&quot;,postStatus).val()==&quot;private&quot;||$(&quot;option:selected&quot;,postStatus).val()==&quot;publish&quot;){$(&quot;#save-post&quot;).hide();}else{$(&quot;#save-post&quot;).show();if($(&quot;option:selected&quot;,postStatus).val()==&quot;pending&quot;){$(&quot;#save-post&quot;
 ).show().val(postL10n.savePending);}else{$(&quot;#save-post&quot;).show().val(postL10n.saveDraft);}}return true;}$(&quot;.edit-visibility&quot;,&quot;#visibility&quot;).click(function(){if($(&quot;#post-visibility-select&quot;).is(&quot;:hidden&quot;)){updateVisibility();$(&quot;#post-visibility-select&quot;).slideDown(&quot;fast&quot;);$(this).hide();}return false;});$(&quot;.cancel-post-visibility&quot;,&quot;#post-visibility-select&quot;).click(function(){$(&quot;#post-visibility-select&quot;).slideUp(&quot;fast&quot;);$(&quot;#visibility-radio-&quot;+$(&quot;#hidden-post-visibility&quot;).val()).prop(&quot;checked&quot;,true);$(&quot;#post_password&quot;).val($(&quot;#hidden_post_password&quot;).val());$(&quot;#sticky&quot;).prop(&quot;checked&quot;,$(&quot;#hidden-post-sticky&quot;).prop(&quot;checked&quot;));$(&quot;#post-visibility-display&quot;).html(visibility);$(&quot;.edit-visibility&quot;,&quot;#visibility&quot;).show();updateText();return false;});$(&quot;.save-
 post-visibility&quot;,&quot;#post-visibility-select&quot;).click(function(){var pvSelect=$(&quot;#post-visibility-select&quot;);pvSelect.slideUp(&quot;fast&quot;);$(&quot;.edit-visibility&quot;,&quot;#visibility&quot;).show();updateText();if($(&quot;input:radio:checked&quot;,pvSelect).val()!=&quot;public&quot;){$(&quot;#sticky&quot;).prop(&quot;checked&quot;,false);}if(true==$(&quot;#sticky&quot;).prop(&quot;checked&quot;)){sticky=&quot;Sticky&quot;;}else{sticky=&quot;&quot;;}$(&quot;#post-visibility-display&quot;).html(postL10n[$(&quot;input:radio:checked&quot;,pvSelect).val()+sticky]);return false;});$(&quot;input:radio&quot;,&quot;#post-visibility-select&quot;).change(function(){updateVisibility();});$(&quot;#timestampdiv&quot;).siblings(&quot;a.edit-timestamp&quot;).click(function(){if($(&quot;#timestampdiv&quot;).is(&quot;:hidden&quot;)){$(&quot;#timestampdiv&quot;).slideDown(&quot;fast&quot;);$(this).hide();}return false;});$(&quot;.cancel-timestamp&quot;,&quot;#timest
 ampdiv&quot;).click(function(){$(&quot;#timestampdiv&quot;).slideUp(&quot;fast&quot;);$(&quot;#mm&quot;).val($(&quot;#hidden_mm&quot;).val());$(&quot;#jj&quot;).val($(&quot;#hidden_jj&quot;).val());$(&quot;#aa&quot;).val($(&quot;#hidden_aa&quot;).val());$(&quot;#hh&quot;).val($(&quot;#hidden_hh&quot;).val());$(&quot;#mn&quot;).val($(&quot;#hidden_mn&quot;).val());$(&quot;#timestampdiv&quot;).siblings(&quot;a.edit-timestamp&quot;).show();updateText();return false;});$(&quot;.save-timestamp&quot;,&quot;#timestampdiv&quot;).click(function(){if(updateText()){$(&quot;#timestampdiv&quot;).slideUp(&quot;fast&quot;);$(&quot;#timestampdiv&quot;).siblings(&quot;a.edit-timestamp&quot;).show();}return false;});$(&quot;#post-status-select&quot;).siblings(&quot;a.edit-post-status&quot;).click(function(){if($(&quot;#post-status-select&quot;).is(&quot;:hidden&quot;)){$(&quot;#post-status-select&quot;).slideDown(&quot;fast&quot;);$(this).hide();}return false;});$(&quot;.save-post-status&quot
 ;,&quot;#post-status-select&quot;).click(function(){$(&quot;#post-status-select&quot;).slideUp(&quot;fast&quot;);$(&quot;#post-status-select&quot;).siblings(&quot;a.edit-post-status&quot;).show();updateText();return false;});$(&quot;.cancel-post-status&quot;,&quot;#post-status-select&quot;).click(function(){$(&quot;#post-status-select&quot;).slideUp(&quot;fast&quot;);$(&quot;#post_status&quot;).val($(&quot;#hidden_post_status&quot;).val());$(&quot;#post-status-select&quot;).siblings(&quot;a.edit-post-status&quot;).show();updateText();return false;});}if($(&quot;#edit-slug-box&quot;).length){editPermalink=function(post_id){var i,c=0,e=$(&quot;#editable-post-name&quot;),revert_e=e.html(),real_slug=$(&quot;#post_name&quot;),revert_slug=real_slug.val(),b=$(&quot;#edit-slug-buttons&quot;),revert_b=b.html(),full=$(&quot;#editable-post-name-full&quot;).html();$(&quot;#view-post-btn&quot;).hide();b.html('&lt;a href=&quot;#&quot; class=&quot;save button&quot;&gt;'+postL10n.ok+'&lt;/a
 &gt; &lt;a class=&quot;cancel&quot; href=&quot;#&quot;&gt;'+postL10n.cancel+&quot;&lt;/a&gt;&quot;);b.children(&quot;.save&quot;).click(function(){var new_slug=e.children(&quot;input&quot;).val();if(new_slug==$(&quot;#editable-post-name-full&quot;).text()){return $(&quot;.cancel&quot;,&quot;#edit-slug-buttons&quot;).click();}$.post(ajaxurl,{action:&quot;sample-permalink&quot;,post_id:post_id,new_slug:new_slug,new_title:$(&quot;#title&quot;).val(),samplepermalinknonce:$(&quot;#samplepermalinknonce&quot;).val()},function(data){$(&quot;#edit-slug-box&quot;).html(data);b.html(revert_b);real_slug.val(new_slug);makeSlugeditClickable();$(&quot;#view-post-btn&quot;).show();});return false;});$(&quot;.cancel&quot;,&quot;#edit-slug-buttons&quot;).click(function(){$(&quot;#view-post-btn&quot;).show();e.html(revert_e);b.html(revert_b);real_slug.val(revert_slug);return false;});for(i=0;i&lt;full.length;++i){if(&quot;%&quot;==full.charAt(i)){c++;}}slug_value=(c&gt;full.length/4)?&quot;&qu
 ot;:full;e.html('&lt;input type=&quot;text&quot; id=&quot;new-post-slug&quot; value=&quot;'+slug_value+'&quot; /&gt;').children(&quot;input&quot;).keypress(function(e){var key=e.keyCode||0;if(13==key){b.children(&quot;.save&quot;).click();return false;}if(27==key){b.children(&quot;.cancel&quot;).click();return false;}real_slug.val(this.value);}).focus();};makeSlugeditClickable=function(){$(&quot;#editable-post-name&quot;).click(function(){$(&quot;#edit-slug-buttons&quot;).children(&quot;.edit-slug&quot;).click();});};makeSlugeditClickable();}if(typeof(wpWordCount)!=&quot;undefined&quot;){$(document).triggerHandler(&quot;wpcountwords&quot;,[co.val()]);co.keyup(function(e){var k=e.keyCode||e.charCode;if(k==last){return true;}if(13==k||8==last||46==last){$(document).triggerHandler(&quot;wpcountwords&quot;,[co.val()]);}last=k;return true;});}wptitlehint=function(id){id=id||&quot;title&quot;;var title=$(&quot;#&quot;+id),titleprompt=$(&quot;#&quot;+id+&quot;-prompt-text&quot;);if
 (title.val()==&quot;&quot;){titleprompt.css(&quot;visibility&quot;,&quot;&quot;);}titleprompt.click(function(){$(this).css(&quot;visibility&quot;,&quot;hidden&quot;);title.focus();});title.blur(function(){if(this.value==&quot;&quot;){titleprompt.css(&quot;visibility&quot;,&quot;&quot;);}}).focus(function(){titleprompt.css(&quot;visibility&quot;,&quot;hidden&quot;);}).keydown(function(e){titleprompt.css(&quot;visibility&quot;,&quot;hidden&quot;);$(this).unbind(e);});};wptitlehint();});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post.php (19443 => 19444)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post.php        2011-11-23 23:49:33 UTC (rev 19443)
+++ trunk/wp-includes/post.php        2011-11-24 00:20:21 UTC (rev 19444)
</span><span class="lines">@@ -2490,7 +2490,12 @@
</span><span class="cx">                 else
</span><span class="cx">                         $post_name = '';
</span><span class="cx">         } else {
</span><del>-                $post_name = sanitize_title($post_name);
</del><ins>+                // On updates, we need to check to see if it's using the old, fixed sanitization context.
+                $check_name = sanitize_title( $post_name, '', 'old-save' );
+                if ( $update &amp;&amp; strtolower( urlencode( $post_name ) ) == $check_name &amp;&amp; get_post_field( 'post_name', $ID ) == $check_name )
+                        $post_name = $check_name;
+                else // new post, or slug has changed.
+                        $post_name = sanitize_title($post_name);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // If the post date is empty (due to having been new or a draft) and status is not 'draft' or 'pending', set date to now
</span><span class="lines">@@ -3153,7 +3158,7 @@
</span><span class="cx">         $page_path = str_replace('%20', ' ', $page_path);
</span><span class="cx">         $parts = explode( '/', trim( $page_path, '/' ) );
</span><span class="cx">         $parts = array_map( 'esc_sql', $parts );
</span><del>-        $parts = array_map( 'sanitize_title', $parts );
</del><ins>+        $parts = array_map( 'sanitize_title_for_query', $parts );
</ins><span class="cx"> 
</span><span class="cx">         $in_string = &quot;'&quot;. implode( &quot;','&quot;, $parts ) . &quot;'&quot;;
</span><span class="cx">         $post_type_sql = $post_type;
</span></span></pre></div>
<a id="trunkwpincludesqueryphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/query.php (19443 => 19444)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/query.php        2011-11-23 23:49:33 UTC (rev 19443)
+++ trunk/wp-includes/query.php        2011-11-24 00:20:21 UTC (rev 19444)
</span><span class="lines">@@ -1838,7 +1838,7 @@
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 if ( !empty($q['tag_slug__in']) ) {
</span><del>-                        $q['tag_slug__in'] = array_map('sanitize_title', array_unique( (array) $q['tag_slug__in'] ) );
</del><ins>+                        $q['tag_slug__in'] = array_map('sanitize_title_for_query', array_unique( (array) $q['tag_slug__in'] ) );
</ins><span class="cx">                         $tax_query[] = array(
</span><span class="cx">                                 'taxonomy' =&gt; 'post_tag',
</span><span class="cx">                                 'terms' =&gt; $q['tag_slug__in'],
</span><span class="lines">@@ -1847,7 +1847,7 @@
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 if ( !empty($q['tag_slug__and']) ) {
</span><del>-                        $q['tag_slug__and'] = array_map('sanitize_title', array_unique( (array) $q['tag_slug__and'] ) );
</del><ins>+                        $q['tag_slug__and'] = array_map('sanitize_title_for_query', array_unique( (array) $q['tag_slug__and'] ) );
</ins><span class="cx">                         $tax_query[] = array(
</span><span class="cx">                                 'taxonomy' =&gt; 'post_tag',
</span><span class="cx">                                 'terms' =&gt; $q['tag_slug__and'],
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (19443 => 19444)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2011-11-23 23:49:33 UTC (rev 19443)
+++ trunk/wp-includes/script-loader.php        2011-11-24 00:20:21 UTC (rev 19444)
</span><span class="lines">@@ -311,7 +311,7 @@
</span><span class="cx"> 
</span><span class="cx">                 $scripts-&gt;add( 'postbox', &quot;/wp-admin/js/postbox$suffix.js&quot;, array('jquery-ui-sortable'), '20111009a', 1 );
</span><span class="cx"> 
</span><del>-                $scripts-&gt;add( 'post', &quot;/wp-admin/js/post$suffix.js&quot;, array('suggest', 'wp-lists', 'postbox'), '20110524', 1 );
</del><ins>+                $scripts-&gt;add( 'post', &quot;/wp-admin/js/post$suffix.js&quot;, array('suggest', 'wp-lists', 'postbox'), '20111124', 1 );
</ins><span class="cx">                 $scripts-&gt;localize( 'post', 'postL10n', array(
</span><span class="cx">                         'ok' =&gt; __('OK'),
</span><span class="cx">                         'cancel' =&gt; __('Cancel'),
</span></span></pre>
</div>
</div>

</body>
</html>