<!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>[14222] trunk/wp-includes/ms-functions.php: Single quotes are way cooler.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14222">14222</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-04-24 17:49:08 +0000 (Sat, 24 Apr 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Single quotes are way cooler.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesmsfunctionsphp">trunk/wp-includes/ms-functions.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesmsfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/ms-functions.php (14221 => 14222)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-functions.php        2010-04-24 17:22:34 UTC (rev 14221)
+++ trunk/wp-includes/ms-functions.php        2010-04-24 17:49:08 UTC (rev 14222)
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function get_most_active_blogs( $num = 10, $display = true ) {
</span><del>-        $most_active = get_site_option( &quot;most_active&quot; );
</del><ins>+        $most_active = get_site_option( 'most_active' );
</ins><span class="cx">         $update = false;
</span><span class="cx">         if ( is_array( $most_active ) ) {
</span><span class="cx">                 if ( ( $most_active['time'] + 60 ) &lt; time() ) { // cache for 60 seconds.
</span><span class="lines">@@ -186,15 +186,15 @@
</span><span class="cx">                         unset( $most_active );
</span><span class="cx">                         $most_active = $t;
</span><span class="cx">                 }
</span><del>-                update_site_option( &quot;most_active&quot;, $most_active );
</del><ins>+                update_site_option( 'most_active', $most_active );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if ( $display == true ) {
</span><span class="cx">                 if ( is_array( $most_active ) ) {
</span><span class="cx">                         reset( $most_active );
</span><span class="cx">                         foreach ( (array) $most_active as $key =&gt; $details ) {
</span><del>-                                $url = esc_url(&quot;http://&quot; . $details['domain'] . $details['path']);
-                                echo &quot;&lt;li&gt;&quot; . $details['postcount'] . &quot; &lt;a href='$url'&gt;$url&lt;/a&gt;&lt;/li&gt;&quot;;
</del><ins>+                                $url = esc_url('http://' . $details['domain'] . $details['path']);
+                                echo '&lt;li&gt;' . $details['postcount'] . &quot; &lt;a href='$url'&gt;$url&lt;/a&gt;&lt;/li&gt;&quot;;
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -204,14 +204,14 @@
</span><span class="cx"> function get_user_count() {
</span><span class="cx">         global $wpdb;
</span><span class="cx"> 
</span><del>-        $count_ts = get_site_option( &quot;user_count_ts&quot; );
</del><ins>+        $count_ts = get_site_option( 'user_count_ts' );
</ins><span class="cx">         if ( time() - $count_ts &gt; 3600 ) {
</span><span class="cx">                 $count = $wpdb-&gt;get_var( $wpdb-&gt;prepare(&quot;SELECT COUNT(ID) as c FROM $wpdb-&gt;users WHERE spam = '0' AND deleted = '0'&quot;) );
</span><del>-                update_site_option( &quot;user_count&quot;, $count );
-                update_site_option( &quot;user_count_ts&quot;, time() );
</del><ins>+                update_site_option( 'user_count', $count );
+                update_site_option( 'user_count_ts', time() );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        $count = get_site_option( &quot;user_count&quot; );
</del><ins>+        $count = get_site_option( 'user_count' );
</ins><span class="cx"> 
</span><span class="cx">         return $count;
</span><span class="cx"> }
</span><span class="lines">@@ -222,14 +222,14 @@
</span><span class="cx">         if ( $id == 0 )
</span><span class="cx">                 $id = $wpdb-&gt;siteid;
</span><span class="cx"> 
</span><del>-        $count_ts = get_site_option( &quot;blog_count_ts&quot; );
</del><ins>+        $count_ts = get_site_option( 'blog_count_ts' );
</ins><span class="cx">         if ( time() - $count_ts &gt; 3600 ) {
</span><span class="cx">                 $count = $wpdb-&gt;get_var( $wpdb-&gt;prepare(&quot;SELECT COUNT(blog_id) as c FROM $wpdb-&gt;blogs WHERE site_id = %d AND spam = '0' AND deleted = '0' and archived = '0'&quot;, $id) );
</span><del>-                update_site_option( &quot;blog_count&quot;, $count );
-                update_site_option( &quot;blog_count_ts&quot;, time() );
</del><ins>+                update_site_option( 'blog_count', $count );
+                update_site_option( 'blog_count_ts', time() );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        $count = get_site_option( &quot;blog_count&quot; );
</del><ins>+        $count = get_site_option( 'blog_count' );
</ins><span class="cx"> 
</span><span class="cx">         return $count;
</span><span class="cx"> }
</span><span class="lines">@@ -237,11 +237,11 @@
</span><span class="cx"> function get_blog_post( $blog_id, $post_id ) {
</span><span class="cx">         global $wpdb;
</span><span class="cx"> 
</span><del>-        $key = $blog_id . &quot;-&quot; . $post_id;
-        $post = wp_cache_get( $key, &quot;global-posts&quot; );
</del><ins>+        $key = $blog_id . '-' . $post_id;
+        $post = wp_cache_get( $key, 'global-posts' );
</ins><span class="cx">         if ( $post == false ) {
</span><del>-                $post = $wpdb-&gt;get_row( $wpdb-&gt;prepare( &quot;SELECT * FROM &quot; . $wpdb-&gt;get_blog_prefix( $blog_id ) . &quot;posts WHERE ID = %d&quot;, $post_id ) );
-                wp_cache_add( $key, $post, &quot;global-posts&quot; );
</del><ins>+                $post = $wpdb-&gt;get_row( $wpdb-&gt;prepare( 'SELECT * FROM ' . $wpdb-&gt;get_blog_prefix( $blog_id ) . 'posts WHERE ID = %d', $post_id ) );
+                wp_cache_add( $key, $post, 'global-posts' );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         return $post;
</span><span class="lines">@@ -396,7 +396,7 @@
</span><span class="cx">         $url = wpmu_admin_redirect_add_updated_param( $url );
</span><span class="cx">         if ( isset( $_GET['redirect'] ) ) {
</span><span class="cx">                 if ( substr( $_GET['redirect'], 0, 2 ) == 's_' )
</span><del>-                        $url .= &quot;&amp;action=blogs&amp;s=&quot;. esc_html( substr( $_GET['redirect'], 2 ) );
</del><ins>+                        $url .= '&amp;action=blogs&amp;s='. esc_html( substr( $_GET['redirect'], 2 ) );
</ins><span class="cx">         } elseif ( isset( $_POST['redirect'] ) ) {
</span><span class="cx">                 $url = wpmu_admin_redirect_add_updated_param( $_POST['redirect'] );
</span><span class="cx">         }
</span><span class="lines">@@ -429,7 +429,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function is_email_address_unsafe( $user_email ) {
</span><del>-        $banned_names = get_site_option( &quot;banned_email_domains&quot; );
</del><ins>+        $banned_names = get_site_option( 'banned_email_domains' );
</ins><span class="cx">         if ($banned_names &amp;&amp; !is_array( $banned_names ))
</span><span class="cx">                 $banned_names = explode( &quot;\n&quot;, $banned_names);
</span><span class="cx"> 
</span><span class="lines">@@ -456,58 +456,58 @@
</span><span class="cx"> 
</span><span class="cx">         $errors = new WP_Error();
</span><span class="cx"> 
</span><del>-        $user_name = preg_replace( &quot;/\s+/&quot;, '', sanitize_user( $user_name, true ) );
</del><ins>+        $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
</ins><span class="cx">         $user_email = sanitize_email( $user_email );
</span><span class="cx"> 
</span><span class="cx">         if ( empty( $user_name ) )
</span><del>-                   $errors-&gt;add('user_name', __(&quot;Please enter a username&quot;));
</del><ins>+                   $errors-&gt;add('user_name', __('Please enter a username'));
</ins><span class="cx"> 
</span><span class="cx">         $maybe = array();
</span><del>-        preg_match( &quot;/[a-z0-9]+/&quot;, $user_name, $maybe );
</del><ins>+        preg_match( '/[a-z0-9]+/', $user_name, $maybe );
</ins><span class="cx"> 
</span><span class="cx">         if ( $user_name != $maybe[0] )
</span><del>-                $errors-&gt;add('user_name', __(&quot;Only lowercase letters and numbers allowed&quot;));
</del><ins>+                $errors-&gt;add('user_name', __('Only lowercase letters and numbers allowed'));
</ins><span class="cx"> 
</span><del>-        $illegal_names = get_site_option( &quot;illegal_names&quot; );
</del><ins>+        $illegal_names = get_site_option( 'illegal_names' );
</ins><span class="cx">         if ( is_array( $illegal_names ) == false ) {
</span><del>-                $illegal_names = array(  &quot;www&quot;, &quot;web&quot;, &quot;root&quot;, &quot;admin&quot;, &quot;main&quot;, &quot;invite&quot;, &quot;administrator&quot; );
-                add_site_option( &quot;illegal_names&quot;, $illegal_names );
</del><ins>+                $illegal_names = array(  'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
+                add_site_option( 'illegal_names', $illegal_names );
</ins><span class="cx">         }
</span><span class="cx">         if ( in_array( $user_name, $illegal_names ) == true )
</span><del>-                $errors-&gt;add('user_name',  __(&quot;That username is not allowed&quot;));
</del><ins>+                $errors-&gt;add('user_name',  __('That username is not allowed'));
</ins><span class="cx"> 
</span><span class="cx">         if ( is_email_address_unsafe( $user_email ) )
</span><del>-                $errors-&gt;add('user_email',  __(&quot;You cannot use that email address to signup. We are having problems with them blocking some of our email. Please use another email provider.&quot;));
</del><ins>+                $errors-&gt;add('user_email',  __('You cannot use that email address to signup. We are having problems with them blocking some of our email. Please use another email provider.'));
</ins><span class="cx"> 
</span><span class="cx">         if ( strlen( $user_name ) &lt; 4 )
</span><del>-                $errors-&gt;add('user_name',  __(&quot;Username must be at least 4 characters&quot;));
</del><ins>+                $errors-&gt;add('user_name',  __('Username must be at least 4 characters'));
</ins><span class="cx"> 
</span><del>-        if ( strpos( &quot; &quot; . $user_name, &quot;_&quot; ) != false )
</del><ins>+        if ( strpos( ' ' . $user_name, '_' ) != false )
</ins><span class="cx">                 $errors-&gt;add( 'user_name', __( 'Sorry, usernames may not contain the character &amp;#8220;_&amp;#8221;!' ) );
</span><span class="cx"> 
</span><span class="cx">         // all numeric?
</span><span class="cx">         $match = array();
</span><span class="cx">         preg_match( '/[0-9]*/', $user_name, $match );
</span><span class="cx">         if ( $match[0] == $user_name )
</span><del>-                $errors-&gt;add('user_name', __(&quot;Sorry, usernames must have letters too!&quot;));
</del><ins>+                $errors-&gt;add('user_name', __('Sorry, usernames must have letters too!'));
</ins><span class="cx"> 
</span><span class="cx">         if ( !is_email( $user_email ) )
</span><del>-                $errors-&gt;add('user_email', __(&quot;Please enter a correct email address&quot;));
</del><ins>+                $errors-&gt;add('user_email', __('Please enter a correct email address'));
</ins><span class="cx"> 
</span><span class="cx">         $limited_email_domains = get_site_option( 'limited_email_domains' );
</span><span class="cx">         if ( is_array( $limited_email_domains ) &amp;&amp; empty( $limited_email_domains ) == false ) {
</span><span class="cx">                 $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );
</span><span class="cx">                 if ( in_array( $emaildomain, $limited_email_domains ) == false )
</span><del>-                        $errors-&gt;add('user_email', __(&quot;Sorry, that email address is not allowed!&quot;));
</del><ins>+                        $errors-&gt;add('user_email', __('Sorry, that email address is not allowed!'));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Check if the username has been used already.
</span><span class="cx">         if ( username_exists($user_name) )
</span><del>-                $errors-&gt;add('user_name', __(&quot;Sorry, that username already exists!&quot;));
</del><ins>+                $errors-&gt;add('user_name', __('Sorry, that username already exists!'));
</ins><span class="cx"> 
</span><span class="cx">         // Check if the email address has been used already.
</span><span class="cx">         if ( email_exists($user_email) )
</span><del>-                $errors-&gt;add('user_email', __(&quot;Sorry, that email address is already used!&quot;));
</del><ins>+                $errors-&gt;add('user_email', __('Sorry, that email address is already used!'));
</ins><span class="cx"> 
</span><span class="cx">         // Has someone already signed up for this username?
</span><span class="cx">         $signup = $wpdb-&gt;get_row( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;signups WHERE user_login = %s&quot;, $user_name) );
</span><span class="lines">@@ -519,10 +519,10 @@
</span><span class="cx">                 if ( $diff &gt; 172800 )
</span><span class="cx">                         $wpdb-&gt;query( $wpdb-&gt;prepare(&quot;DELETE FROM $wpdb-&gt;signups WHERE user_login = %s&quot;, $user_name) );
</span><span class="cx">                 else
</span><del>-                        $errors-&gt;add('user_name', __(&quot;That username is currently reserved but may be available in a couple of days.&quot;));
</del><ins>+                        $errors-&gt;add('user_name', __('That username is currently reserved but may be available in a couple of days.'));
</ins><span class="cx"> 
</span><span class="cx">                 if ( $signup-&gt;active == 0 &amp;&amp; $signup-&gt;user_email == $user_email )
</span><del>-                        $errors-&gt;add('user_email_used', __(&quot;username and email used&quot;));
</del><ins>+                        $errors-&gt;add('user_email_used', __('username and email used'));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         $signup = $wpdb-&gt;get_row( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;signups WHERE user_email = %s&quot;, $user_email) );
</span><span class="lines">@@ -532,7 +532,7 @@
</span><span class="cx">                 if ( $diff &gt; 172800 )
</span><span class="cx">                         $wpdb-&gt;query( $wpdb-&gt;prepare(&quot;DELETE FROM $wpdb-&gt;signups WHERE user_email = %s&quot;, $user_email) );
</span><span class="cx">                 else
</span><del>-                        $errors-&gt;add('user_email', __(&quot;That email address has already been used. Please check your inbox for an activation email. It will become available in a couple of days if you do nothing.&quot;));
</del><ins>+                        $errors-&gt;add('user_email', __('That email address has already been used. Please check your inbox for an activation email. It will become available in a couple of days if you do nothing.'));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         $result = array('user_name' =&gt; $user_name, 'user_email' =&gt; $user_email,        'errors' =&gt; $errors);
</span><span class="lines">@@ -547,27 +547,27 @@
</span><span class="cx">         $blog_title = substr( $blog_title, 0, 50 );
</span><span class="cx"> 
</span><span class="cx">         $errors = new WP_Error();
</span><del>-        $illegal_names = get_site_option( &quot;illegal_names&quot; );
</del><ins>+        $illegal_names = get_site_option( 'illegal_names' );
</ins><span class="cx">         if ( $illegal_names == false ) {
</span><del>-                $illegal_names = array( &quot;www&quot;, &quot;web&quot;, &quot;root&quot;, &quot;admin&quot;, &quot;main&quot;, &quot;invite&quot;, &quot;administrator&quot; );
-                add_site_option( &quot;illegal_names&quot;, $illegal_names );
</del><ins>+                $illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
+                add_site_option( 'illegal_names', $illegal_names );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if ( empty( $blogname ) )
</span><del>-                $errors-&gt;add('blogname', __(&quot;Please enter a blog name&quot;));
</del><ins>+                $errors-&gt;add('blogname', __('Please enter a blog name'));
</ins><span class="cx"> 
</span><span class="cx">         $maybe = array();
</span><del>-        preg_match( &quot;/[a-z0-9]+/&quot;, $blogname, $maybe );
</del><ins>+        preg_match( '/[a-z0-9]+/', $blogname, $maybe );
</ins><span class="cx">         if ( $blogname != $maybe[0] )
</span><del>-                $errors-&gt;add('blogname', __(&quot;Only lowercase letters and numbers allowed&quot;));
</del><ins>+                $errors-&gt;add('blogname', __('Only lowercase letters and numbers allowed'));
</ins><span class="cx"> 
</span><span class="cx">         if ( in_array( $blogname, $illegal_names ) == true )
</span><del>-                $errors-&gt;add('blogname',  __(&quot;That name is not allowed&quot;));
</del><ins>+                $errors-&gt;add('blogname',  __('That name is not allowed'));
</ins><span class="cx"> 
</span><span class="cx">         if ( strlen( $blogname ) &lt; 4 &amp;&amp; !is_super_admin() )
</span><del>-                $errors-&gt;add('blogname',  __(&quot;Blog name must be at least 4 characters&quot;));
</del><ins>+                $errors-&gt;add('blogname',  __('Blog name must be at least 4 characters'));
</ins><span class="cx"> 
</span><del>-        if ( strpos( &quot; &quot; . $blogname, &quot;_&quot; ) != false )
</del><ins>+        if ( strpos( ' ' . $blogname, '_' ) != false )
</ins><span class="cx">                 $errors-&gt;add( 'blogname', __( 'Sorry, blog names may not contain the character &amp;#8220;_&amp;#8221;!' ) );
</span><span class="cx"> 
</span><span class="cx">         // do not allow users to create a blog that conflicts with a page on the main blog.
</span><span class="lines">@@ -578,14 +578,14 @@
</span><span class="cx">         $match = array();
</span><span class="cx">         preg_match( '/[0-9]*/', $blogname, $match );
</span><span class="cx">         if ( $match[0] == $blogname )
</span><del>-                $errors-&gt;add('blogname', __(&quot;Sorry, blog names must have letters too!&quot;));
</del><ins>+                $errors-&gt;add('blogname', __('Sorry, blog names must have letters too!'));
</ins><span class="cx"> 
</span><del>-        $blogname = apply_filters( &quot;newblogname&quot;, $blogname );
</del><ins>+        $blogname = apply_filters( 'newblogname', $blogname );
</ins><span class="cx"> 
</span><span class="cx">         $blog_title = stripslashes(  $blog_title );
</span><span class="cx"> 
</span><span class="cx">         if ( empty( $blog_title ) )
</span><del>-                $errors-&gt;add('blog_title', __(&quot;Please enter a blog title&quot;));
</del><ins>+                $errors-&gt;add('blog_title', __('Please enter a blog title'));
</ins><span class="cx"> 
</span><span class="cx">         // Check if the domain/path has been used already.
</span><span class="cx">         if ( is_subdomain_install() ) {
</span><span class="lines">@@ -596,11 +596,11 @@
</span><span class="cx">                 $path = $base.$blogname.'/';
</span><span class="cx">         }
</span><span class="cx">         if ( domain_exists($mydomain, $path) )
</span><del>-                $errors-&gt;add('blogname', __(&quot;Sorry, that blog already exists!&quot;));
</del><ins>+                $errors-&gt;add('blogname', __('Sorry, that blog already exists!'));
</ins><span class="cx"> 
</span><span class="cx">         if ( username_exists( $blogname ) ) {
</span><span class="cx">                 if ( is_object( $user ) == false || ( is_object($user) &amp;&amp; ( $user-&gt;user_login != $blogname ) ) )
</span><del>-                        $errors-&gt;add( 'blogname', __( &quot;Sorry, that blog is reserved!&quot; ) );
</del><ins>+                        $errors-&gt;add( 'blogname', __( 'Sorry, that blog is reserved!' ) );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Has someone already signed up for this domain?
</span><span class="lines">@@ -611,7 +611,7 @@
</span><span class="cx">                 if ( $diff &gt; 172800 )
</span><span class="cx">                         $wpdb-&gt;query( $wpdb-&gt;prepare(&quot;DELETE FROM $wpdb-&gt;signups WHERE domain = %s AND path = %s&quot;, $mydomain, $path) );
</span><span class="cx">                 else
</span><del>-                        $errors-&gt;add('blogname', __(&quot;That blog is currently reserved but may be available in a couple days.&quot;));
</del><ins>+                        $errors-&gt;add('blogname', __('That blog is currently reserved but may be available in a couple days.'));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         $result = array('domain' =&gt; $mydomain, 'path' =&gt; $path, 'blogname' =&gt; $blogname, 'blog_title' =&gt; $blog_title, 'errors' =&gt; $errors);
</span><span class="lines">@@ -647,7 +647,7 @@
</span><span class="cx">         global $wpdb;
</span><span class="cx"> 
</span><span class="cx">         // Format data
</span><del>-        $user = preg_replace( &quot;/\s+/&quot;, '', sanitize_user( $user, true ) );
</del><ins>+        $user = preg_replace( '/\s+/', '', sanitize_user( $user, true ) );
</ins><span class="cx">         $user_email = sanitize_email( $user_email );
</span><span class="cx">         $key = substr( md5( time() . rand() . $user_email ), 0, 16 );
</span><span class="cx">         $meta = serialize($meta);
</span><span class="lines">@@ -680,10 +680,10 @@
</span><span class="cx">                 $activate_url = &quot;http://{$domain}{$path}wp-activate.php?key=$key&quot;; // @todo use *_url() API
</span><span class="cx"> 
</span><span class="cx">         $activate_url = esc_url($activate_url);
</span><del>-        $admin_email = get_site_option( &quot;admin_email&quot; );
</del><ins>+        $admin_email = get_site_option( 'admin_email' );
</ins><span class="cx">         if ( $admin_email == '' )
</span><span class="cx">                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
</span><del>-        $from_name = get_site_option( &quot;site_name&quot; ) == '' ? 'WordPress' : esc_html( get_site_option( &quot;site_name&quot; ) );
</del><ins>+        $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
</ins><span class="cx">         $message_headers = &quot;From: \&quot;{$from_name}\&quot; &lt;{$admin_email}&gt;\n&quot; . &quot;Content-Type: text/plain; charset=\&quot;&quot; . get_option('blog_charset') . &quot;\&quot;\n&quot;;
</span><span class="cx">         $message = sprintf( apply_filters( 'wpmu_signup_blog_notification_email', __( &quot;To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your blog here:\n\n%s&quot; ) ), $activate_url, esc_url( &quot;http://{$domain}{$path}&quot; ), $key );
</span><span class="cx">         // TODO: Don't hard code activation link.
</span><span class="lines">@@ -697,10 +697,10 @@
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         // Send email with activation link.
</span><del>-        $admin_email = get_site_option( &quot;admin_email&quot; );
</del><ins>+        $admin_email = get_site_option( 'admin_email' );
</ins><span class="cx">         if ( $admin_email == '' )
</span><span class="cx">                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
</span><del>-        $from_name = get_site_option( &quot;site_name&quot; ) == '' ? 'WordPress' : esc_html( get_site_option( &quot;site_name&quot; ) );
</del><ins>+        $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
</ins><span class="cx">         $message_headers = &quot;From: \&quot;{$from_name}\&quot; &lt;{$admin_email}&gt;\n&quot; . &quot;Content-Type: text/plain; charset=\&quot;&quot; . get_option('blog_charset') . &quot;\&quot;\n&quot;;
</span><span class="cx">         $message = sprintf( apply_filters( 'wpmu_signup_user_notification_email', __( &quot;To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n&quot; ) ), site_url( &quot;wp-activate.php?key=$key&quot; ), $key );
</span><span class="cx">         // TODO: Don't hard code activation link.
</span><span class="lines">@@ -779,7 +779,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function wpmu_create_user( $user_name, $password, $email) {
</span><del>-        $user_name = preg_replace( &quot;/\s+/&quot;, '', sanitize_user( $user_name, true ) );
</del><ins>+        $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
</ins><span class="cx"> 
</span><span class="cx">         $user_id = wp_create_user( $user_name, $password, $email );
</span><span class="cx">         if ( is_wp_error($user_id) )
</span><span class="lines">@@ -795,7 +795,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id = 1) {
</span><del>-        $domain = preg_replace( &quot;/\s+/&quot;, '', sanitize_user( $domain, true ) );
</del><ins>+        $domain = preg_replace( '/\s+/', '', sanitize_user( $domain, true ) );
</ins><span class="cx"> 
</span><span class="cx">         if ( is_subdomain_install() )
</span><span class="cx">                 $domain = str_replace( '@', '', $domain );
</span><span class="lines">@@ -810,8 +810,8 @@
</span><span class="cx">         if ( domain_exists($domain, $path, $site_id) )
</span><span class="cx">                 return new WP_Error('blog_taken', __('Blog already exists.'));
</span><span class="cx"> 
</span><del>-        if ( !defined(&quot;WP_INSTALLING&quot;) )
-                define( &quot;WP_INSTALLING&quot;, true );
</del><ins>+        if ( !defined('WP_INSTALLING') )
+                define( 'WP_INSTALLING', true );
</ins><span class="cx"> 
</span><span class="cx">         if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
</span><span class="cx">                 return new WP_Error('insert_blog', __('Could not create blog.'));
</span><span class="lines">@@ -856,14 +856,14 @@
</span><span class="cx">         $siteurl = site_url();
</span><span class="cx">         restore_current_blog();
</span><span class="cx"> 
</span><del>-        $msg = sprintf( __( &quot;New Blog: %1s
</del><ins>+        $msg = sprintf( __( 'New Blog: %1s
</ins><span class="cx"> URL: %2s
</span><span class="cx"> Remote IP: %3s
</span><span class="cx"> 
</span><del>-Disable these notifications: %4s&quot;), $blogname, $siteurl, $_SERVER['REMOTE_ADDR'], $options_site_url);
</del><ins>+Disable these notifications: %4s' ), $blogname, $siteurl, $_SERVER['REMOTE_ADDR'], $options_site_url);
</ins><span class="cx">         $msg = apply_filters( 'newblog_notify_siteadmin', $msg );
</span><span class="cx"> 
</span><del>-        wp_mail( $email, sprintf( __( &quot;New Blog Registration: %s&quot; ), $siteurl ), $msg );
</del><ins>+        wp_mail( $email, sprintf( __( 'New Blog Registration: %s' ), $siteurl ), $msg );
</ins><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -879,13 +879,13 @@
</span><span class="cx">         $user = new WP_User($user_id);
</span><span class="cx"> 
</span><span class="cx">         $options_site_url = esc_url(network_admin_url('ms-options.php'));
</span><del>-        $msg = sprintf(__(&quot;New User: %1s
</del><ins>+        $msg = sprintf(__('New User: %1s
</ins><span class="cx"> Remote IP: %2s
</span><span class="cx"> 
</span><del>-Disable these notifications: %3s&quot;), $user-&gt;user_login, $_SERVER['REMOTE_ADDR'], $options_site_url);
</del><ins>+Disable these notifications: %3s'), $user-&gt;user_login, $_SERVER['REMOTE_ADDR'], $options_site_url);
</ins><span class="cx"> 
</span><span class="cx">         $msg = apply_filters( 'newuser_notify_siteadmin', $msg );
</span><del>-        wp_mail( $email, sprintf(__(&quot;New User Registration: %s&quot;), $user-&gt;user_login), $msg );
</del><ins>+        wp_mail( $email, sprintf(__('New User Registration: %s'), $user-&gt;user_login), $msg );
</ins><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -987,24 +987,24 @@
</span><span class="cx">         $url = get_blogaddress_by_id($blog_id);
</span><span class="cx">         $user = new WP_User($user_id);
</span><span class="cx"> 
</span><del>-        $welcome_email = str_replace( &quot;SITE_NAME&quot;, $current_site-&gt;site_name, $welcome_email );
-        $welcome_email = str_replace( &quot;BLOG_TITLE&quot;, $title, $welcome_email );
-        $welcome_email = str_replace( &quot;BLOG_URL&quot;, $url, $welcome_email );
-        $welcome_email = str_replace( &quot;USERNAME&quot;, $user-&gt;user_login, $welcome_email );
-        $welcome_email = str_replace( &quot;PASSWORD&quot;, $password, $welcome_email );
</del><ins>+        $welcome_email = str_replace( 'SITE_NAME', $current_site-&gt;site_name, $welcome_email );
+        $welcome_email = str_replace( 'BLOG_TITLE', $title, $welcome_email );
+        $welcome_email = str_replace( 'BLOG_URL', $url, $welcome_email );
+        $welcome_email = str_replace( 'USERNAME', $user-&gt;user_login, $welcome_email );
+        $welcome_email = str_replace( 'PASSWORD', $password, $welcome_email );
</ins><span class="cx"> 
</span><del>-        $welcome_email = apply_filters( &quot;update_welcome_email&quot;, $welcome_email, $blog_id, $user_id, $password, $title, $meta);
-        $admin_email = get_site_option( &quot;admin_email&quot; );
</del><ins>+        $welcome_email = apply_filters( 'update_welcome_email', $welcome_email, $blog_id, $user_id, $password, $title, $meta);
+        $admin_email = get_site_option( 'admin_email' );
</ins><span class="cx"> 
</span><span class="cx">         if ( $admin_email == '' )
</span><span class="cx">                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
</span><span class="cx"> 
</span><del>-        $from_name = get_site_option( &quot;site_name&quot; ) == '' ? 'WordPress' : esc_html( get_site_option( &quot;site_name&quot; ) );
</del><ins>+        $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
</ins><span class="cx">         $message_headers = &quot;From: \&quot;{$from_name}\&quot; &lt;{$admin_email}&gt;\n&quot; . &quot;Content-Type: text/plain; charset=\&quot;&quot; . get_option('blog_charset') . &quot;\&quot;\n&quot;;
</span><span class="cx">         $message = $welcome_email;
</span><span class="cx"> 
</span><span class="cx">         if ( empty( $current_site-&gt;site_name ) )
</span><del>-                $current_site-&gt;site_name = &quot;WordPress MU&quot;;
</del><ins>+                $current_site-&gt;site_name = 'WordPress MU';
</ins><span class="cx"> 
</span><span class="cx">         $subject = apply_filters( 'update_welcome_subject', sprintf(__('New %1$s Blog: %2$s'), $current_site-&gt;site_name, stripslashes( $title ) ) );
</span><span class="cx">         wp_mail($user-&gt;user_email, $subject, $message, $message_headers);
</span><span class="lines">@@ -1021,23 +1021,23 @@
</span><span class="cx"> 
</span><span class="cx">         $user = new WP_User($user_id);
</span><span class="cx"> 
</span><del>-        $welcome_email = apply_filters( &quot;update_welcome_user_email&quot;, $welcome_email, $user_id, $password, $meta);
-        $welcome_email = str_replace( &quot;SITE_NAME&quot;, $current_site-&gt;site_name, $welcome_email );
-        $welcome_email = str_replace( &quot;USERNAME&quot;, $user-&gt;user_login, $welcome_email );
-        $welcome_email = str_replace( &quot;PASSWORD&quot;, $password, $welcome_email );
-        $welcome_email = str_replace( &quot;LOGINLINK&quot;, wp_login_url(), $welcome_email );
</del><ins>+        $welcome_email = apply_filters( 'update_welcome_user_email', $welcome_email, $user_id, $password, $meta);
+        $welcome_email = str_replace( 'SITE_NAME', $current_site-&gt;site_name, $welcome_email );
+        $welcome_email = str_replace( 'USERNAME', $user-&gt;user_login, $welcome_email );
+        $welcome_email = str_replace( 'PASSWORD', $password, $welcome_email );
+        $welcome_email = str_replace( 'LOGINLINK', wp_login_url(), $welcome_email );
</ins><span class="cx"> 
</span><del>-        $admin_email = get_site_option( &quot;admin_email&quot; );
</del><ins>+        $admin_email = get_site_option( 'admin_email' );
</ins><span class="cx"> 
</span><span class="cx">         if ( $admin_email == '' )
</span><span class="cx">                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
</span><span class="cx"> 
</span><del>-        $from_name = get_site_option( &quot;site_name&quot; ) == '' ? 'WordPress' : esc_html( get_site_option( &quot;site_name&quot; ) );
</del><ins>+        $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
</ins><span class="cx">         $message_headers = &quot;From: \&quot;{$from_name}\&quot; &lt;{$admin_email}&gt;\n&quot; . &quot;Content-Type: text/plain; charset=\&quot;&quot; . get_option('blog_charset') . &quot;\&quot;\n&quot;;
</span><span class="cx">         $message = $welcome_email;
</span><span class="cx"> 
</span><span class="cx">         if ( empty( $current_site-&gt;site_name ) )
</span><del>-                $current_site-&gt;site_name = &quot;WordPress MU&quot;;
</del><ins>+                $current_site-&gt;site_name = 'WordPress MU';
</ins><span class="cx"> 
</span><span class="cx">         $subject = apply_filters( 'update_welcome_user_subject', sprintf(__('New %1$s User: %2$s'), $current_site-&gt;site_name, $user-&gt;user_login) );
</span><span class="cx">         wp_mail($user-&gt;user_email, $subject, $message, $message_headers);
</span><span class="lines">@@ -1161,7 +1161,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function check_upload_mimes( $mimes ) {
</span><del>-        $site_exts = explode( &quot; &quot;, get_site_option( &quot;upload_filetypes&quot; ) );
</del><ins>+        $site_exts = explode( ' ', get_site_option( 'upload_filetypes' ) );
</ins><span class="cx">         foreach ( $site_exts as $ext ) {
</span><span class="cx">                 foreach ( $mimes as $ext_pattern =&gt; $mime ) {
</span><span class="cx">                         if ( $ext != '' &amp;&amp; strpos( $ext_pattern, $ext ) !== false )
</span><span class="lines">@@ -1173,7 +1173,7 @@
</span><span class="cx"> 
</span><span class="cx"> function update_posts_count( $deprecated = '' ) {
</span><span class="cx">         global $wpdb;
</span><del>-        update_option( &quot;post_count&quot;, (int) $wpdb-&gt;get_var( &quot;SELECT COUNT(ID) FROM {$wpdb-&gt;posts} WHERE post_status = 'publish' and post_type = 'post'&quot; ) );
</del><ins>+        update_option( 'post_count', (int) $wpdb-&gt;get_var( &quot;SELECT COUNT(ID) FROM {$wpdb-&gt;posts} WHERE post_status = 'publish' and post_type = 'post'&quot; ) );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function wpmu_log_new_registrations( $blog_id, $user_id ) {
</span><span class="lines">@@ -1268,8 +1268,8 @@
</span><span class="cx">         if ( is_array( $upload ) == false || defined( 'WP_IMPORTING' ) )
</span><span class="cx">                 return $upload;
</span><span class="cx"> 
</span><del>-        if ( strlen( $upload[ 'bits' ] )  &gt; ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) )
-                return sprintf(__( &quot;This file is too big. Files must be less than %dKb in size.&lt;br /&gt;&quot; ), get_site_option( 'fileupload_maxk', 1500 ));
</del><ins>+        if ( strlen( $upload['bits'] )  &gt; ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) )
+                return sprintf( __( 'This file is too big. Files must be less than %d KB in size.' ) . '&lt;br /&gt;', get_site_option( 'fileupload_maxk', 1500 ));
</ins><span class="cx"> 
</span><span class="cx">         return $upload;
</span><span class="cx"> }
</span><span class="lines">@@ -1316,7 +1316,7 @@
</span><span class="cx">         if ( $key == '' )
</span><span class="cx">                 $key = array_pop( $parts );
</span><span class="cx"> 
</span><del>-        $details = get_option( &quot;new_user_&quot; . $key );
</del><ins>+        $details = get_option( 'new_user_' . $key );
</ins><span class="cx">         add_existing_user_to_blog( $details );
</span><span class="cx">         delete_option( 'new_user_' . $key );
</span><span class="cx">         wp_die( sprintf(__('You have been added to this blog. Please visit the &lt;a href=&quot;%s&quot;&gt;homepage&lt;/a&gt; or &lt;a href=&quot;%s&quot;&gt;login&lt;/a&gt; using your username and password.'), site_url(), admin_url() ) );
</span><span class="lines">@@ -1325,7 +1325,7 @@
</span><span class="cx"> function add_existing_user_to_blog( $details = false ) {
</span><span class="cx">         if ( is_array( $details ) ) {
</span><span class="cx">                 add_user_to_blog( '', $details[ 'user_id' ], $details[ 'role' ] );
</span><del>-                do_action( &quot;added_existing_user&quot;, $details[ 'user_id' ] );
</del><ins>+                do_action( 'added_existing_user', $details[ 'user_id' ] );
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1395,7 +1395,7 @@
</span><span class="cx">         if ( $blog_id == 0 )
</span><span class="cx">                 $blog_id = $wpdb-&gt;blogid;
</span><span class="cx"> 
</span><del>-        $local_key = $wpdb-&gt;base_prefix . $blog_id . &quot;_&quot; . $key;
</del><ins>+        $local_key = $wpdb-&gt;base_prefix . $blog_id . '_' . $key;
</ins><span class="cx"> 
</span><span class="cx">         if ( isset( $current_user-&gt;$local_key ) )
</span><span class="cx">                 return true;
</span><span class="lines">@@ -1414,7 +1414,7 @@
</span><span class="cx"> 
</span><span class="cx"> function welcome_user_msg_filter( $text ) {
</span><span class="cx">         if ( !$text ) {
</span><del>-                return __( &quot;Dear User,
</del><ins>+                return __( 'Dear User,
</ins><span class="cx"> 
</span><span class="cx"> Your new account is set up.
</span><span class="cx"> 
</span><span class="lines">@@ -1425,7 +1425,7 @@
</span><span class="cx"> 
</span><span class="cx"> Thanks!
</span><span class="cx"> 
</span><del>---The Team @ SITE_NAME&quot; );
</del><ins>+--The Team @ SITE_NAME' );
</ins><span class="cx">         }
</span><span class="cx">         return $text;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>