<!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>[17823] trunk/wp-includes/class-wp-xmlrpc-server.php: Use static strings.</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://trac.wordpress.org/changeset/17823">17823</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2011-05-06 19:51:47 +0000 (Fri, 06 May 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>Use static strings. Props niallkennedy. fixes <a href="http://trac.wordpress.org/ticket/17169">#17169</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesclasswpxmlrpcserverphp">trunk/wp-includes/class-wp-xmlrpc-server.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesclasswpxmlrpcserverphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/class-wp-xmlrpc-server.php (17822 => 17823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class-wp-xmlrpc-server.php        2011-05-06 19:48:13 UTC (rev 17822)
+++ trunk/wp-includes/class-wp-xmlrpc-server.php        2011-05-06 19:51:47 UTC (rev 17823)
</span><span class="lines">@@ -475,7 +475,7 @@
</span><span class="cx">                 $page = get_page($page_id);
</span><span class="cx">
</span><span class="cx">                 // If we found the page then format the data.
</span><del>-                if ( $page->ID && ($page->post_type == "page") ) {
</del><ins>+                if ( $page->ID && ($page->post_type == 'page') ) {
</ins><span class="cx">                         // Get all of the page content and link.
</span><span class="cx">                         $full_page = get_extended($page->post_content);
</span><span class="cx">                         $link = post_permalink($page->ID);
</span><span class="lines">@@ -492,8 +492,8 @@
</span><span class="cx">                         $allow_pings = pings_open($page->ID) ? 1 : 0;
</span><span class="cx">
</span><span class="cx">                         // Format page date.
</span><del>-                        $page_date = mysql2date("Ymd\TH:i:s", $page->post_date, false);
-                        $page_date_gmt = mysql2date("Ymd\TH:i:s", $page->post_date_gmt, false);
</del><ins>+                        $page_date = mysql2date('Ymd\TH:i:s', $page->post_date, false);
+                        $page_date_gmt = mysql2date('Ymd\TH:i:s', $page->post_date_gmt, false);
</ins><span class="cx">
</span><span class="cx">                         // For drafts use the GMT version of the date
</span><span class="cx">                         if ( $page->post_status == 'draft' )
</span><span class="lines">@@ -513,37 +513,37 @@
</span><span class="cx">                                 $page_template = 'default';
</span><span class="cx">
</span><span class="cx">                         $page_struct = array(
</span><del>-                                "dateCreated"                        => new IXR_Date($page_date),
-                                "userid"                                => $page->post_author,
-                                "page_id"                                => $page->ID,
-                                "page_status"                        => $page->post_status,
-                                "description"                        => $full_page["main"],
-                                "title"                                        => $page->post_title,
-                                "link"                                        => $link,
-                                "permaLink"                                => $link,
-                                "categories"                        => $categories,
-                                "excerpt"                                => $page->post_excerpt,
-                                "text_more"                                => $full_page["extended"],
-                                "mt_allow_comments"                => $allow_comments,
-                                "mt_allow_pings"                => $allow_pings,
-                                "wp_slug"                                => $page->post_name,
-                                "wp_password"                        => $page->post_password,
-                                "wp_author"                                => $author->display_name,
-                                "wp_page_parent_id"                => $page->post_parent,
-                                "wp_page_parent_title"        => $parent_title,
-                                "wp_page_order"                        => $page->menu_order,
-                                "wp_author_id"                        => $author->ID,
-                                "wp_author_display_name"        => $author->display_name,
-                                "date_created_gmt"                => new IXR_Date($page_date_gmt),
-                                "custom_fields"                        => $this->get_custom_fields($page_id),
-                                "wp_page_template"                => $page_template
</del><ins>+                                'dateCreated'                        => new IXR_Date($page_date),
+                                'userid'                                => $page->post_author,
+                                'page_id'                                => $page->ID,
+                                'page_status'                        => $page->post_status,
+                                'description'                        => $full_page['main'],
+                                'title'                                        => $page->post_title,
+                                'link'                                        => $link,
+                                'permaLink'                                => $link,
+                                'categories'                        => $categories,
+                                'excerpt'                                => $page->post_excerpt,
+                                'text_more'                                => $full_page['extended'],
+                                'mt_allow_comments'                => $allow_comments,
+                                'mt_allow_pings'                => $allow_pings,
+                                'wp_slug'                                => $page->post_name,
+                                'wp_password'                        => $page->post_password,
+                                'wp_author'                                => $author->display_name,
+                                'wp_page_parent_id'                => $page->post_parent,
+                                'wp_page_parent_title'        => $parent_title,
+                                'wp_page_order'                        => $page->menu_order,
+                                'wp_author_id'                        => $author->ID,
+                                'wp_author_display_name'        => $author->display_name,
+                                'date_created_gmt'                => new IXR_Date($page_date_gmt),
+                                'custom_fields'                        => $this->get_custom_fields($page_id),
+                                'wp_page_template'                => $page_template
</ins><span class="cx">                         );
</span><span class="cx">
</span><span class="cx">                         return($page_struct);
</span><span class="cx">                 }
</span><span class="cx">                 // If the page doesn't exist indicate that.
</span><span class="cx">                 else {
</span><del>-                        return(new IXR_Error(404, __("Sorry, no such page.")));
</del><ins>+                        return(new IXR_Error(404, __('Sorry, no such page.')));
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -618,11 +618,11 @@
</span><span class="cx">                 do_action('xmlrpc_call', 'wp.newPage');
</span><span class="cx">
</span><span class="cx">                 // Make sure the user is allowed to add new pages.
</span><del>-                if ( !current_user_can("publish_pages") )
-                        return(new IXR_Error(401, __("Sorry, you cannot add new pages.")));
</del><ins>+                if ( !current_user_can('publish_pages') )
+                        return(new IXR_Error(401, __('Sorry, you cannot add new pages.')));
</ins><span class="cx">
</span><span class="cx">                 // Mark this as content for a page.
</span><del>-                $args[3]["post_type"] = "page";
</del><ins>+                $args[3]["post_type"] = 'page';
</ins><span class="cx">
</span><span class="cx">                 // Let mw_newPost do all of the heavy lifting.
</span><span class="cx">                 return($this->mw_newPost($args));
</span><span class="lines">@@ -652,17 +652,17 @@
</span><span class="cx">                 // Get the current page based on the page_id and
</span><span class="cx">                 // make sure it is a page and not a post.
</span><span class="cx">                 $actual_page = wp_get_single_post($page_id, ARRAY_A);
</span><del>-                if ( !$actual_page || ($actual_page["post_type"] != "page") )
-                        return(new IXR_Error(404, __("Sorry, no such page.")));
</del><ins>+                if ( !$actual_page || ($actual_page['post_type'] != 'page') )
+                        return(new IXR_Error(404, __('Sorry, no such page.')));
</ins><span class="cx">
</span><span class="cx">                 // Make sure the user can delete pages.
</span><del>-                if ( !current_user_can("delete_page", $page_id) )
-                        return(new IXR_Error(401, __("Sorry, you do not have the right to delete this page.")));
</del><ins>+                if ( !current_user_can('delete_page', $page_id) )
+                        return(new IXR_Error(401, __('Sorry, you do not have the right to delete this page.')));
</ins><span class="cx">
</span><span class="cx">                 // Attempt to delete the page.
</span><span class="cx">                 $result = wp_delete_post($page_id);
</span><span class="cx">                 if ( !$result )
</span><del>-                        return(new IXR_Error(500, __("Failed to delete the page.")));
</del><ins>+                        return(new IXR_Error(500, __('Failed to delete the page.')));
</ins><span class="cx">
</span><span class="cx">                 return(true);
</span><span class="cx">         }
</span><span class="lines">@@ -691,15 +691,15 @@
</span><span class="cx">
</span><span class="cx">                 // Get the page data and make sure it is a page.
</span><span class="cx">                 $actual_page = wp_get_single_post($page_id, ARRAY_A);
</span><del>-                if ( !$actual_page || ($actual_page["post_type"] != "page") )
-                        return(new IXR_Error(404, __("Sorry, no such page.")));
</del><ins>+                if ( !$actual_page || ($actual_page['post_type'] != 'page') )
+                        return(new IXR_Error(404, __('Sorry, no such page.')));
</ins><span class="cx">
</span><span class="cx">                 // Make sure the user is allowed to edit pages.
</span><del>-                if ( !current_user_can("edit_page", $page_id) )
-                        return(new IXR_Error(401, __("Sorry, you do not have the right to edit this page.")));
</del><ins>+                if ( !current_user_can('edit_page', $page_id) )
+                        return(new IXR_Error(401, __('Sorry, you do not have the right to edit this page.')));
</ins><span class="cx">
</span><span class="cx">                 // Mark this as content for a page.
</span><del>-                $content["post_type"] = "page";
</del><ins>+                $content['post_type'] = 'page';
</ins><span class="cx">
</span><span class="cx">                 // Arrange args in the way mw_editPost understands.
</span><span class="cx">                 $args = array(
</span><span class="lines">@@ -755,8 +755,8 @@
</span><span class="cx">                 // The date needs to be formated properly.
</span><span class="cx">                 $num_pages = count($page_list);
</span><span class="cx">                 for ( $i = 0; $i < $num_pages; $i++ ) {
</span><del>-                        $post_date = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date, false);
-                        $post_date_gmt = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date_gmt, false);
</del><ins>+                        $post_date = mysql2date('Ymd\TH:i:s', $page_list[$i]->post_date, false);
+                        $post_date_gmt = mysql2date('Ymd\TH:i:s', $page_list[$i]->post_date_gmt, false);
</ins><span class="cx">
</span><span class="cx">                         $page_list[$i]->dateCreated = new IXR_Date($post_date);
</span><span class="cx">                         $page_list[$i]->date_created_gmt = new IXR_Date($post_date_gmt);
</span><span class="lines">@@ -794,17 +794,17 @@
</span><span class="cx">                 if ( !$user = $this->login($username, $password) )
</span><span class="cx">                         return $this->error;
</span><span class="cx">
</span><del>-                if ( !current_user_can("edit_posts") )
-                        return(new IXR_Error(401, __("Sorry, you cannot edit posts on this site.")));
</del><ins>+                if ( !current_user_can('edit_posts') )
+                        return(new IXR_Error(401, __('Sorry, you cannot edit posts on this site.')));
</ins><span class="cx">
</span><span class="cx">                 do_action('xmlrpc_call', 'wp.getAuthors');
</span><span class="cx">
</span><span class="cx">                 $authors = array();
</span><span class="cx">                 foreach ( get_users( array( 'fields' => array('ID','user_login','display_name') ) ) as $user ) {
</span><span class="cx">                         $authors[] = array(
</span><del>-                                "user_id" => $user->ID,
-                                "user_login" => $user->user_login,
-                                "display_name" => $user->display_name
</del><ins>+                                'user_id' => $user->ID,
+                                'user_login' => $user->user_login,
+                                'display_name' => $user->display_name
</ins><span class="cx">                         );
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -874,28 +874,28 @@
</span><span class="cx">                 do_action('xmlrpc_call', 'wp.newCategory');
</span><span class="cx">
</span><span class="cx">                 // Make sure the user is allowed to add a category.
</span><del>-                if ( !current_user_can("manage_categories") )
-                        return(new IXR_Error(401, __("Sorry, you do not have the right to add a category.")));
</del><ins>+                if ( !current_user_can('manage_categories') )
+                        return(new IXR_Error(401, __('Sorry, you do not have the right to add a category.')));
</ins><span class="cx">
</span><span class="cx">                 // If no slug was provided make it empty so that
</span><span class="cx">                 // WordPress will generate one.
</span><del>-                if ( empty($category["slug"]) )
-                        $category["slug"] = "";
</del><ins>+                if ( empty($category['slug']) )
+                        $category['slug'] = '';
</ins><span class="cx">
</span><span class="cx">                 // If no parent_id was provided make it empty
</span><span class="cx">                 // so that it will be a top level page (no parent).
</span><del>-                if ( !isset($category["parent_id"]) )
-                        $category["parent_id"] = "";
</del><ins>+                if ( !isset($category['parent_id']) )
+                        $category['parent_id'] = '';
</ins><span class="cx">
</span><span class="cx">                 // If no description was provided make it empty.
</span><span class="cx">                 if ( empty($category["description"]) )
</span><span class="cx">                         $category["description"] = "";
</span><span class="cx">
</span><span class="cx">                 $new_category = array(
</span><del>-                        "cat_name"                                => $category["name"],
-                        "category_nicename"                => $category["slug"],
-                        "category_parent"                => $category["parent_id"],
-                        "category_description"        => $category["description"]
</del><ins>+                        'cat_name'                                => $category['name'],
+                        'category_nicename'                => $category['slug'],
+                        'category_parent'                => $category['parent_id'],
+                        'category_description'        => $category['description']
</ins><span class="cx">                 );
</span><span class="cx">
</span><span class="cx">                 $cat_id = wp_insert_category($new_category, true);
</span><span class="lines">@@ -903,9 +903,9 @@
</span><span class="cx">                         if ( 'term_exists' == $cat_id->get_error_code() )
</span><span class="cx">                                 return (int) $cat_id->get_error_data();
</span><span class="cx">                         else
</span><del>-                                return(new IXR_Error(500, __("Sorry, the new category failed.")));
</del><ins>+                                return(new IXR_Error(500, __('Sorry, the new category failed.')));
</ins><span class="cx">                 } elseif ( ! $cat_id ) {
</span><del>-                        return(new IXR_Error(500, __("Sorry, the new category failed.")));
</del><ins>+                        return(new IXR_Error(500, __('Sorry, the new category failed.')));
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 return($cat_id);
</span><span class="lines">@@ -932,8 +932,8 @@
</span><span class="cx">
</span><span class="cx">                 do_action('xmlrpc_call', 'wp.deleteCategory');
</span><span class="cx">
</span><del>-                if ( !current_user_can("manage_categories") )
-                        return new IXR_Error( 401, __( "Sorry, you do not have the right to delete a category." ) );
</del><ins>+                if ( !current_user_can('manage_categories') )
+                        return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete a category.' ) );
</ins><span class="cx">
</span><span class="cx">                 return wp_delete_term( $category_id, 'category' );
</span><span class="cx">         }
</span><span class="lines">@@ -967,8 +967,8 @@
</span><span class="cx">                 $args = array('get' => 'all', 'number' => $max_results, 'name__like' => $category);
</span><span class="cx">                 foreach ( (array) get_categories($args) as $cat ) {
</span><span class="cx">                         $category_suggestions[] = array(
</span><del>-                                "category_id"        => $cat->term_id,
-                                "category_name"        => $cat->name
</del><ins>+                                'category_id'        => $cat->term_id,
+                                'category_name'        => $cat->name
</ins><span class="cx">                         );
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -1003,8 +1003,8 @@
</span><span class="cx">                         return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
</span><span class="cx">
</span><span class="cx">                 // Format page date.
</span><del>-                $comment_date = mysql2date("Ymd\TH:i:s", $comment->comment_date, false);
-                $comment_date_gmt = mysql2date("Ymd\TH:i:s", $comment->comment_date_gmt, false);
</del><ins>+                $comment_date = mysql2date('Ymd\TH:i:s', $comment->comment_date, false);
+                $comment_date_gmt = mysql2date('Ymd\TH:i:s', $comment->comment_date_gmt, false);
</ins><span class="cx">
</span><span class="cx">                 if ( '0' == $comment->comment_approved )
</span><span class="cx">                         $comment_status = 'hold';
</span><span class="lines">@@ -1018,20 +1018,20 @@
</span><span class="cx">                 $link = get_comment_link($comment);
</span><span class="cx">
</span><span class="cx">                 $comment_struct = array(
</span><del>-                        "date_created_gmt"                => new IXR_Date($comment_date_gmt),
-                        "user_id"                                => $comment->user_id,
-                        "comment_id"                        => $comment->comment_ID,
-                        "parent"                                => $comment->comment_parent,
-                        "status"                                => $comment_status,
-                        "content"                                => $comment->comment_content,
-                        "link"                                        => $link,
-                        "post_id"                                => $comment->comment_post_ID,
-                        "post_title"                        => get_the_title($comment->comment_post_ID),
-                        "author"                                => $comment->comment_author,
-                        "author_url"                        => $comment->comment_author_url,
-                        "author_email"                        => $comment->comment_author_email,
-                        "author_ip"                                => $comment->comment_author_IP,
-                        "type"                                        => $comment->comment_type,
</del><ins>+                        'date_created_gmt'                => new IXR_Date($comment_date_gmt),
+                        'user_id'                                => $comment->user_id,
+                        'comment_id'                        => $comment->comment_ID,
+                        'parent'                                => $comment->comment_parent,
+                        'status'                                => $comment_status,
+                        'content'                                => $comment->comment_content,
+                        'link'                                        => $link,
+                        'post_id'                                => $comment->comment_post_ID,
+                        'post_title'                        => get_the_title($comment->comment_post_ID),
+                        'author'                                => $comment->comment_author,
+                        'author_url'                        => $comment->comment_author_url,
+                        'author_email'                        => $comment->comment_author_email,
+                        'author_ip'                                => $comment->comment_author_IP,
+                        'type'                                        => $comment->comment_type,
</ins><span class="cx">                 );
</span><span class="cx">
</span><span class="cx">                 return $comment_struct;
</span><span class="lines">@@ -1373,10 +1373,10 @@
</span><span class="cx">
</span><span class="cx">                 $count = wp_count_comments( $post_id );
</span><span class="cx">                 return array(
</span><del>-                        "approved" => $count->approved,
-                        "awaiting_moderation" => $count->moderated,
-                        "spam" => $count->spam,
-                        "total_comments" => $count->total_comments
</del><ins>+                        'approved' => $count->approved,
+                        'awaiting_moderation' => $count->moderated,
+                        'spam' => $count->spam,
+                        'total_comments' => $count->total_comments
</ins><span class="cx">                 );
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1586,21 +1586,21 @@
</span><span class="cx">                         return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
</span><span class="cx">
</span><span class="cx">                 // Format page date.
</span><del>-                $attachment_date = mysql2date("Ymd\TH:i:s", $attachment->post_date, false);
-                $attachment_date_gmt = mysql2date("Ymd\TH:i:s", $attachment->post_date_gmt, false);
</del><ins>+                $attachment_date = mysql2date('Ymd\TH:i:s', $attachment->post_date, false);
+                $attachment_date_gmt = mysql2date('Ymd\TH:i:s', $attachment->post_date_gmt, false);
</ins><span class="cx">
</span><span class="cx">                 $link = wp_get_attachment_url($attachment->ID);
</span><span class="cx">                 $thumbnail_link = wp_get_attachment_thumb_url($attachment->ID);
</span><span class="cx">
</span><span class="cx">                 $attachment_struct = array(
</span><del>-                        "date_created_gmt"                => new IXR_Date($attachment_date_gmt),
-                        "parent"                                => $attachment->post_parent,
-                        "link"                                        => $link,
-                        "thumbnail"                                => $thumbnail_link,
-                        "title"                                        => $attachment->post_title,
-                        "caption"                                => $attachment->post_excerpt,
-                        "description"                        => $attachment->post_content,
-                        "metadata"                                => wp_get_attachment_metadata($attachment->ID),
</del><ins>+                        'date_created_gmt'                => new IXR_Date($attachment_date_gmt),
+                        'parent'                                => $attachment->post_parent,
+                        'link'                                        => $link,
+                        'thumbnail'                                => $thumbnail_link,
+                        'title'                                        => $attachment->post_title,
+                        'caption'                                => $attachment->post_excerpt,
+                        'description'                        => $attachment->post_content,
+                        'metadata'                                => wp_get_attachment_metadata($attachment->ID),
</ins><span class="cx">                 );
</span><span class="cx">
</span><span class="cx">                 return $attachment_struct;
</span><span class="lines">@@ -2243,39 +2243,39 @@
</span><span class="cx">                 // Let WordPress generate the post_name (slug) unless
</span><span class="cx">                 // one has been provided.
</span><span class="cx">                 $post_name = "";
</span><del>-                if ( isset($content_struct["wp_slug"]) )
-                        $post_name = $content_struct["wp_slug"];
</del><ins>+                if ( isset($content_struct['wp_slug']) )
+                        $post_name = $content_struct['wp_slug'];
</ins><span class="cx">
</span><span class="cx">                 // Only use a password if one was given.
</span><del>-                if ( isset($content_struct["wp_password"]) )
-                        $post_password = $content_struct["wp_password"];
</del><ins>+                if ( isset($content_struct['wp_password']) )
+                        $post_password = $content_struct['wp_password'];
</ins><span class="cx">
</span><span class="cx">                 // Only set a post parent if one was provided.
</span><del>-                if ( isset($content_struct["wp_page_parent_id"]) )
-                        $post_parent = $content_struct["wp_page_parent_id"];
</del><ins>+                if ( isset($content_struct['wp_page_parent_id']) )
+                        $post_parent = $content_struct['wp_page_parent_id'];
</ins><span class="cx">
</span><span class="cx">                 // Only set the menu_order if it was provided.
</span><del>-                if ( isset($content_struct["wp_page_order"]) )
-                        $menu_order = $content_struct["wp_page_order"];
</del><ins>+                if ( isset($content_struct['wp_page_order']) )
+                        $menu_order = $content_struct['wp_page_order'];
</ins><span class="cx">
</span><span class="cx">                 $post_author = $user->ID;
</span><span class="cx">
</span><span class="cx">                 // If an author id was provided then use it instead.
</span><del>-                if ( isset($content_struct["wp_author_id"]) && ($user->ID != $content_struct["wp_author_id"]) ) {
</del><ins>+                if ( isset($content_struct['wp_author_id']) && ($user->ID != $content_struct['wp_author_id']) ) {
</ins><span class="cx">                         switch ( $post_type ) {
</span><span class="cx">                                 case "post":
</span><del>-                                        if ( !current_user_can("edit_others_posts") )
-                                                return(new IXR_Error(401, __("You are not allowed to post as this user")));
</del><ins>+                                        if ( !current_user_can('edit_others_posts') )
+                                                return(new IXR_Error(401, __('You are not allowed to post as this user')));
</ins><span class="cx">                                         break;
</span><span class="cx">                                 case "page":
</span><del>-                                        if ( !current_user_can("edit_others_pages") )
-                                                return(new IXR_Error(401, __("You are not allowed to create pages as this user")));
</del><ins>+                                        if ( !current_user_can('edit_others_pages') )
+                                                return(new IXR_Error(401, __('You are not allowed to create pages as this user')));
</ins><span class="cx">                                         break;
</span><span class="cx">                                 default:
</span><del>-                                        return(new IXR_Error(401, __("Invalid post type.")));
</del><ins>+                                        return(new IXR_Error(401, __('Invalid post type.')));
</ins><span class="cx">                                         break;
</span><span class="cx">                         }
</span><del>-                        $post_author = $content_struct["wp_author_id"];
</del><ins>+                        $post_author = $content_struct['wp_author_id'];
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 $post_title = isset( $content_struct['title'] ) ? $content_struct['title'] : null;
</span><span class="lines">@@ -2302,69 +2302,69 @@
</span><span class="cx">
</span><span class="cx">                 $tags_input = isset($content_struct['mt_keywords']) ? $content_struct['mt_keywords'] : null;
</span><span class="cx">
</span><del>-                if ( isset($content_struct["mt_allow_comments"]) ) {
-                        if ( !is_numeric($content_struct["mt_allow_comments"]) ) {
-                                switch ( $content_struct["mt_allow_comments"] ) {
-                                        case "closed":
-                                                $comment_status = "closed";
</del><ins>+                if ( isset($content_struct['mt_allow_comments']) ) {
+                        if ( !is_numeric($content_struct['mt_allow_comments']) ) {
+                                switch ( $content_struct['mt_allow_comments'] ) {
+                                        case 'closed':
+                                                $comment_status = 'closed';
</ins><span class="cx">                                                 break;
</span><del>-                                        case "open":
-                                                $comment_status = "open";
</del><ins>+                                        case 'open':
+                                                $comment_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $comment_status = get_option("default_comment_status");
</del><ins>+                                                $comment_status = get_option('default_comment_status');
</ins><span class="cx">                                                 break;
</span><span class="cx">                                 }
</span><span class="cx">                         } else {
</span><del>-                                switch ( (int) $content_struct["mt_allow_comments"] ) {
</del><ins>+                                switch ( (int) $content_struct['mt_allow_comments'] ) {
</ins><span class="cx">                                         case 0:
</span><span class="cx">                                         case 2:
</span><del>-                                                $comment_status = "closed";
</del><ins>+                                                $comment_status = 'closed';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         case 1:
</span><del>-                                                $comment_status = "open";
</del><ins>+                                                $comment_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $comment_status = get_option("default_comment_status");
</del><ins>+                                                $comment_status = get_option('default_comment_status');
</ins><span class="cx">                                                 break;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                 } else {
</span><del>-                        $comment_status = get_option("default_comment_status");
</del><ins>+                        $comment_status = get_option('default_comment_status');
</ins><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( isset($content_struct["mt_allow_pings"]) ) {
-                        if ( !is_numeric($content_struct["mt_allow_pings"]) ) {
</del><ins>+                if ( isset($content_struct['mt_allow_pings']) ) {
+                        if ( !is_numeric($content_struct['mt_allow_pings']) ) {
</ins><span class="cx">                                 switch ( $content_struct['mt_allow_pings'] ) {
</span><del>-                                        case "closed":
-                                                $ping_status = "closed";
</del><ins>+                                        case 'closed':
+                                                $ping_status = 'closed';
</ins><span class="cx">                                                 break;
</span><del>-                                        case "open":
-                                                $ping_status = "open";
</del><ins>+                                        case 'open':
+                                                $ping_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $ping_status = get_option("default_ping_status");
</del><ins>+                                                $ping_status = get_option('default_ping_status');
</ins><span class="cx">                                                 break;
</span><span class="cx">                                 }
</span><span class="cx">                         } else {
</span><del>-                                switch ( (int) $content_struct["mt_allow_pings"] ) {
</del><ins>+                                switch ( (int) $content_struct['mt_allow_pings'] ) {
</ins><span class="cx">                                         case 0:
</span><del>-                                                $ping_status = "closed";
</del><ins>+                                                $ping_status = 'closed';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         case 1:
</span><del>-                                                $ping_status = "open";
</del><ins>+                                                $ping_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $ping_status = get_option("default_ping_status");
</del><ins>+                                                $ping_status = get_option('default_ping_status');
</ins><span class="cx">                                                 break;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                 } else {
</span><del>-                        $ping_status = get_option("default_ping_status");
</del><ins>+                        $ping_status = get_option('default_ping_status');
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if ( $post_more )
</span><del>-                        $post_content = $post_content . "<!--more-->" . $post_more;
</del><ins>+                        $post_content = $post_content . '<!--more-->' . $post_more;
</ins><span class="cx">
</span><span class="cx">                 $to_ping = null;
</span><span class="cx">                 if ( isset( $content_struct['mt_tb_ping_urls'] ) ) {
</span><span class="lines">@@ -2551,7 +2551,7 @@
</span><span class="cx">                 // now and return an error. Other wise a new post will be
</span><span class="cx">                 // created (which was the old behavior).
</span><span class="cx">                 if ( empty($postdata["ID"]) )
</span><del>-                        return(new IXR_Error(404, __("Invalid post ID.")));
</del><ins>+                        return(new IXR_Error(404, __('Invalid post ID.')));
</ins><span class="cx">
</span><span class="cx">                 $this->escape($postdata);
</span><span class="cx">                 extract($postdata, EXTR_SKIP);
</span><span class="lines">@@ -2559,93 +2559,93 @@
</span><span class="cx">                 // Let WordPress manage slug if none was provided.
</span><span class="cx">                 $post_name = "";
</span><span class="cx">                 $post_name = $postdata['post_name'];
</span><del>-                if ( isset($content_struct["wp_slug"]) )
-                        $post_name = $content_struct["wp_slug"];
</del><ins>+                if ( isset($content_struct['wp_slug']) )
+                        $post_name = $content_struct['wp_slug'];
</ins><span class="cx">
</span><span class="cx">                 // Only use a password if one was given.
</span><del>-                if ( isset($content_struct["wp_password"]) )
-                        $post_password = $content_struct["wp_password"];
</del><ins>+                if ( isset($content_struct['wp_password']) )
+                        $post_password = $content_struct['wp_password'];
</ins><span class="cx">
</span><span class="cx">                 // Only set a post parent if one was given.
</span><del>-                if ( isset($content_struct["wp_page_parent_id"]) )
-                        $post_parent = $content_struct["wp_page_parent_id"];
</del><ins>+                if ( isset($content_struct['wp_page_parent_id']) )
+                        $post_parent = $content_struct['wp_page_parent_id'];
</ins><span class="cx">
</span><span class="cx">                 // Only set the menu_order if it was given.
</span><del>-                if ( isset($content_struct["wp_page_order"]) )
-                        $menu_order = $content_struct["wp_page_order"];
</del><ins>+                if ( isset($content_struct['wp_page_order']) )
+                        $menu_order = $content_struct['wp_page_order'];
</ins><span class="cx">
</span><del>-                $post_author = $postdata["post_author"];
</del><ins>+                $post_author = $postdata['post_author'];
</ins><span class="cx">
</span><span class="cx">                 // Only set the post_author if one is set.
</span><del>-                if ( isset($content_struct["wp_author_id"]) && ($user->ID != $content_struct["wp_author_id"]) ) {
</del><ins>+                if ( isset($content_struct['wp_author_id']) && ($user->ID != $content_struct['wp_author_id']) ) {
</ins><span class="cx">                         switch ( $post_type ) {
</span><del>-                                case "post":
-                                        if ( !current_user_can("edit_others_posts") )
-                                                return(new IXR_Error(401, __("You are not allowed to change the post author as this user.")));
</del><ins>+                                case 'post':
+                                        if ( !current_user_can('edit_others_posts') )
+                                                return(new IXR_Error(401, __('You are not allowed to change the post author as this user.')));
</ins><span class="cx">                                         break;
</span><del>-                                case "page":
-                                        if ( !current_user_can("edit_others_pages") )
-                                                return(new IXR_Error(401, __("You are not allowed to change the page author as this user.")));
</del><ins>+                                case 'page':
+                                        if ( !current_user_can('edit_others_pages') )
+                                                return(new IXR_Error(401, __('You are not allowed to change the page author as this user.')));
</ins><span class="cx">                                         break;
</span><span class="cx">                                 default:
</span><del>-                                        return(new IXR_Error(401, __("Invalid post type.")));
</del><ins>+                                        return(new IXR_Error(401, __('Invalid post type.')));
</ins><span class="cx">                                         break;
</span><span class="cx">                         }
</span><del>-                        $post_author = $content_struct["wp_author_id"];
</del><ins>+                        $post_author = $content_struct['wp_author_id'];
</ins><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( isset($content_struct["mt_allow_comments"]) ) {
-                        if ( !is_numeric($content_struct["mt_allow_comments"]) ) {
-                                switch ( $content_struct["mt_allow_comments"] ) {
-                                        case "closed":
-                                                $comment_status = "closed";
</del><ins>+                if ( isset($content_struct['mt_allow_comments']) ) {
+                        if ( !is_numeric($content_struct['mt_allow_comments']) ) {
+                                switch ( $content_struct['mt_allow_comments'] ) {
+                                        case 'closed':
+                                                $comment_status = 'closed';
</ins><span class="cx">                                                 break;
</span><del>-                                        case "open":
-                                                $comment_status = "open";
</del><ins>+                                        case 'open':
+                                                $comment_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $comment_status = get_option("default_comment_status");
</del><ins>+                                                $comment_status = get_option('default_comment_status');
</ins><span class="cx">                                                 break;
</span><span class="cx">                                 }
</span><span class="cx">                         } else {
</span><del>-                                switch ( (int) $content_struct["mt_allow_comments"] ) {
</del><ins>+                                switch ( (int) $content_struct['mt_allow_comments'] ) {
</ins><span class="cx">                                         case 0:
</span><span class="cx">                                         case 2:
</span><del>-                                                $comment_status = "closed";
</del><ins>+                                                $comment_status = 'closed';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         case 1:
</span><del>-                                                $comment_status = "open";
</del><ins>+                                                $comment_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $comment_status = get_option("default_comment_status");
</del><ins>+                                                $comment_status = get_option('default_comment_status');
</ins><span class="cx">                                                 break;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( isset($content_struct["mt_allow_pings"]) ) {
-                        if ( !is_numeric($content_struct["mt_allow_pings"]) ) {
-                                switch ( $content_struct["mt_allow_pings"] ) {
-                                        case "closed":
-                                                $ping_status = "closed";
</del><ins>+                if ( isset($content_struct['mt_allow_pings']) ) {
+                        if ( !is_numeric($content_struct['mt_allow_pings']) ) {
+                                switch ( $content_struct['mt_allow_pings'] ) {
+                                        case 'closed':
+                                                $ping_status = 'closed';
</ins><span class="cx">                                                 break;
</span><del>-                                        case "open":
-                                                $ping_status = "open";
</del><ins>+                                        case 'open':
+                                                $ping_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $ping_status = get_option("default_ping_status");
</del><ins>+                                                $ping_status = get_option('default_ping_status');
</ins><span class="cx">                                                 break;
</span><span class="cx">                                 }
</span><span class="cx">                         } else {
</span><span class="cx">                                 switch ( (int) $content_struct["mt_allow_pings"] ) {
</span><span class="cx">                                         case 0:
</span><del>-                                                $ping_status = "closed";
</del><ins>+                                                $ping_status = 'closed';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         case 1:
</span><del>-                                                $ping_status = "open";
</del><ins>+                                                $ping_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $ping_status = get_option("default_ping_status");
</del><ins>+                                                $ping_status = get_option('default_ping_status');
</ins><span class="cx">                                                 break;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="lines">@@ -3062,10 +3062,10 @@
</span><span class="cx">                         return $this->error;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( $upload_err = apply_filters( "pre_upload_error", false ) )
</del><ins>+                if ( $upload_err = apply_filters( 'pre_upload_error', false ) )
</ins><span class="cx">                         return new IXR_Error(500, $upload_err);
</span><span class="cx">
</span><del>-                if ( !empty($data["overwrite"]) && ($data["overwrite"] == true) ) {
</del><ins>+                if ( !empty($data['overwrite']) && ($data['overwrite'] == true) ) {
</ins><span class="cx">                         // Get postmeta info on the object.
</span><span class="cx">                         $old_file = $wpdb->get_row("
</span><span class="cx">                                 SELECT ID
</span><span class="lines">@@ -3079,7 +3079,7 @@
</span><span class="cx">
</span><span class="cx">                         // Make sure the new name is different by pre-pending the
</span><span class="cx">                         // previous post id.
</span><del>-                        $filename = preg_replace("/^wpid\d+-/", "", $name);
</del><ins>+                        $filename = preg_replace('/^wpid\d+-/', '', $name);
</ins><span class="cx">                         $name = "wpid{$old_file->ID}-{$filename}";
</span><span class="cx">                 }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>