<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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 #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#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>
<title>[13297] trunk: Use esc_url() instead of clean_url().</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13297">13297</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-02-22 18:15:10 +0000 (Mon, 22 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use esc_url() instead of clean_url(). See <a href="http://trac.wordpress.org/ticket/12309">#12309</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmsphp">trunk/wp-admin/includes/ms.php</a></li>
<li><a href="#trunkwpadminincludesupgradephp">trunk/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunkwpadminmseditphp">trunk/wp-admin/ms-edit.php</a></li>
<li><a href="#trunkwpadminmsusersphp">trunk/wp-admin/ms-users.php</a></li>
<li><a href="#trunkwpincludesclassoembedphp">trunk/wp-includes/class-oembed.php</a></li>
<li><a href="#trunkwpincludesdeprecatedphp">trunk/wp-includes/deprecated.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesmsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ms.php (13296 => 13297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ms.php        2010-02-22 18:12:53 UTC (rev 13296)
+++ trunk/wp-admin/includes/ms.php        2010-02-22 18:15:10 UTC (rev 13297)
</span><span class="lines">@@ -261,7 +261,7 @@
</span><span class="cx"> All at ###SITENAME###
</span><span class="cx"> ###SITEURL###&quot;), $new_admin_email );
</span><span class="cx"> 
</span><del>-        $content = str_replace('###ADMIN_URL###', clean_url(get_option( &quot;siteurl&quot; ).'/wp-admin/options.php?adminhash='.$hash), $content);
</del><ins>+        $content = str_replace('###ADMIN_URL###', esc_url(get_option( &quot;siteurl&quot; ).'/wp-admin/options.php?adminhash='.$hash), $content);
</ins><span class="cx">         $content = str_replace('###EMAIL###', $value, $content);
</span><span class="cx">         $content = str_replace('###SITENAME###', get_site_option( 'site_name' ), $content);
</span><span class="cx">         $content = str_replace('###SITEURL###', 'http://' . $current_site-&gt;domain . $current_site-&gt;path, $content);
</span><span class="lines">@@ -312,7 +312,7 @@
</span><span class="cx"> All at ###SITENAME###
</span><span class="cx"> ###SITEURL###&quot;), $new_user_email );
</span><span class="cx"> 
</span><del>-                $content = str_replace('###ADMIN_URL###', clean_url(get_option( &quot;siteurl&quot; ).'/wp-admin/profile.php?newuseremail='.$hash), $content);
</del><ins>+                $content = str_replace('###ADMIN_URL###', esc_url(get_option( &quot;siteurl&quot; ).'/wp-admin/profile.php?newuseremail='.$hash), $content);
</ins><span class="cx">                 $content = str_replace('###EMAIL###', $_POST[ 'email' ], $content);
</span><span class="cx">                 $content = str_replace('###SITENAME###', get_site_option( 'site_name' ), $content);
</span><span class="cx">                 $content = str_replace('###SITEURL###', 'http://' . $current_site-&gt;domain . $current_site-&gt;path, $content);
</span></span></pre></div>
<a id="trunkwpadminincludesupgradephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/upgrade.php (13296 => 13297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/upgrade.php        2010-02-22 18:12:53 UTC (rev 13296)
+++ trunk/wp-admin/includes/upgrade.php        2010-02-22 18:15:10 UTC (rev 13297)
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx">                 if ( empty($first_post) )
</span><span class="cx">                         $first_post = stripslashes( __( 'Welcome to &lt;a href=&quot;SITE_URL&quot;&gt;SITE_NAME&lt;/a&gt;. This is your first post. Edit or delete it, then start blogging!' ) );
</span><span class="cx"> 
</span><del>-                $first_post = str_replace( &quot;SITE_URL&quot;, clean_url(&quot;http://&quot; . $current_site-&gt;domain . $current_site-&gt;path), $first_post );
</del><ins>+                $first_post = str_replace( &quot;SITE_URL&quot;, esc_url(&quot;http://&quot; . $current_site-&gt;domain . $current_site-&gt;path), $first_post );
</ins><span class="cx">                 $first_post = str_replace( &quot;SITE_NAME&quot;, $current_site-&gt;site_name, $first_post );
</span><span class="cx">         } else {
</span><span class="cx">                 $first_post = __('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!');
</span></span></pre></div>
<a id="trunkwpadminmseditphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-edit.php (13296 => 13297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-edit.php        2010-02-22 18:12:53 UTC (rev 13296)
+++ trunk/wp-admin/ms-edit.php        2010-02-22 18:15:10 UTC (rev 13297)
</span><span class="lines">@@ -397,7 +397,7 @@
</span><span class="cx">         // Common
</span><span class="cx">         case &quot;confirm&quot;:
</span><span class="cx">                 $referrer = ( isset($_GET['ref']) ) ? stripslashes($_GET['ref']) : $_SERVER['HTTP_REFERER'];
</span><del>-                $referrer = clean_url($referrer);
</del><ins>+                $referrer = esc_url($referrer);
</ins><span class="cx">                 if ( !headers_sent() ) {
</span><span class="cx">                         nocache_headers();
</span><span class="cx">                         header( 'Content-Type: text/html; charset=utf-8' );
</span></span></pre></div>
<a id="trunkwpadminmsusersphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-users.php (13296 => 13297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-users.php        2010-02-22 18:12:53 UTC (rev 13296)
+++ trunk/wp-admin/ms-users.php        2010-02-22 18:15:10 UTC (rev 13297)
</span><span class="lines">@@ -180,9 +180,9 @@
</span><span class="cx"> 
</span><span class="cx">                                                         case 'login':
</span><span class="cx">                                                                 $avatar        = get_avatar( $user['user_email'], 32 );
</span><del>-                                                                $edit        = clean_url( add_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), &quot;user-edit.php?user_id=&quot;.$user['ID'] ) );
</del><ins>+                                                                $edit        = esc_url( add_query_arg( 'wp_http_referer', urlencode( esc_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), &quot;user-edit.php?user_id=&quot;.$user['ID'] ) );
</ins><span class="cx">                                                                 // @todo Make delete link work like delete button with transfering users (in ms-edit.php)
</span><del>-                                                                //$delete        = clean_url( add_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), wp_nonce_url( 'ms-edit.php', 'deleteuser' ) . '&amp;amp;action=deleteuser&amp;amp;id=' . $user['ID'] ) );
</del><ins>+                                                                //$delete        = esc_url( add_query_arg( 'wp_http_referer', urlencode( esc_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), wp_nonce_url( 'ms-edit.php', 'deleteuser' ) . '&amp;amp;action=deleteuser&amp;amp;id=' . $user['ID'] ) );
</ins><span class="cx">                                                                 ?&gt;
</span><span class="cx">                                                                 &lt;td class=&quot;username column-username&quot;&gt;
</span><span class="cx">                                                                         &lt;?php echo $avatar; ?&gt;&lt;strong&gt;&lt;a href=&quot;&lt;?php echo $edit; ?&gt;&quot; class=&quot;edit&quot;&gt;&lt;?php echo stripslashes($user['user_login']); ?&gt;&lt;/a&gt;&lt;/strong&gt;
</span></span></pre></div>
<a id="trunkwpincludesclassoembedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/class-oembed.php (13296 => 13297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class-oembed.php        2010-02-22 18:12:53 UTC (rev 13296)
+++ trunk/wp-includes/class-oembed.php        2010-02-22 18:15:10 UTC (rev 13297)
</span><span class="lines">@@ -215,7 +215,7 @@
</span><span class="cx">                                         return false;
</span><span class="cx"> 
</span><span class="cx">                                 $title = ( !empty($data-&gt;title) ) ? $data-&gt;title : '';
</span><del>-                                $return = '&lt;img src=&quot;' . esc_attr( clean_url( $data-&gt;url ) ) . '&quot; alt=&quot;' . esc_attr($title) . '&quot; width=&quot;' . esc_attr($data-&gt;width) . '&quot; height=&quot;' . esc_attr($data-&gt;height) . '&quot; /&gt;';
</del><ins>+                                $return = '&lt;img src=&quot;' . esc_url( $data-&gt;url ) . '&quot; alt=&quot;' . esc_attr($title) . '&quot; width=&quot;' . esc_attr($data-&gt;width) . '&quot; height=&quot;' . esc_attr($data-&gt;height) . '&quot; /&gt;';
</ins><span class="cx">                                 break;
</span><span class="cx"> 
</span><span class="cx">                         case 'video':
</span><span class="lines">@@ -224,7 +224,7 @@
</span><span class="cx">                                 break;
</span><span class="cx"> 
</span><span class="cx">                         case 'link':
</span><del>-                                $return = ( !empty($data-&gt;title) ) ? '&lt;a href=&quot;' . clean_url($url) . '&quot;&gt;' . esc_html($data-&gt;title) . '&lt;/a&gt;' : false;
</del><ins>+                                $return = ( !empty($data-&gt;title) ) ? '&lt;a href=&quot;' . esc_url($url) . '&quot;&gt;' . esc_html($data-&gt;title) . '&lt;/a&gt;' : false;
</ins><span class="cx">                                 break;
</span><span class="cx"> 
</span><span class="cx">                         default;
</span></span></pre></div>
<a id="trunkwpincludesdeprecatedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/deprecated.php (13296 => 13297)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/deprecated.php        2010-02-22 18:12:53 UTC (rev 13296)
+++ trunk/wp-includes/deprecated.php        2010-02-22 18:15:10 UTC (rev 13297)
</span><span class="lines">@@ -2070,7 +2070,7 @@
</span><span class="cx">  */
</span><span class="cx"> function sanitize_url( $url, $protocols = null ) {
</span><span class="cx">         _deprecated_function( __FUNCTION__, '2.8', 'esc_url_raw()' );
</span><del>-        return clean_url( $url, $protocols, 'db' );
</del><ins>+        return esc_url_raw( $url, $protocols );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre>
</div>
</div>

</body>
</html>