From: Edward Z. Yang Date: Sat, 21 Nov 2009 00:38:51 +0000 (-0500) Subject: Wordpress 2.3.3 X-Git-Tag: wordpress-2.3.3 X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/commitdiff_plain/a66f9e26487c560245ef9cd17d7e87c0cbb650af Wordpress 2.3.3 Signed-off-by: Edward Z. Yang --- diff --git a/wp-admin/install-helper.php b/wp-admin/install-helper.php index ecfc91d5..b53376eb 100644 --- a/wp-admin/install-helper.php +++ b/wp-admin/install-helper.php @@ -1,5 +1,5 @@ links, 'link_description', 'varchar(255)')) { } echo ""; */ -?> \ No newline at end of file +?> diff --git a/wp-content/plugins/akismet/akismet.php b/wp-content/plugins/akismet/akismet.php index eac40559..3a434767 100644 --- a/wp-content/plugins/akismet/akismet.php +++ b/wp-content/plugins/akismet/akismet.php @@ -569,7 +569,7 @@ echo "

$r

";

-    +   

diff --git a/wp-includes/gettext.php b/wp-includes/gettext.php index 72558ccf..5b78127c 100644 --- a/wp-includes/gettext.php +++ b/wp-includes/gettext.php @@ -114,7 +114,7 @@ class gettext_reader { $this->STREAM = $Reader; $magic = $this->readint(); - if ($magic == ($MAGIC1 & 0xFFFFFFFF) || $magic == ($MAGIC3 & 0xFFFFFFFF)) { // to make sure it works for 64-bit platforms + if ($magic == $MAGIC1 || $magic == $MAGIC3) { // to make sure it works for 64-bit platforms $this->BYTEORDER = 0; } elseif ($magic == ($MAGIC2 & 0xFFFFFFFF)) { $this->BYTEORDER = 1; diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 32281e67..6cff71d2 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -225,7 +225,6 @@ function wp_mail( $to, $subject, $message, $headers = '' ) { // Set the from name and email $phpmailer->From = apply_filters( 'wp_mail_from', $from_email ); - $phpmailer->Sender = apply_filters( 'wp_mail_from', $from_email ); $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name ); // Set destination address diff --git a/wp-includes/version.php b/wp-includes/version.php index ae3a9442..6459c194 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -2,7 +2,7 @@ // This holds the version number in a separate file so we can bump it without cluttering the SVN -$wp_version = '2.3.2'; +$wp_version = '2.3.3'; $wp_db_version = 6124; ?> diff --git a/xmlrpc.php b/xmlrpc.php index 00fbc384..56d58432 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -975,19 +975,28 @@ class wp_xmlrpc_server extends IXR_Server { if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } - - $cap = ($publish) ? 'publish_posts' : 'edit_posts'; $user = set_current_user(0, $user_login); - if ( !current_user_can($cap) ) - return new IXR_Error(401, __('Sorry, you are not allowed to post on this blog.')); - // The post_type defaults to post, but could also be page. - $post_type = "post"; - if( - !empty($content_struct["post_type"]) - && ($content_struct["post_type"] == "page") - ) { - $post_type = "page"; + $cap = ( $publish ) ? 'publish_posts' : 'edit_posts'; + $error_message = __( 'Sorry, you are not allowed to publish posts on this blog.' ); + $post_type = 'post'; + if( !empty( $content_struct['post_type'] ) ) { + if( $content_struct['post_type'] == 'page' ) { + $cap = ( $publish ) ? 'publish_pages' : 'edit_pages'; + $error_message = __( 'Sorry, you are not allowed to publish pages on this blog.' ); + $post_type = 'page'; + } + elseif( $content_type['post_type'] == 'post' ) { + // This is the default, no changes needed + } + else { + // No other post_type values are allowed here + return new IXR_Error( 401, __( 'Invalid post type.' ) ); + } + } + + if( !current_user_can( $cap ) ) { + return new IXR_Error( 401, $error_message ); } // Let WordPress generate the post_name (slug) unless @@ -1187,21 +1196,29 @@ class wp_xmlrpc_server extends IXR_Server { if (!$this->login_pass_ok($user_login, $user_pass)) { return $this->error; } - $user = set_current_user(0, $user_login); - // The post_type defaults to post, but could also be page. - $post_type = "post"; - if( - !empty($content_struct["post_type"]) - && ($content_struct["post_type"] == "page") - ) { - $post_type = "page"; + $cap = ( $publish ) ? 'publish_posts' : 'edit_posts'; + $error_message = __( 'Sorry, you are not allowed to publish posts on this blog.' ); + $post_type = 'post'; + if( !empty( $content_struct['post_type'] ) ) { + if( $content_struct['post_type'] == 'page' ) { + $cap = ( $publish ) ? 'publish_pages' : 'edit_pages'; + $error_message = __( 'Sorry, you are not allowed to publish pages on this blog.' ); + $post_type = 'page'; + } + elseif( $content_type['post_type'] == 'post' ) { + // This is the default, no changes needed + } + else { + // No other post_type values are allowed here + return new IXR_Error( 401, __( 'Invalid post type.' ) ); + } } - // Edit page caps are checked in editPage. Just check post here. - if ( ( 'post' == $post_type ) && !current_user_can('edit_post', $post_ID) ) - return new IXR_Error(401, __('Sorry, you can not edit this post.')); + if( !current_user_can( $cap ) ) { + return new IXR_Error( 401, $error_message ); + } $postdata = wp_get_single_post($post_ID, ARRAY_A);