<!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-&gt;ID &amp;&amp; ($page-&gt;post_type == &quot;page&quot;) ) {
</del><ins>+                if ( $page-&gt;ID &amp;&amp; ($page-&gt;post_type == 'page') ) {
</ins><span class="cx">                         // Get all of the page content and link.
</span><span class="cx">                         $full_page = get_extended($page-&gt;post_content);
</span><span class="cx">                         $link = post_permalink($page-&gt;ID);
</span><span class="lines">@@ -492,8 +492,8 @@
</span><span class="cx">                         $allow_pings = pings_open($page-&gt;ID) ? 1 : 0;
</span><span class="cx"> 
</span><span class="cx">                         // Format page date.
</span><del>-                        $page_date = mysql2date(&quot;Ymd\TH:i:s&quot;, $page-&gt;post_date, false);
-                        $page_date_gmt = mysql2date(&quot;Ymd\TH:i:s&quot;, $page-&gt;post_date_gmt, false);
</del><ins>+                        $page_date = mysql2date('Ymd\TH:i:s', $page-&gt;post_date, false);
+                        $page_date_gmt = mysql2date('Ymd\TH:i:s', $page-&gt;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-&gt;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>-                                &quot;dateCreated&quot;                        =&gt; new IXR_Date($page_date),
-                                &quot;userid&quot;                                =&gt; $page-&gt;post_author,
-                                &quot;page_id&quot;                                =&gt; $page-&gt;ID,
-                                &quot;page_status&quot;                        =&gt; $page-&gt;post_status,
-                                &quot;description&quot;                        =&gt; $full_page[&quot;main&quot;],
-                                &quot;title&quot;                                        =&gt; $page-&gt;post_title,
-                                &quot;link&quot;                                        =&gt; $link,
-                                &quot;permaLink&quot;                                =&gt; $link,
-                                &quot;categories&quot;                        =&gt; $categories,
-                                &quot;excerpt&quot;                                =&gt; $page-&gt;post_excerpt,
-                                &quot;text_more&quot;                                =&gt; $full_page[&quot;extended&quot;],
-                                &quot;mt_allow_comments&quot;                =&gt; $allow_comments,
-                                &quot;mt_allow_pings&quot;                =&gt; $allow_pings,
-                                &quot;wp_slug&quot;                                =&gt; $page-&gt;post_name,
-                                &quot;wp_password&quot;                        =&gt; $page-&gt;post_password,
-                                &quot;wp_author&quot;                                =&gt; $author-&gt;display_name,
-                                &quot;wp_page_parent_id&quot;                =&gt; $page-&gt;post_parent,
-                                &quot;wp_page_parent_title&quot;        =&gt; $parent_title,
-                                &quot;wp_page_order&quot;                        =&gt; $page-&gt;menu_order,
-                                &quot;wp_author_id&quot;                        =&gt; $author-&gt;ID,
-                                &quot;wp_author_display_name&quot;        =&gt; $author-&gt;display_name,
-                                &quot;date_created_gmt&quot;                =&gt; new IXR_Date($page_date_gmt),
-                                &quot;custom_fields&quot;                        =&gt; $this-&gt;get_custom_fields($page_id),
-                                &quot;wp_page_template&quot;                =&gt; $page_template
</del><ins>+                                'dateCreated'                        =&gt; new IXR_Date($page_date),
+                                'userid'                                =&gt; $page-&gt;post_author,
+                                'page_id'                                =&gt; $page-&gt;ID,
+                                'page_status'                        =&gt; $page-&gt;post_status,
+                                'description'                        =&gt; $full_page['main'],
+                                'title'                                        =&gt; $page-&gt;post_title,
+                                'link'                                        =&gt; $link,
+                                'permaLink'                                =&gt; $link,
+                                'categories'                        =&gt; $categories,
+                                'excerpt'                                =&gt; $page-&gt;post_excerpt,
+                                'text_more'                                =&gt; $full_page['extended'],
+                                'mt_allow_comments'                =&gt; $allow_comments,
+                                'mt_allow_pings'                =&gt; $allow_pings,
+                                'wp_slug'                                =&gt; $page-&gt;post_name,
+                                'wp_password'                        =&gt; $page-&gt;post_password,
+                                'wp_author'                                =&gt; $author-&gt;display_name,
+                                'wp_page_parent_id'                =&gt; $page-&gt;post_parent,
+                                'wp_page_parent_title'        =&gt; $parent_title,
+                                'wp_page_order'                        =&gt; $page-&gt;menu_order,
+                                'wp_author_id'                        =&gt; $author-&gt;ID,
+                                'wp_author_display_name'        =&gt; $author-&gt;display_name,
+                                'date_created_gmt'                =&gt; new IXR_Date($page_date_gmt),
+                                'custom_fields'                        =&gt; $this-&gt;get_custom_fields($page_id),
+                                'wp_page_template'                =&gt; $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, __(&quot;Sorry, no such page.&quot;)));
</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(&quot;publish_pages&quot;) )
-                        return(new IXR_Error(401, __(&quot;Sorry, you cannot add new pages.&quot;)));
</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][&quot;post_type&quot;] = &quot;page&quot;;
</del><ins>+                $args[3][&quot;post_type&quot;] = 'page';
</ins><span class="cx"> 
</span><span class="cx">                 // Let mw_newPost do all of the heavy lifting.
</span><span class="cx">                 return($this-&gt;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[&quot;post_type&quot;] != &quot;page&quot;) )
-                        return(new IXR_Error(404, __(&quot;Sorry, no such page.&quot;)));
</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(&quot;delete_page&quot;, $page_id) )
-                        return(new IXR_Error(401, __(&quot;Sorry, you do not have the right to delete this page.&quot;)));
</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, __(&quot;Failed to delete the page.&quot;)));
</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[&quot;post_type&quot;] != &quot;page&quot;) )
-                        return(new IXR_Error(404, __(&quot;Sorry, no such page.&quot;)));
</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(&quot;edit_page&quot;, $page_id) )
-                        return(new IXR_Error(401, __(&quot;Sorry, you do not have the right to edit this page.&quot;)));
</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[&quot;post_type&quot;] = &quot;page&quot;;
</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 &lt; $num_pages; $i++ ) {
</span><del>-                        $post_date = mysql2date(&quot;Ymd\TH:i:s&quot;, $page_list[$i]-&gt;post_date, false);
-                        $post_date_gmt = mysql2date(&quot;Ymd\TH:i:s&quot;, $page_list[$i]-&gt;post_date_gmt, false);
</del><ins>+                        $post_date = mysql2date('Ymd\TH:i:s', $page_list[$i]-&gt;post_date, false);
+                        $post_date_gmt = mysql2date('Ymd\TH:i:s', $page_list[$i]-&gt;post_date_gmt, false);
</ins><span class="cx"> 
</span><span class="cx">                         $page_list[$i]-&gt;dateCreated = new IXR_Date($post_date);
</span><span class="cx">                         $page_list[$i]-&gt;date_created_gmt = new IXR_Date($post_date_gmt);
</span><span class="lines">@@ -794,17 +794,17 @@
</span><span class="cx">                 if ( !$user = $this-&gt;login($username, $password) )
</span><span class="cx">                         return $this-&gt;error;
</span><span class="cx"> 
</span><del>-                if ( !current_user_can(&quot;edit_posts&quot;) )
-                        return(new IXR_Error(401, __(&quot;Sorry, you cannot edit posts on this site.&quot;)));
</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' =&gt; array('ID','user_login','display_name') ) ) as $user ) {
</span><span class="cx">                         $authors[] = array(
</span><del>-                                &quot;user_id&quot;       =&gt; $user-&gt;ID,
-                                &quot;user_login&quot;    =&gt; $user-&gt;user_login,
-                                &quot;display_name&quot;  =&gt; $user-&gt;display_name
</del><ins>+                                'user_id'       =&gt; $user-&gt;ID,
+                                'user_login'    =&gt; $user-&gt;user_login,
+                                'display_name'  =&gt; $user-&gt;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(&quot;manage_categories&quot;) )
-                        return(new IXR_Error(401, __(&quot;Sorry, you do not have the right to add a category.&quot;)));
</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[&quot;slug&quot;]) )
-                        $category[&quot;slug&quot;] = &quot;&quot;;
</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[&quot;parent_id&quot;]) )
-                        $category[&quot;parent_id&quot;] = &quot;&quot;;
</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[&quot;description&quot;]) )
</span><span class="cx">                         $category[&quot;description&quot;] = &quot;&quot;;
</span><span class="cx"> 
</span><span class="cx">                 $new_category = array(
</span><del>-                        &quot;cat_name&quot;                                =&gt; $category[&quot;name&quot;],
-                        &quot;category_nicename&quot;                =&gt; $category[&quot;slug&quot;],
-                        &quot;category_parent&quot;                =&gt; $category[&quot;parent_id&quot;],
-                        &quot;category_description&quot;        =&gt; $category[&quot;description&quot;]
</del><ins>+                        'cat_name'                                =&gt; $category['name'],
+                        'category_nicename'                =&gt; $category['slug'],
+                        'category_parent'                =&gt; $category['parent_id'],
+                        'category_description'        =&gt; $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-&gt;get_error_code() )
</span><span class="cx">                                 return (int) $cat_id-&gt;get_error_data();
</span><span class="cx">                         else
</span><del>-                                return(new IXR_Error(500, __(&quot;Sorry, the new category failed.&quot;)));
</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, __(&quot;Sorry, the new category failed.&quot;)));
</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(&quot;manage_categories&quot;) )
-                        return new IXR_Error( 401, __( &quot;Sorry, you do not have the right to delete a category.&quot; ) );
</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' =&gt; 'all', 'number' =&gt; $max_results, 'name__like' =&gt; $category);
</span><span class="cx">                 foreach ( (array) get_categories($args) as $cat ) {
</span><span class="cx">                         $category_suggestions[] = array(
</span><del>-                                &quot;category_id&quot;        =&gt; $cat-&gt;term_id,
-                                &quot;category_name&quot;        =&gt; $cat-&gt;name
</del><ins>+                                'category_id'        =&gt; $cat-&gt;term_id,
+                                'category_name'        =&gt; $cat-&gt;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(&quot;Ymd\TH:i:s&quot;, $comment-&gt;comment_date, false);
-                $comment_date_gmt = mysql2date(&quot;Ymd\TH:i:s&quot;, $comment-&gt;comment_date_gmt, false);
</del><ins>+                $comment_date = mysql2date('Ymd\TH:i:s', $comment-&gt;comment_date, false);
+                $comment_date_gmt = mysql2date('Ymd\TH:i:s', $comment-&gt;comment_date_gmt, false);
</ins><span class="cx"> 
</span><span class="cx">                 if ( '0' == $comment-&gt;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>-                        &quot;date_created_gmt&quot;                =&gt; new IXR_Date($comment_date_gmt),
-                        &quot;user_id&quot;                                =&gt; $comment-&gt;user_id,
-                        &quot;comment_id&quot;                        =&gt; $comment-&gt;comment_ID,
-                        &quot;parent&quot;                                =&gt; $comment-&gt;comment_parent,
-                        &quot;status&quot;                                =&gt; $comment_status,
-                        &quot;content&quot;                                =&gt; $comment-&gt;comment_content,
-                        &quot;link&quot;                                        =&gt; $link,
-                        &quot;post_id&quot;                                =&gt; $comment-&gt;comment_post_ID,
-                        &quot;post_title&quot;                        =&gt; get_the_title($comment-&gt;comment_post_ID),
-                        &quot;author&quot;                                =&gt; $comment-&gt;comment_author,
-                        &quot;author_url&quot;                        =&gt; $comment-&gt;comment_author_url,
-                        &quot;author_email&quot;                        =&gt; $comment-&gt;comment_author_email,
-                        &quot;author_ip&quot;                                =&gt; $comment-&gt;comment_author_IP,
-                        &quot;type&quot;                                        =&gt; $comment-&gt;comment_type,
</del><ins>+                        'date_created_gmt'                =&gt; new IXR_Date($comment_date_gmt),
+                        'user_id'                                =&gt; $comment-&gt;user_id,
+                        'comment_id'                        =&gt; $comment-&gt;comment_ID,
+                        'parent'                                =&gt; $comment-&gt;comment_parent,
+                        'status'                                =&gt; $comment_status,
+                        'content'                                =&gt; $comment-&gt;comment_content,
+                        'link'                                        =&gt; $link,
+                        'post_id'                                =&gt; $comment-&gt;comment_post_ID,
+                        'post_title'                        =&gt; get_the_title($comment-&gt;comment_post_ID),
+                        'author'                                =&gt; $comment-&gt;comment_author,
+                        'author_url'                        =&gt; $comment-&gt;comment_author_url,
+                        'author_email'                        =&gt; $comment-&gt;comment_author_email,
+                        'author_ip'                                =&gt; $comment-&gt;comment_author_IP,
+                        'type'                                        =&gt; $comment-&gt;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>-                        &quot;approved&quot; =&gt; $count-&gt;approved,
-                        &quot;awaiting_moderation&quot; =&gt; $count-&gt;moderated,
-                        &quot;spam&quot; =&gt; $count-&gt;spam,
-                        &quot;total_comments&quot; =&gt; $count-&gt;total_comments
</del><ins>+                        'approved' =&gt; $count-&gt;approved,
+                        'awaiting_moderation' =&gt; $count-&gt;moderated,
+                        'spam' =&gt; $count-&gt;spam,
+                        'total_comments' =&gt; $count-&gt;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(&quot;Ymd\TH:i:s&quot;, $attachment-&gt;post_date, false);
-                $attachment_date_gmt = mysql2date(&quot;Ymd\TH:i:s&quot;, $attachment-&gt;post_date_gmt, false);
</del><ins>+                $attachment_date = mysql2date('Ymd\TH:i:s', $attachment-&gt;post_date, false);
+                $attachment_date_gmt = mysql2date('Ymd\TH:i:s', $attachment-&gt;post_date_gmt, false);
</ins><span class="cx"> 
</span><span class="cx">                 $link = wp_get_attachment_url($attachment-&gt;ID);
</span><span class="cx">                 $thumbnail_link = wp_get_attachment_thumb_url($attachment-&gt;ID);
</span><span class="cx"> 
</span><span class="cx">                 $attachment_struct = array(
</span><del>-                        &quot;date_created_gmt&quot;                =&gt; new IXR_Date($attachment_date_gmt),
-                        &quot;parent&quot;                                =&gt; $attachment-&gt;post_parent,
-                        &quot;link&quot;                                        =&gt; $link,
-                        &quot;thumbnail&quot;                                =&gt; $thumbnail_link,
-                        &quot;title&quot;                                        =&gt; $attachment-&gt;post_title,
-                        &quot;caption&quot;                                =&gt; $attachment-&gt;post_excerpt,
-                        &quot;description&quot;                        =&gt; $attachment-&gt;post_content,
-                        &quot;metadata&quot;                                =&gt; wp_get_attachment_metadata($attachment-&gt;ID),
</del><ins>+                        'date_created_gmt'                =&gt; new IXR_Date($attachment_date_gmt),
+                        'parent'                                =&gt; $attachment-&gt;post_parent,
+                        'link'                                        =&gt; $link,
+                        'thumbnail'                                =&gt; $thumbnail_link,
+                        'title'                                        =&gt; $attachment-&gt;post_title,
+                        'caption'                                =&gt; $attachment-&gt;post_excerpt,
+                        'description'                        =&gt; $attachment-&gt;post_content,
+                        'metadata'                                =&gt; wp_get_attachment_metadata($attachment-&gt;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 = &quot;&quot;;
</span><del>-                if ( isset($content_struct[&quot;wp_slug&quot;]) )
-                        $post_name = $content_struct[&quot;wp_slug&quot;];
</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[&quot;wp_password&quot;]) )
-                        $post_password = $content_struct[&quot;wp_password&quot;];
</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[&quot;wp_page_parent_id&quot;]) )
-                        $post_parent = $content_struct[&quot;wp_page_parent_id&quot;];
</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[&quot;wp_page_order&quot;]) )
-                        $menu_order = $content_struct[&quot;wp_page_order&quot;];
</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-&gt;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[&quot;wp_author_id&quot;]) &amp;&amp; ($user-&gt;ID != $content_struct[&quot;wp_author_id&quot;]) ) {
</del><ins>+                if ( isset($content_struct['wp_author_id']) &amp;&amp; ($user-&gt;ID != $content_struct['wp_author_id']) ) {
</ins><span class="cx">                         switch ( $post_type ) {
</span><span class="cx">                                 case &quot;post&quot;:
</span><del>-                                        if ( !current_user_can(&quot;edit_others_posts&quot;) )
-                                                return(new IXR_Error(401, __(&quot;You are not allowed to post as this user&quot;)));
</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 &quot;page&quot;:
</span><del>-                                        if ( !current_user_can(&quot;edit_others_pages&quot;) )
-                                                return(new IXR_Error(401, __(&quot;You are not allowed to create pages as this user&quot;)));
</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, __(&quot;Invalid post type.&quot;)));
</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[&quot;wp_author_id&quot;];
</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[&quot;mt_allow_comments&quot;]) ) {
-                        if ( !is_numeric($content_struct[&quot;mt_allow_comments&quot;]) ) {
-                                switch ( $content_struct[&quot;mt_allow_comments&quot;] ) {
-                                        case &quot;closed&quot;:
-                                                $comment_status = &quot;closed&quot;;
</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 &quot;open&quot;:
-                                                $comment_status = &quot;open&quot;;
</del><ins>+                                        case 'open':
+                                                $comment_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $comment_status = get_option(&quot;default_comment_status&quot;);
</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[&quot;mt_allow_comments&quot;] ) {
</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 = &quot;closed&quot;;
</del><ins>+                                                $comment_status = 'closed';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         case 1:
</span><del>-                                                $comment_status = &quot;open&quot;;
</del><ins>+                                                $comment_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $comment_status = get_option(&quot;default_comment_status&quot;);
</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(&quot;default_comment_status&quot;);
</del><ins>+                        $comment_status = get_option('default_comment_status');
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if ( isset($content_struct[&quot;mt_allow_pings&quot;]) ) {
-                        if ( !is_numeric($content_struct[&quot;mt_allow_pings&quot;]) ) {
</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 &quot;closed&quot;:
-                                                $ping_status = &quot;closed&quot;;
</del><ins>+                                        case 'closed':
+                                                $ping_status = 'closed';
</ins><span class="cx">                                                 break;
</span><del>-                                        case &quot;open&quot;:
-                                                $ping_status = &quot;open&quot;;
</del><ins>+                                        case 'open':
+                                                $ping_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $ping_status = get_option(&quot;default_ping_status&quot;);
</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[&quot;mt_allow_pings&quot;] ) {
</del><ins>+                                switch ( (int) $content_struct['mt_allow_pings'] ) {
</ins><span class="cx">                                         case 0:
</span><del>-                                                $ping_status = &quot;closed&quot;;
</del><ins>+                                                $ping_status = 'closed';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         case 1:
</span><del>-                                                $ping_status = &quot;open&quot;;
</del><ins>+                                                $ping_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $ping_status = get_option(&quot;default_ping_status&quot;);
</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(&quot;default_ping_status&quot;);
</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 . &quot;&lt;!--more--&gt;&quot; . $post_more;
</del><ins>+                        $post_content = $post_content . '&lt;!--more--&gt;' . $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[&quot;ID&quot;]) )
</span><del>-                        return(new IXR_Error(404, __(&quot;Invalid post ID.&quot;)));
</del><ins>+                        return(new IXR_Error(404, __('Invalid post ID.')));
</ins><span class="cx"> 
</span><span class="cx">                 $this-&gt;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 = &quot;&quot;;
</span><span class="cx">                 $post_name = $postdata['post_name'];
</span><del>-                if ( isset($content_struct[&quot;wp_slug&quot;]) )
-                        $post_name = $content_struct[&quot;wp_slug&quot;];
</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[&quot;wp_password&quot;]) )
-                        $post_password = $content_struct[&quot;wp_password&quot;];
</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[&quot;wp_page_parent_id&quot;]) )
-                        $post_parent = $content_struct[&quot;wp_page_parent_id&quot;];
</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[&quot;wp_page_order&quot;]) )
-                        $menu_order = $content_struct[&quot;wp_page_order&quot;];
</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[&quot;post_author&quot;];
</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[&quot;wp_author_id&quot;]) &amp;&amp; ($user-&gt;ID != $content_struct[&quot;wp_author_id&quot;]) ) {
</del><ins>+                if ( isset($content_struct['wp_author_id']) &amp;&amp; ($user-&gt;ID != $content_struct['wp_author_id']) ) {
</ins><span class="cx">                         switch ( $post_type ) {
</span><del>-                                case &quot;post&quot;:
-                                        if ( !current_user_can(&quot;edit_others_posts&quot;) )
-                                                return(new IXR_Error(401, __(&quot;You are not allowed to change the post author as this user.&quot;)));
</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 &quot;page&quot;:
-                                        if ( !current_user_can(&quot;edit_others_pages&quot;) )
-                                                return(new IXR_Error(401, __(&quot;You are not allowed to change the page author as this user.&quot;)));
</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, __(&quot;Invalid post type.&quot;)));
</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[&quot;wp_author_id&quot;];
</del><ins>+                        $post_author = $content_struct['wp_author_id'];
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if ( isset($content_struct[&quot;mt_allow_comments&quot;]) ) {
-                        if ( !is_numeric($content_struct[&quot;mt_allow_comments&quot;]) ) {
-                                switch ( $content_struct[&quot;mt_allow_comments&quot;] ) {
-                                        case &quot;closed&quot;:
-                                                $comment_status = &quot;closed&quot;;
</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 &quot;open&quot;:
-                                                $comment_status = &quot;open&quot;;
</del><ins>+                                        case 'open':
+                                                $comment_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $comment_status = get_option(&quot;default_comment_status&quot;);
</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[&quot;mt_allow_comments&quot;] ) {
</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 = &quot;closed&quot;;
</del><ins>+                                                $comment_status = 'closed';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         case 1:
</span><del>-                                                $comment_status = &quot;open&quot;;
</del><ins>+                                                $comment_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $comment_status = get_option(&quot;default_comment_status&quot;);
</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[&quot;mt_allow_pings&quot;]) ) {
-                        if ( !is_numeric($content_struct[&quot;mt_allow_pings&quot;]) ) {
-                                switch ( $content_struct[&quot;mt_allow_pings&quot;] ) {
-                                        case &quot;closed&quot;:
-                                                $ping_status = &quot;closed&quot;;
</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 &quot;open&quot;:
-                                                $ping_status = &quot;open&quot;;
</del><ins>+                                        case 'open':
+                                                $ping_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $ping_status = get_option(&quot;default_ping_status&quot;);
</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[&quot;mt_allow_pings&quot;] ) {
</span><span class="cx">                                         case 0:
</span><del>-                                                $ping_status = &quot;closed&quot;;
</del><ins>+                                                $ping_status = 'closed';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         case 1:
</span><del>-                                                $ping_status = &quot;open&quot;;
</del><ins>+                                                $ping_status = 'open';
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         default:
</span><del>-                                                $ping_status = get_option(&quot;default_ping_status&quot;);
</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-&gt;error;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if ( $upload_err = apply_filters( &quot;pre_upload_error&quot;, 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[&quot;overwrite&quot;]) &amp;&amp; ($data[&quot;overwrite&quot;] == true) ) {
</del><ins>+                if ( !empty($data['overwrite']) &amp;&amp; ($data['overwrite'] == true) ) {
</ins><span class="cx">                         // Get postmeta info on the object.
</span><span class="cx">                         $old_file = $wpdb-&gt;get_row(&quot;
</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(&quot;/^wpid\d+-/&quot;, &quot;&quot;, $name);
</del><ins>+                        $filename = preg_replace('/^wpid\d+-/', '', $name);
</ins><span class="cx">                         $name = &quot;wpid{$old_file-&gt;ID}-{$filename}&quot;;
</span><span class="cx">                 }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>