Commit b6691b17 authored by lechuck's avatar lechuck Committed by lechuck
Browse files

Upgrade to wp 3.4.1

parent f6d84d54
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<body> <body>
<h1 id="logo"> <h1 id="logo">
<a href="http://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a> <a href="http://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
<br /> Version 3.4 <br /> Version 3.4.1
</h1> </h1>
<p style="text-align: center">Semantic Personal Publishing Platform</p> <p style="text-align: center">Semantic Personal Publishing Platform</p>
......
...@@ -33,6 +33,14 @@ include( ABSPATH . 'wp-admin/admin-header.php' ); ...@@ -33,6 +33,14 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
</a> </a>
</h2> </h2>
<div class="changelog point-releases">
<h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 1 ); ?></h3>
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 21 ), '3.4.1', number_format_i18n( 21 ) ); ?>
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_3.4.1' ); ?>
</p>
</div>
<div class="changelog"> <div class="changelog">
<h3><?php _e( 'Live Theme Previews' ); ?></h3> <h3><?php _e( 'Live Theme Previews' ); ?></h3>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -1968,13 +1968,7 @@ html.wp-toolbar { ...@@ -1968,13 +1968,7 @@ html.wp-toolbar {
box-sizing: border-box; box-sizing: border-box;
} }
.postbox-container .meta-box-sortables:empty { .metabox-holder .postbox-container .empty-container {
min-height: 0;
height: 0;
}
.metabox-holder .postbox-container .empty-container,
#post-body.columns-2 #side-sortables:empty {
border: 3px dashed #CCCCCC; border: 3px dashed #CCCCCC;
height: 250px; height: 250px;
} }
...@@ -2045,7 +2039,6 @@ html.wp-toolbar { ...@@ -2045,7 +2039,6 @@ html.wp-toolbar {
width: 50.5%; width: 50.5%;
} }
#dashboard-widgets.metabox-holder .postbox-container .empty-container,
#dashboard-widgets #postbox-container-3 .empty-container, #dashboard-widgets #postbox-container-3 .empty-container,
#dashboard-widgets #postbox-container-4 .empty-container { #dashboard-widgets #postbox-container-4 .empty-container {
border: 0 none; border: 0 none;
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* @since 3.4.0 * @since 3.4.0
*/ */
define( 'IFRAME_REQUEST', true );
require_once( './admin.php' ); require_once( './admin.php' );
if ( ! current_user_can( 'edit_theme_options' ) ) if ( ! current_user_can( 'edit_theme_options' ) )
wp_die( __( 'Cheatin&#8217; uh?' ) ); wp_die( __( 'Cheatin&#8217; uh?' ) );
...@@ -65,7 +67,6 @@ do_action( 'customize_controls_print_scripts' ); ...@@ -65,7 +67,6 @@ do_action( 'customize_controls_print_scripts' );
<body class="<?php echo esc_attr( $body_class ); ?>"> <body class="<?php echo esc_attr( $body_class ); ?>">
<div class="wp-full-overlay expanded"> <div class="wp-full-overlay expanded">
<form id="customize-controls" class="wrap wp-full-overlay-sidebar"> <form id="customize-controls" class="wrap wp-full-overlay-sidebar">
<?php wp_nonce_field( 'customize_controls-' . $wp_customize->get_stylesheet() ); ?>
<div id="customize-header-actions" class="wp-full-overlay-header"> <div id="customize-header-actions" class="wp-full-overlay-header">
<?php <?php
$save_text = $wp_customize->is_theme_active() ? __( 'Save &amp; Publish' ) : __( 'Save &amp; Activate' ); $save_text = $wp_customize->is_theme_active() ? __( 'Save &amp; Publish' ) : __( 'Save &amp; Activate' );
...@@ -175,6 +176,10 @@ do_action( 'customize_controls_print_scripts' ); ...@@ -175,6 +176,10 @@ do_action( 'customize_controls_print_scripts' );
), ),
'settings' => array(), 'settings' => array(),
'controls' => array(), 'controls' => array(),
'nonce' => array(
'save' => wp_create_nonce( 'save-customize_' . $wp_customize->get_stylesheet() ),
'preview' => wp_create_nonce( 'preview-customize_' . $wp_customize->get_stylesheet() )
),
); );
foreach ( $wp_customize->settings() as $id => $setting ) { foreach ( $wp_customize->settings() as $id => $setting ) {
......
...@@ -483,17 +483,17 @@ function post_comment_meta_box($post) { ...@@ -483,17 +483,17 @@ function post_comment_meta_box($post) {
if ( 1 > $total ) { if ( 1 > $total ) {
echo '<p id="no-comments">' . __('No comments yet.') . '</p>'; echo '<p id="no-comments">' . __('No comments yet.') . '</p>';
} else { } else {
$hidden = get_hidden_meta_boxes('post'); $hidden = get_hidden_meta_boxes( get_current_screen() );
if ( ! in_array('commentsdiv', $hidden) ) { if ( ! in_array('commentsdiv', $hidden) ) {
?> ?>
<script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script> <script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
<?php <?php
} }
}
?> ?>
<p class="hide-if-no-js hidden" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /></p> <p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /></p>
<?php <?php
}
wp_comment_trashnotice(); wp_comment_trashnotice();
} }
......
...@@ -521,6 +521,7 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen ...@@ -521,6 +521,7 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen
if ( is_multisite() && ( $network_wide || is_network_only_plugin($plugin) ) ) { if ( is_multisite() && ( $network_wide || is_network_only_plugin($plugin) ) ) {
$network_wide = true; $network_wide = true;
$current = get_site_option( 'active_sitewide_plugins', array() ); $current = get_site_option( 'active_sitewide_plugins', array() );
$_GET['networkwide'] = 1; // Back compat for plugins looking for this value.
} else { } else {
$current = get_option( 'active_plugins', array() ); $current = get_option( 'active_plugins', array() );
} }
......
...@@ -477,7 +477,7 @@ function update_core($from, $to) { ...@@ -477,7 +477,7 @@ function update_core($from, $to) {
$mysql_version = $wpdb->db_version(); $mysql_version = $wpdb->db_version();
$required_php_version = '5.2.4'; $required_php_version = '5.2.4';
$required_mysql_version = '5.0'; $required_mysql_version = '5.0';
$wp_version = '3.4'; $wp_version = '3.4.1';
$php_compat = version_compare( $php_version, $required_php_version, '>=' ); $php_compat = version_compare( $php_version, $required_php_version, '>=' );
if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) )
$mysql_compat = true; $mysql_compat = true;
......
...@@ -264,7 +264,7 @@ function wp_theme_update_row( $theme_key, $theme ) { ...@@ -264,7 +264,7 @@ function wp_theme_update_row( $theme_key, $theme ) {
$themes_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array()); $themes_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());
$theme_name = wp_kses( $theme['Name'], $themes_allowedtags ); $theme_name = wp_kses( $theme['Name'], $themes_allowedtags );
$details_url = self_admin_url("theme-install.php?tab=theme-information&theme=$theme_key&TB_iframe=true&width=600&height=400"); $details_url = add_query_arg( array( 'TB_iframe' => 'true', 'width' => 1024, 'height' => 800 ), $current->response[ $theme_key ]['url'] );
$wp_list_table = _get_list_table('WP_MS_Themes_List_Table'); $wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
......
...@@ -216,7 +216,7 @@ $(document).ready( function() { ...@@ -216,7 +216,7 @@ $(document).ready( function() {
m.addClass('sub-open'); m.addClass('sub-open');
}, },
out: function(){ out: function(){
$(this).find('.wp-submenu').removeClass('sub-open'); $(this).find('.wp-submenu').removeClass('sub-open').css('margin-top', '');
}, },
timeout: 200, timeout: 200,
sensitivity: 7, sensitivity: 7,
......
var showNotice,adminMenu,columns,validateForm,screenMeta;(function(a){adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}};columns={init:function(){var b=this;a(".hide-column-tog","#adv-settings").click(function(){var d=a(this),c=d.val();if(d.prop("checked")){b.checked(c)}else{b.unchecked(c)}columns.saveManageColumnsState()})},saveManageColumnsState:function(){var b=this.hidden();a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})},checked:function(b){a(".column-"+b).show();this.colSpanChange(+1)},unchecked:function(b){a(".column-"+b).hide();this.colSpanChange(-1)},hidden:function(){return a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return a(".hide-column-tog").not(":checked").map(function(){var b=this.id;return b.substring(b,b.length-5)}).get().join(",")}},colSpanChange:function(b){var d=a("table").find(".colspanchange"),c;if(!d.length){return}c=parseInt(d.attr("colspan"),10)+b;d.attr("colspan",c.toString())}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()};showNotice={warn:function(){var b=commonL10n.warnDelete||"";if(confirm(b)){return true}return false},note:function(b){alert(b)}};screenMeta={element:null,toggles:null,page:null,init:function(){this.element=a("#screen-meta");this.toggles=a(".screen-meta-toggle a");this.page=a("#wpcontent");this.toggles.click(this.toggleEvent)},toggleEvent:function(c){var b=a(this.href.replace(/.+#/,"#"));c.preventDefault();if(!b.length){return}if(b.is(":visible")){screenMeta.close(b,a(this))}else{screenMeta.open(b,a(this))}},open:function(b,c){a(".screen-meta-toggle").not(c.parent()).css("visibility","hidden");b.parent().show();b.slideDown("fast",function(){c.addClass("screen-meta-active")})},close:function(b,c){b.slideUp("fast",function(){c.removeClass("screen-meta-active");a(".screen-meta-toggle").css("visibility","");b.parent().hide()})}};a(".contextual-help-tabs").delegate("a","click focus",function(d){var c=a(this),b;d.preventDefault();if(c.is(".active a")){return false}a(".contextual-help-tabs .active").removeClass("active");c.parent("li").addClass("active");b=a(c.attr("href"));a(".help-tab-content").not(b).removeClass("active").hide();b.addClass("active").show()});a(document).ready(function(){var i=false,c,e,j,h,b=a("#adminmenu"),d=a("input.current-page"),f=d.val(),g;g=function(k,m){var n=a(m),l=n.attr("tabindex");if(l){n.attr("tabindex","0").attr("tabindex",l)}};a("#collapse-menu",b).click(function(){var k=a(document.body);a("#adminmenu div.wp-submenu").css("margin-top","");if(k.hasClass("folded")){k.removeClass("folded");setUserSetting("mfold","o")}else{k.addClass("folded");setUserSetting("mfold","f")}return false});a("li.wp-has-submenu",b).hoverIntent({over:function(s){var t,q,k,r,l=a(this).find(".wp-submenu"),u,n,p;if(l.is(":visible")){return}u=a(this).offset().top;n=a(window).scrollTop();p=u-n-30;t=u+l.height()+1;q=a("#wpwrap").height();k=60+t-q;r=a(window).height()+n-15;if(r<(t-k)){k=t-r}if(k>p){k=p}if(k>1){l.css("margin-top","-"+k+"px")}else{l.css("margin-top","")}b.find(".wp-submenu").removeClass("sub-open");l.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open")},timeout:200,sensitivity:7,interval:90});a("li.wp-has-submenu > a.wp-not-current-submenu",b).bind("keydown.adminmenu",function(l){if(l.which!=13){return}var k=a(l.target);l.stopPropagation();l.preventDefault();b.find(".wp-submenu").removeClass("sub-open");k.siblings(".wp-submenu").toggleClass("sub-open").find('a[role="menuitem"]').each(g)}).each(g);a('a[role="menuitem"]',b).bind("keydown.adminmenu",function(l){if(l.which!=27){return}var k=a(l.target);l.stopPropagation();l.preventDefault();k.add(k.siblings()).closest(".sub-open").removeClass("sub-open").siblings("a.wp-not-current-submenu").focus()});a("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");a("div.updated, div.error").not(".below-h2, .inline").insertAfter(a("div.wrap h2:first"));screenMeta.init();a("tbody").children().children(".check-column").find(":checkbox").click(function(k){if("undefined"==k.shiftKey){return true}if(k.shiftKey){if(!i){return true}c=a(i).closest("form").find(":checkbox");e=c.index(i);j=c.index(this);h=a(this).prop("checked");if(0<e&&0<j&&e!=j){c.slice(e,j).prop("checked",function(){if(a(this).closest("tr").is(":visible")){return h}return false})}}i=this;return true});a("thead, tfoot").find(".check-column :checkbox").click(function(m){var n=a(this).prop("checked"),l="undefined"==typeof toggleWithKeyboard?false:toggleWithKeyboard,k=m.shiftKey||l;a(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(a(this).closest("tr").is(":hidden")){return false}if(k){return a(this).prop("checked")}else{if(n){return true}}return false});a(this).closest("table").children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(k){return false}else{if(n){return true}}return false})});a("#default-password-nag-no").click(function(){setUserSetting("default_password_nag","hide");a("div.default-password-nag").hide();return false});a("#newcontent").bind("keydown.wpevent_InsertTab",function(p){if(p.keyCode!=9){return true}var m=p.target,r=m.selectionStart,l=m.selectionEnd,q=m.value,k,o;try{this.lastKey=9}catch(n){}if(document.selection){m.focus();o=document.selection.createRange();o.text="\t"}else{if(r>=0){k=this.scrollTop;m.value=q.substring(0,r).concat("\t",q.substring(l));m.selectionStart=m.selectionEnd=r+1;this.scrollTop=k}}if(p.stopPropagation){p.stopPropagation()}if(p.preventDefault){p.preventDefault()}});a("#newcontent").bind("blur.wpevent_InsertTab",function(k){if(this.lastKey&&9==this.lastKey){this.focus()}});if(d.length){d.closest("form").submit(function(k){if(a('select[name="action"]').val()==-1&&a('select[name="action2"]').val()==-1&&d.val()==f){d.val("1")}})}});a(document).bind("wp_CloseOnEscape",function(c,b){if(typeof(b.cb)!="function"){return}if(typeof(b.condition)!="function"||b.condition()){b.cb()}return true})})(jQuery); var showNotice,adminMenu,columns,validateForm,screenMeta;(function(a){adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}};columns={init:function(){var b=this;a(".hide-column-tog","#adv-settings").click(function(){var d=a(this),c=d.val();if(d.prop("checked")){b.checked(c)}else{b.unchecked(c)}columns.saveManageColumnsState()})},saveManageColumnsState:function(){var b=this.hidden();a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})},checked:function(b){a(".column-"+b).show();this.colSpanChange(+1)},unchecked:function(b){a(".column-"+b).hide();this.colSpanChange(-1)},hidden:function(){return a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return a(".hide-column-tog").not(":checked").map(function(){var b=this.id;return b.substring(b,b.length-5)}).get().join(",")}},colSpanChange:function(b){var d=a("table").find(".colspanchange"),c;if(!d.length){return}c=parseInt(d.attr("colspan"),10)+b;d.attr("colspan",c.toString())}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()};showNotice={warn:function(){var b=commonL10n.warnDelete||"";if(confirm(b)){return true}return false},note:function(b){alert(b)}};screenMeta={element:null,toggles:null,page:null,init:function(){this.element=a("#screen-meta");this.toggles=a(".screen-meta-toggle a");this.page=a("#wpcontent");this.toggles.click(this.toggleEvent)},toggleEvent:function(c){var b=a(this.href.replace(/.+#/,"#"));c.preventDefault();if(!b.length){return}if(b.is(":visible")){screenMeta.close(b,a(this))}else{screenMeta.open(b,a(this))}},open:function(b,c){a(".screen-meta-toggle").not(c.parent()).css("visibility","hidden");b.parent().show();b.slideDown("fast",function(){c.addClass("screen-meta-active")})},close:function(b,c){b.slideUp("fast",function(){c.removeClass("screen-meta-active");a(".screen-meta-toggle").css("visibility","");b.parent().hide()})}};a(".contextual-help-tabs").delegate("a","click focus",function(d){var c=a(this),b;d.preventDefault();if(c.is(".active a")){return false}a(".contextual-help-tabs .active").removeClass("active");c.parent("li").addClass("active");b=a(c.attr("href"));a(".help-tab-content").not(b).removeClass("active").hide();b.addClass("active").show()});a(document).ready(function(){var i=false,c,e,j,h,b=a("#adminmenu"),d=a("input.current-page"),f=d.val(),g;g=function(k,m){var n=a(m),l=n.attr("tabindex");if(l){n.attr("tabindex","0").attr("tabindex",l)}};a("#collapse-menu",b).click(function(){var k=a(document.body);a("#adminmenu div.wp-submenu").css("margin-top","");if(k.hasClass("folded")){k.removeClass("folded");setUserSetting("mfold","o")}else{k.addClass("folded");setUserSetting("mfold","f")}return false});a("li.wp-has-submenu",b).hoverIntent({over:function(s){var t,q,k,r,l=a(this).find(".wp-submenu"),u,n,p;if(l.is(":visible")){return}u=a(this).offset().top;n=a(window).scrollTop();p=u-n-30;t=u+l.height()+1;q=a("#wpwrap").height();k=60+t-q;r=a(window).height()+n-15;if(r<(t-k)){k=t-r}if(k>p){k=p}if(k>1){l.css("margin-top","-"+k+"px")}else{l.css("margin-top","")}b.find(".wp-submenu").removeClass("sub-open");l.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open").css("margin-top","")},timeout:200,sensitivity:7,interval:90});a("li.wp-has-submenu > a.wp-not-current-submenu",b).bind("keydown.adminmenu",function(l){if(l.which!=13){return}var k=a(l.target);l.stopPropagation();l.preventDefault();b.find(".wp-submenu").removeClass("sub-open");k.siblings(".wp-submenu").toggleClass("sub-open").find('a[role="menuitem"]').each(g)}).each(g);a('a[role="menuitem"]',b).bind("keydown.adminmenu",function(l){if(l.which!=27){return}var k=a(l.target);l.stopPropagation();l.preventDefault();k.add(k.siblings()).closest(".sub-open").removeClass("sub-open").siblings("a.wp-not-current-submenu").focus()});a("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");a("div.updated, div.error").not(".below-h2, .inline").insertAfter(a("div.wrap h2:first"));screenMeta.init();a("tbody").children().children(".check-column").find(":checkbox").click(function(k){if("undefined"==k.shiftKey){return true}if(k.shiftKey){if(!i){return true}c=a(i).closest("form").find(":checkbox");e=c.index(i);j=c.index(this);h=a(this).prop("checked");if(0<e&&0<j&&e!=j){c.slice(e,j).prop("checked",function(){if(a(this).closest("tr").is(":visible")){return h}return false})}}i=this;return true});a("thead, tfoot").find(".check-column :checkbox").click(function(m){var n=a(this).prop("checked"),l="undefined"==typeof toggleWithKeyboard?false:toggleWithKeyboard,k=m.shiftKey||l;a(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(a(this).closest("tr").is(":hidden")){return false}if(k){return a(this).prop("checked")}else{if(n){return true}}return false});a(this).closest("table").children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(k){return false}else{if(n){return true}}return false})});a("#default-password-nag-no").click(function(){setUserSetting("default_password_nag","hide");a("div.default-password-nag").hide();return false});a("#newcontent").bind("keydown.wpevent_InsertTab",function(p){if(p.keyCode!=9){return true}var m=p.target,r=m.selectionStart,l=m.selectionEnd,q=m.value,k,o;try{this.lastKey=9}catch(n){}if(document.selection){m.focus();o=document.selection.createRange();o.text="\t"}else{if(r>=0){k=this.scrollTop;m.value=q.substring(0,r).concat("\t",q.substring(l));m.selectionStart=m.selectionEnd=r+1;this.scrollTop=k}}if(p.stopPropagation){p.stopPropagation()}if(p.preventDefault){p.preventDefault()}});a("#newcontent").bind("blur.wpevent_InsertTab",function(k){if(this.lastKey&&9==this.lastKey){this.focus()}});if(d.length){d.closest("form").submit(function(k){if(a('select[name="action"]').val()==-1&&a('select[name="action2"]').val()==-1&&d.val()==f){d.val("1")}})}});a(document).bind("wp_CloseOnEscape",function(c,b){if(typeof(b.cb)!="function"){return}if(typeof(b.condition)!="function"||b.condition()){b.cb()}return true})})(jQuery);
\ No newline at end of file \ No newline at end of file
...@@ -294,7 +294,8 @@ ...@@ -294,7 +294,8 @@
// This is the promise object. // This is the promise object.
deferred.promise( this ); deferred.promise( this );
this.previewer = params.previewer; this.container = params.container;
this.signature = params.signature;
$.extend( params, { channel: api.PreviewFrame.uuid() }); $.extend( params, { channel: api.PreviewFrame.uuid() });
...@@ -338,7 +339,7 @@ ...@@ -338,7 +339,7 @@
this.request.done( function( response ) { this.request.done( function( response ) {
var location = self.request.getResponseHeader('Location'), var location = self.request.getResponseHeader('Location'),
signature = 'WP_CUSTOMIZER_SIGNATURE', signature = self.signature,
index; index;
// Check if the location response header differs from the current URL. // Check if the location response header differs from the current URL.
...@@ -371,7 +372,7 @@ ...@@ -371,7 +372,7 @@
response = response.slice( 0, index ) + response.slice( index + signature.length ); response = response.slice( 0, index ) + response.slice( index + signature.length );
// Create the iframe and inject the html content. // Create the iframe and inject the html content.
self.iframe = $('<iframe />').appendTo( self.previewer.container ); self.iframe = $('<iframe />').appendTo( self.container );
// Bind load event after the iframe has been added to the page; // Bind load event after the iframe has been added to the page;
// otherwise it will fire when injected into the DOM. // otherwise it will fire when injected into the DOM.
...@@ -416,7 +417,7 @@ ...@@ -416,7 +417,7 @@
reject(); reject();
iframe = $('<iframe src="' + self.previewUrl() + '" />').hide(); iframe = $('<iframe src="' + self.previewUrl() + '" />').hide();
iframe.appendTo( self.previewer.container ); iframe.appendTo( self.container );
iframe.load( function() { iframe.load( function() {
self.triedLogin = true; self.triedLogin = true;
...@@ -497,6 +498,7 @@ ...@@ -497,6 +498,7 @@
this.container = api.ensure( params.container ); this.container = api.ensure( params.container );
this.allowedUrls = params.allowedUrls; this.allowedUrls = params.allowedUrls;
this.signature = params.signature;
params.url = window.location.href; params.url = window.location.href;
...@@ -570,7 +572,8 @@ ...@@ -570,7 +572,8 @@
url: this.url(), url: this.url(),
previewUrl: this.previewUrl(), previewUrl: this.previewUrl(),
query: this.query() || {}, query: this.query() || {},
previewer: this container: this.container,
signature: this.signature
}); });
this.loading.done( function() { this.loading.done( function() {
...@@ -583,6 +586,8 @@ ...@@ -583,6 +586,8 @@
self.targetWindow( this.targetWindow() ); self.targetWindow( this.targetWindow() );
self.channel( this.channel() ); self.channel( this.channel() );
self.send( 'active' );
}); });
this.send( 'sync', { this.send( 'sync', {
...@@ -683,23 +688,26 @@ ...@@ -683,23 +688,26 @@
container: '#customize-preview', container: '#customize-preview',
form: '#customize-controls', form: '#customize-controls',
previewUrl: api.settings.url.preview, previewUrl: api.settings.url.preview,
allowedUrls: api.settings.url.allowed allowedUrls: api.settings.url.allowed,
signature: 'WP_CUSTOMIZER_SIGNATURE'
}, { }, {
nonce: api.settings.nonce,
query: function() { query: function() {
return { return {
wp_customize: 'on', wp_customize: 'on',
theme: api.settings.theme.stylesheet, theme: api.settings.theme.stylesheet,
customized: JSON.stringify( api.get() ) customized: JSON.stringify( api.get() ),
nonce: this.nonce.preview
}; };
}, },
nonce: $('#_wpnonce').val(),
save: function() { save: function() {
var self = this, var self = this,
query = $.extend( this.query(), { query = $.extend( this.query(), {
action: 'customize_save', action: 'customize_save',
nonce: this.nonce nonce: this.nonce.save
}), }),
request = $.post( api.settings.url.ajax, query ); request = $.post( api.settings.url.ajax, query );
...@@ -733,6 +741,11 @@ ...@@ -733,6 +741,11 @@
} }
}); });
// Refresh the nonces if the preview sends updated nonces over.
previewer.bind( 'nonce', function( nonce ) {
$.extend( this.nonce, nonce );
});
$.each( api.settings.settings, function( id, data ) { $.each( api.settings.settings, function( id, data ) {
api.create( id, id, data.value, { api.create( id, id, data.value, {
transport: data.transport, transport: data.transport,
......
This diff is collapsed.
...@@ -51,6 +51,11 @@ function is_lighttpd_before_150() {} ...@@ -51,6 +51,11 @@ function is_lighttpd_before_150() {}
*/ */
function add_action() {} function add_action() {}
/**
* @ignore
*/
function did_action() {}
/** /**
* @ignore * @ignore
*/ */
......
...@@ -20,7 +20,7 @@ if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) { ...@@ -20,7 +20,7 @@ if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) {
$theme = wp_get_theme( $_GET['stylesheet'] ); $theme = wp_get_theme( $_GET['stylesheet'] );
if ( ! $theme->exists() || ! $theme->is_allowed() ) if ( ! $theme->exists() || ! $theme->is_allowed() )
wp_die( __( 'Cheatin&#8217; uh?' ) ); wp_die( __( 'Cheatin&#8217; uh?' ) );
switch_theme($_GET['template'], $_GET['stylesheet']); switch_theme( $theme->get_template(), $theme->get_stylesheet() );
wp_redirect( admin_url('themes.php?activated=true') ); wp_redirect( admin_url('themes.php?activated=true') );
exit; exit;
} elseif ( 'delete' == $_GET['action'] ) { } elseif ( 'delete' == $_GET['action'] ) {
...@@ -64,6 +64,8 @@ if ( current_user_can( 'install_themes' ) ) { ...@@ -64,6 +64,8 @@ if ( current_user_can( 'install_themes' ) ) {
) ); ) );
} }
add_thickbox();
endif; // switch_themes endif; // switch_themes
if ( current_user_can( 'edit_theme_options' ) ) { if ( current_user_can( 'edit_theme_options' ) ) {
......
...@@ -100,7 +100,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) { ...@@ -100,7 +100,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
} }
if ( ! $redirect_url ) { if ( ! $redirect_url ) {
if ( $redirect_url = redirect_guess_404_permalink( $requested_url ) ) { if ( $redirect_url = redirect_guess_404_permalink() ) {
$redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'page', 'feed', 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ), $redirect_url ); $redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'page', 'feed', 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ), $redirect_url );
} }
} }
...@@ -461,31 +461,16 @@ function _remove_qs_args_if_not_in_url( $query_string, Array $args_to_check, $ur ...@@ -461,31 +461,16 @@ function _remove_qs_args_if_not_in_url( $query_string, Array $args_to_check, $ur
} }
/** /**
* Attempts to guess the correct URL from the current URL (that produced a 404) or * Attempts to guess the correct URL based on query vars
* the current query variables.
* *
* @since 2.3.0 * @since 2.3.0
* @uses $wpdb * @uses $wpdb
* *
* @param string $current_url Optional. The URL that has 404'd.
* @return bool|string The correct URL if one is found. False on failure. * @return bool|string The correct URL if one is found. False on failure.
*/ */
function redirect_guess_404_permalink( $current_url = '' ) { function redirect_guess_404_permalink() {
global $wpdb, $wp_rewrite; global $wpdb, $wp_rewrite;
if ( ! empty( $current_url ) )
$parsed_url = @parse_url( $current_url );
// Attempt to redirect bare category slugs if the permalink structure starts
// with the %category% tag.
if ( isset( $parsed_url['path'] )
&& preg_match( '#^[^%]+%category%#', $wp_rewrite->permalink_structure )
&& $cat = get_category_by_path( $parsed_url['path'] )
) {
if ( ! is_wp_error( $cat ) )
return get_term_link( $cat );
}
if ( get_query_var('name') ) { if ( get_query_var('name') ) {
$where = $wpdb->prepare("post_name LIKE %s", like_escape( get_query_var('name') ) . '%'); $where = $wpdb->prepare("post_name LIKE %s", like_escape( get_query_var('name') ) . '%');
......
...@@ -1130,6 +1130,8 @@ function map_meta_cap( $cap, $user_id ) { ...@@ -1130,6 +1130,8 @@ function map_meta_cap( $cap, $user_id ) {
// Disallow unfiltered_html for all users, even admins and super admins. // Disallow unfiltered_html for all users, even admins and super admins.
if ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML ) if ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML )
$caps[] = 'do_not_allow'; $caps[] = 'do_not_allow';
elseif ( is_multisite() && ! is_super_admin( $user_id ) )
$caps[] = $cap;
else else
$caps[] = $cap; $caps[] = $cap;
break; break;
......
...@@ -760,13 +760,13 @@ class PHPMailer { ...@@ -760,13 +760,13 @@ class PHPMailer {
} else { } else {
if ($this->SingleTo === true && count($toArr) > 1) { if ($this->SingleTo === true && count($toArr) > 1) {
foreach ($toArr as $key => $val) { foreach ($toArr as $key => $val) {
$rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header);
// implement call back function if it exists // implement call back function if it exists
$isSent = ($rt == 1) ? 1 : 0; $isSent = ($rt == 1) ? 1 : 0;
$this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body); $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body);
} }
} else { } else {
$rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header);
// implement call back function if it exists // implement call back function if it exists
$isSent = ($rt == 1) ? 1 : 0; $isSent = ($rt == 1) ? 1 : 0;
$this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body); $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body);
......
...@@ -17,6 +17,8 @@ final class WP_Customize_Manager { ...@@ -17,6 +17,8 @@ final class WP_Customize_Manager {
protected $sections = array(); protected $sections = array();
protected $controls = array(); protected $controls = array();
protected $nonce_tick;
protected $customized; protected $customized;