<!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>[34333] trunk/src/wp-admin/includes/export.php: Export: Add late-escaping to the contents of several nodes to avoid creating invalid XML and XML parse errors.</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 { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { 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" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/34333">34333</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/34333","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-09-19 18:52:27 +0000 (Sat, 19 Sep 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Export: Add late-escaping to the contents of several nodes to avoid creating invalid XML and XML parse errors.
Props westonruter.
Fixes <a href="https://core.trac.wordpress.org/ticket/33732">#33732</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesexportphp">trunk/src/wp-admin/includes/export.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesexportphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/export.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/export.php 2015-09-19 18:42:45 UTC (rev 34332)
+++ trunk/src/wp-admin/includes/export.php 2015-09-19 18:52:27 UTC (rev 34333)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -283,9 +283,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $authors as $author ) {
</span><span class="cx" style="display: block; padding: 0 10px"> echo "\t<wp:author>";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<wp:author_id>' . $author->ID . '</wp:author_id>';
- echo '<wp:author_login>' . $author->user_login . '</wp:author_login>';
- echo '<wp:author_email>' . $author->user_email . '</wp:author_email>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo '<wp:author_id>' . intval( $author->ID ) . '</wp:author_id>';
+ echo '<wp:author_login>' . wxr_cdata( $author->user_login ) . '</wp:author_login>';
+ echo '<wp:author_email>' . wxr_cdata( $author->user_email ) . '</wp:author_email>';
</ins><span class="cx" style="display: block; padding: 0 10px"> echo '<wp:author_display_name>' . wxr_cdata( $author->display_name ) . '</wp:author_display_name>';
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<wp:author_first_name>' . wxr_cdata( $author->first_name ) . '</wp:author_first_name>';
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<wp:author_last_name>' . wxr_cdata( $author->last_name ) . '</wp:author_last_name>';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -304,7 +304,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $nav_menus as $menu ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "\t<wp:term><wp:term_id>{$menu->term_id}</wp:term_id><wp:term_taxonomy>nav_menu</wp:term_taxonomy><wp:term_slug>{$menu->slug}</wp:term_slug>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo "\t<wp:term>";
+ echo '<wp:term_id>' . intval( $menu->term_id ) . '</wp:term_id>';
+ echo '<wp:term_taxonomy>nav_menu</wp:term_taxonomy>';
+ echo '<wp:term_slug>' . wxr_cdata( $menu->slug ) . '</wp:term_slug>';
</ins><span class="cx" style="display: block; padding: 0 10px"> wxr_term_name( $menu );
</span><span class="cx" style="display: block; padding: 0 10px"> echo "</wp:term>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -383,13 +386,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php wxr_authors_list( $post_ids ); ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php foreach ( $cats as $c ) : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <wp:category><wp:term_id><?php echo $c->term_id ?></wp:term_id><wp:category_nicename><?php echo $c->slug; ?></wp:category_nicename><wp:category_parent><?php echo $c->parent ? $cats[$c->parent]->slug : ''; ?></wp:category_parent><?php wxr_cat_name( $c ); ?><?php wxr_category_description( $c ); ?></wp:category>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <wp:category><wp:term_id><?php echo intval( $c->term_id ); ?></wp:term_id><wp:category_nicename><?php echo wxr_cdata( $c->slug ); ?></wp:category_nicename><wp:category_parent><?php echo wxr_cdata( $c->parent ? $cats[$c->parent]->slug : '' ); ?></wp:category_parent><?php wxr_cat_name( $c ); ?><?php wxr_category_description( $c ); ?></wp:category>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php endforeach; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php foreach ( $tags as $t ) : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <wp:tag><wp:term_id><?php echo $t->term_id ?></wp:term_id><wp:tag_slug><?php echo $t->slug; ?></wp:tag_slug><?php wxr_tag_name( $t ); ?><?php wxr_tag_description( $t ); ?></wp:tag>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <wp:tag><wp:term_id><?php echo intval( $t->term_id ); ?></wp:term_id><wp:tag_slug><?php echo wxr_cdata( $t->slug ); ?></wp:tag_slug><?php wxr_tag_name( $t ); ?><?php wxr_tag_description( $t ); ?></wp:tag>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php endforeach; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php foreach ( $terms as $t ) : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <wp:term><wp:term_id><?php echo $t->term_id ?></wp:term_id><wp:term_taxonomy><?php echo $t->taxonomy; ?></wp:term_taxonomy><wp:term_slug><?php echo $t->slug; ?></wp:term_slug><wp:term_parent><?php echo $t->parent ? $terms[$t->parent]->slug : ''; ?></wp:term_parent><?php wxr_term_name( $t ); ?><?php wxr_term_description( $t ); ?></wp:term>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <wp:term><wp:term_id><?php echo wxr_cdata( $t->term_id ); ?></wp:term_id><wp:term_taxonomy><?php echo wxr_cdata( $t->taxonomy ); ?></wp:term_taxonomy><wp:term_slug><?php echo wxr_cdata( $t->slug ); ?></wp:term_slug><wp:term_parent><?php echo wxr_cdata( $t->parent ? $terms[$t->parent]->slug : '' ); ?></wp:term_parent><?php wxr_term_name( $t ); ?><?php wxr_term_description( $t ); ?></wp:term>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php endforeach; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( 'all' == $args['content'] ) wxr_nav_menu_terms(); ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -447,20 +450,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> echo wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );
</span><span class="cx" style="display: block; padding: 0 10px"> ?></excerpt:encoded>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <wp:post_id><?php echo $post->ID; ?></wp:post_id>
- <wp:post_date><?php echo $post->post_date; ?></wp:post_date>
- <wp:post_date_gmt><?php echo $post->post_date_gmt; ?></wp:post_date_gmt>
- <wp:comment_status><?php echo $post->comment_status; ?></wp:comment_status>
- <wp:ping_status><?php echo $post->ping_status; ?></wp:ping_status>
- <wp:post_name><?php echo $post->post_name; ?></wp:post_name>
- <wp:status><?php echo $post->post_status; ?></wp:status>
- <wp:post_parent><?php echo $post->post_parent; ?></wp:post_parent>
- <wp:menu_order><?php echo $post->menu_order; ?></wp:menu_order>
- <wp:post_type><?php echo $post->post_type; ?></wp:post_type>
- <wp:post_password><?php echo $post->post_password; ?></wp:post_password>
- <wp:is_sticky><?php echo $is_sticky; ?></wp:is_sticky>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <wp:post_id><?php echo intval( $post->ID ); ?></wp:post_id>
+ <wp:post_date><?php echo wxr_cdata( $post->post_date ); ?></wp:post_date>
+ <wp:post_date_gmt><?php echo wxr_cdata( $post->post_date_gmt ); ?></wp:post_date_gmt>
+ <wp:comment_status><?php echo wxr_cdata( $post->comment_status ); ?></wp:comment_status>
+ <wp:ping_status><?php echo wxr_cdata( $post->ping_status ); ?></wp:ping_status>
+ <wp:post_name><?php echo wxr_cdata( $post->post_name ); ?></wp:post_name>
+ <wp:status><?php echo wxr_cdata( $post->post_status ); ?></wp:status>
+ <wp:post_parent><?php echo intval( $post->post_parent ); ?></wp:post_parent>
+ <wp:menu_order><?php echo intval( $post->menu_order ); ?></wp:menu_order>
+ <wp:post_type><?php echo wxr_cdata( $post->post_type ); ?></wp:post_type>
+ <wp:post_password><?php echo wxr_cdata( $post->post_password ); ?></wp:post_password>
+ <wp:is_sticky><?php echo intval( $is_sticky ); ?></wp:is_sticky>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php if ( $post->post_type == 'attachment' ) : ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <wp:attachment_url><?php echo wp_get_attachment_url( $post->ID ); ?></wp:attachment_url>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <wp:attachment_url><?php echo wxr_cdata( wp_get_attachment_url( $post->ID ) ); ?></wp:attachment_url>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php wxr_post_taxonomy(); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php $postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -481,7 +484,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <wp:postmeta>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
</ins><span class="cx" style="display: block; padding: 0 10px"> <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
</span><span class="cx" style="display: block; padding: 0 10px"> </wp:postmeta>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endforeach;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -490,18 +493,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $comments = array_map( 'get_comment', $_comments );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $comments as $c ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <wp:comment>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <wp:comment_id><?php echo intval( $c->comment_ID ); ?></wp:comment_id>
</ins><span class="cx" style="display: block; padding: 0 10px"> <wp:comment_author><?php echo wxr_cdata( $c->comment_author ); ?></wp:comment_author>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <wp:comment_author_email><?php echo $c->comment_author_email; ?></wp:comment_author_email>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <wp:comment_author_email><?php echo wxr_cdata( $c->comment_author_email ); ?></wp:comment_author_email>
</ins><span class="cx" style="display: block; padding: 0 10px"> <wp:comment_author_url><?php echo esc_url_raw( $c->comment_author_url ); ?></wp:comment_author_url>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <wp:comment_author_IP><?php echo $c->comment_author_IP; ?></wp:comment_author_IP>
- <wp:comment_date><?php echo $c->comment_date; ?></wp:comment_date>
- <wp:comment_date_gmt><?php echo $c->comment_date_gmt; ?></wp:comment_date_gmt>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <wp:comment_author_IP><?php echo wxr_cdata( $c->comment_author_IP ); ?></wp:comment_author_IP>
+ <wp:comment_date><?php echo wxr_cdata( $c->comment_date ); ?></wp:comment_date>
+ <wp:comment_date_gmt><?php echo wxr_cdata( $c->comment_date_gmt ); ?></wp:comment_date_gmt>
</ins><span class="cx" style="display: block; padding: 0 10px"> <wp:comment_content><?php echo wxr_cdata( $c->comment_content ) ?></wp:comment_content>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <wp:comment_approved><?php echo $c->comment_approved; ?></wp:comment_approved>
- <wp:comment_type><?php echo $c->comment_type; ?></wp:comment_type>
- <wp:comment_parent><?php echo $c->comment_parent; ?></wp:comment_parent>
- <wp:comment_user_id><?php echo $c->user_id; ?></wp:comment_user_id>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <wp:comment_approved><?php echo wxr_cdata( $c->comment_approved ); ?></wp:comment_approved>
+ <wp:comment_type><?php echo wxr_cdata( $c->comment_type ); ?></wp:comment_type>
+ <wp:comment_parent><?php echo intval( $c->comment_parent ); ?></wp:comment_parent>
+ <wp:comment_user_id><?php echo intval( $c->user_id ); ?></wp:comment_user_id>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php $c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $c_meta as $meta ) :
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -521,7 +524,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <wp:commentmeta>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
</ins><span class="cx" style="display: block; padding: 0 10px"> <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
</span><span class="cx" style="display: block; padding: 0 10px"> </wp:commentmeta>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endforeach; ?>
</span></span></pre>
</div>
</div>
</body>
</html>