<!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>[Tests][1215] trunk: Update for [WP23416]</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://core.trac.wordpress.org/changeset/1215/tests">1215</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2013-02-14 22:51:37 +0000 (Thu, 14 Feb 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update for [WP23416]</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkincludesfactoryphp">trunk/includes/factory.php</a></li>
<li><a href="#trunktestsadminincludesMiscphp">trunk/tests/admin/includesMisc.php</a></li>
<li><a href="#trunktestsmetaphp">trunk/tests/meta.php</a></li>
<li><a href="#trunktestspostmetaphp">trunk/tests/post/meta.php</a></li>
<li><a href="#trunktestspostslashesphp">trunk/tests/post/slashes.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkincludesfactoryphp"></a>
<div class="modfile"><h4>Modified: trunk/includes/factory.php (1214 => 1215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/includes/factory.php        2013-02-14 16:43:55 UTC (rev 1214)
+++ trunk/includes/factory.php        2013-02-14 22:51:37 UTC (rev 1215)
</span><span class="lines">@@ -77,12 +77,12 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function create_object( $args ) {
</span><del>-                return wp_insert_comment( $this-&gt;addslashes_deep( $args ) );
</del><ins>+                return wp_insert_comment( $args );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function update_object( $comment_id, $fields ) {
</span><span class="cx">                 $fields['comment_ID'] = $comment_id;
</span><del>-                return wp_update_comment( $this-&gt;addslashes_deep( $fields ) );
</del><ins>+                return wp_update_comment( $fields );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function create_post_comments( $post_id, $count = 1, $args = array(), $generation_definitions = null ) {
</span></span></pre></div>
<a id="trunktestsadminincludesMiscphp"></a>
<div class="modfile"><h4>Modified: trunk/tests/admin/includesMisc.php (1214 => 1215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/admin/includesMisc.php        2013-02-14 16:43:55 UTC (rev 1214)
+++ trunk/tests/admin/includesMisc.php        2013-02-14 22:51:37 UTC (rev 1215)
</span><span class="lines">@@ -6,9 +6,8 @@
</span><span class="cx"> class Tests_Admin_includesMisc extends WP_UnitTestCase {
</span><span class="cx">         function test_shorten_url() {
</span><span class="cx">                 $tests = array(
</span><del>-                        // strip slashes
-                        'wordpress\.org/about/philosophy'
-                                =&gt; 'wordpress.org/about/philosophy', // strip slashes
</del><ins>+                        'wordpress.org/about/philosophy'
+                                =&gt; 'wordpress.org/about/philosophy',
</ins><span class="cx">                         'http://wordpress.org/about/philosophy/'
</span><span class="cx">                                 =&gt; 'wordpress.org/about/philosophy', // remove http, trailing slash
</span><span class="cx">                         'http://www.wordpress.org/about/philosophy/'
</span></span></pre></div>
<a id="trunktestsmetaphp"></a>
<div class="modfile"><h4>Modified: trunk/tests/meta.php (1214 => 1215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/meta.php        2013-02-14 16:43:55 UTC (rev 1214)
+++ trunk/tests/meta.php        2013-02-14 22:51:37 UTC (rev 1215)
</span><span class="lines">@@ -124,9 +124,11 @@
</span><span class="cx">         function test_metadata_slashes() {
</span><span class="cx">                 $key = rand_str();
</span><span class="cx">                 $value = 'Test\\singleslash';
</span><del>-                $expected = 'Testsingleslash';
</del><ins>+                $expected = 'Test\\singleslash';
</ins><span class="cx">                 $value2 = 'Test\\\\doubleslash';
</span><del>-                $expected2 = 'Test\\doubleslash';
</del><ins>+                $expected2 = 'Test\\\\doubleslash';
+                $value3 = 'Test\oneslash';
+                $expected3 = 'Test\oneslash';
</ins><span class="cx">                 $this-&gt;assertFalse( metadata_exists( 'user', $this-&gt;author-&gt;ID, $key ) );
</span><span class="cx">                 $this-&gt;assertFalse( delete_metadata( 'user', $this-&gt;author-&gt;ID, $key ) );
</span><span class="cx">                 $this-&gt;assertSame( '', get_metadata( 'user', $this-&gt;author-&gt;ID, $key, true ) );
</span><span class="lines">@@ -149,5 +151,15 @@
</span><span class="cx">                 $this-&gt;assertSame( '', get_metadata( 'user', $this-&gt;author-&gt;ID, $key, true ) );
</span><span class="cx">                 $this-&gt;assertInternalType( 'int', update_metadata( 'user', $this-&gt;author-&gt;ID, $key, $value2 ) );
</span><span class="cx">                 $this-&gt;assertEquals( $expected2, get_metadata( 'user', $this-&gt;author-&gt;ID, $key, true ) );
</span><ins>+                $this-&gt;assertTrue( delete_metadata( 'user', $this-&gt;author-&gt;ID, $key ) );
+                $this-&gt;assertSame( '', get_metadata( 'user', $this-&gt;author-&gt;ID, $key, true ) );
+                $this-&gt;assertFalse( metadata_exists( 'user', $this-&gt;author-&gt;ID, $key ) );
+
+                $this-&gt;assertInternalType( 'int', add_metadata( 'user', $this-&gt;author-&gt;ID, $key, $value3 ) );
+                $this-&gt;assertEquals( $expected3, get_metadata( 'user', $this-&gt;author-&gt;ID, $key, true ) );
+                $this-&gt;assertTrue( delete_metadata( 'user', $this-&gt;author-&gt;ID, $key ) );
+                $this-&gt;assertSame( '', get_metadata( 'user', $this-&gt;author-&gt;ID, $key, true ) );
+                $this-&gt;assertInternalType( 'int', update_metadata( 'user', $this-&gt;author-&gt;ID, $key, $value3 ) );
+                $this-&gt;assertEquals( $expected3, get_metadata( 'user', $this-&gt;author-&gt;ID, $key, true ) );
</ins><span class="cx">         }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunktestspostmetaphp"></a>
<div class="modfile"><h4>Modified: trunk/tests/post/meta.php (1214 => 1215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/post/meta.php        2013-02-14 16:43:55 UTC (rev 1214)
+++ trunk/tests/post/meta.php        2013-02-14 22:51:37 UTC (rev 1215)
</span><span class="lines">@@ -219,7 +219,7 @@
</span><span class="cx">                 $data = &quot;'quote and \slash&quot;;
</span><span class="cx">                 $this-&gt;assertTrue( update_meta( $mid1, 'unique_update', addslashes( $data ) ) );
</span><span class="cx">                 $meta = get_metadata_by_mid( 'post', $mid1 );
</span><del>-                $this-&gt;assertEquals( $data, $meta-&gt;meta_value );
</del><ins>+                $this-&gt;assertEquals( addslashes( $data ), $meta-&gt;meta_value );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         /**
</span></span></pre></div>
<a id="trunktestspostslashesphp"></a>
<div class="modfile"><h4>Modified: trunk/tests/post/slashes.php (1214 => 1215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/tests/post/slashes.php        2013-02-14 16:43:55 UTC (rev 1214)
+++ trunk/tests/post/slashes.php        2013-02-14 22:51:37 UTC (rev 1215)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">                 $_POST['post_title'] = $this-&gt;slash_1;
</span><span class="cx">                 $_POST['content'] = $this-&gt;slash_5;
</span><span class="cx">                 $_POST['excerpt'] = $this-&gt;slash_7;
</span><del>-                $_POST = add_magic_quotes( $_POST ); // the edit_post() function will strip slashes
</del><ins>+                $_POST = wp_slash( $_POST ); // the edit_post() function will strip slashes
</ins><span class="cx"> 
</span><span class="cx">                 $post_id = edit_post();
</span><span class="cx">                 $post = get_post( $post_id );
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">                 $_POST['post_title'] = $this-&gt;slash_2;
</span><span class="cx">                 $_POST['content'] = $this-&gt;slash_4;
</span><span class="cx">                 $_POST['excerpt'] = $this-&gt;slash_6;
</span><del>-                $_POST = add_magic_quotes( $_POST );
</del><ins>+                $_POST = wp_slash( $_POST );
</ins><span class="cx"> 
</span><span class="cx">                 $post_id = edit_post();
</span><span class="cx">                 $post = get_post( $post_id );
</span></span></pre>
</div>
</div>

</body>
</html>