<!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>[12734] trunk: Coding style cleanups</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12734">12734</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-15 22:25:40 +0000 (Fri, 15 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Coding style cleanups</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpactivatephp">trunk/wp-activate.php</a></li>
<li><a href="#trunkwpappphp">trunk/wp-app.php</a></li>
<li><a href="#trunkwpincludesloadphp">trunk/wp-includes/load.php</a></li>
<li><a href="#trunkwpsettingsphp">trunk/wp-settings.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpactivatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-activate.php (12733 => 12734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-activate.php        2010-01-15 22:11:12 UTC (rev 12733)
+++ trunk/wp-activate.php        2010-01-15 22:25:40 UTC (rev 12734)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> require( 'wp-blog-header.php' );
</span><span class="cx"> require_once( ABSPATH . WPINC . '/registration.php');
</span><span class="cx"> 
</span><del>-if( is_object( $wp_object_cache ) )
</del><ins>+if ( is_object( $wp_object_cache ) )
</ins><span class="cx">         $wp_object_cache-&gt;cache_enabled = false;
</span><span class="cx"> 
</span><span class="cx"> do_action(&quot;activate_header&quot;);
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">                                 ?&gt;
</span><span class="cx">                                 &lt;h2&gt;&lt;?php _e('Your account is now active!'); ?&gt;&lt;/h2&gt;
</span><span class="cx">                                 &lt;?php
</span><del>-                            if( $signup-&gt;domain . $signup-&gt;path == '' ) {
</del><ins>+                            if ( $signup-&gt;domain . $signup-&gt;path == '' ) {
</ins><span class="cx">                                     printf(__('&lt;p class=&quot;lead-in&quot;&gt;Your account has been activated. You may now &lt;a href=&quot;%1$s&quot;&gt;login&lt;/a&gt; to the site using your chosen username of &quot;%2$s&quot;.  Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can &lt;a href=&quot;%4$s&quot;&gt;reset your password&lt;/a&gt;.&lt;/p&gt;'), 'http://' . $current_site-&gt;domain . $current_site-&gt;path . 'wp-login.php', $signup-&gt;user_login, $signup-&gt;user_email, 'http://' . $current_site-&gt;domain . $current_site-&gt;path . 'wp-login.php?action=lostpassword');
</span><span class="cx">                             } else {
</span><span class="cx">                                     printf(__('&lt;p class=&quot;lead-in&quot;&gt;Your blog at &lt;a href=&quot;%1$s&quot;&gt;%2$s&lt;/a&gt; is active. You may now login to your blog using your chosen username of &quot;%3$s&quot;.  Please check your email inbox at %4$s for your password and login instructions.  If you do not receive an email, please check your junk or spam folder.  If you still do not receive an email within an hour, you can &lt;a href=&quot;%5$s&quot;&gt;reset your password&lt;/a&gt;.&lt;/p&gt;'), 'http://' . $signup-&gt;domain, $signup-&gt;domain, $signup-&gt;user_login, $signup-&gt;user_email, 'http://' . $current_site-&gt;domain . $current_site-&gt;path . 'wp-login.php?action=lostpassword');
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">                                 &lt;p&gt;&lt;span class=&quot;h3&quot;&gt;&lt;?php _e('Password:'); ?&gt;&lt;/span&gt; &lt;?php echo $password; ?&gt;&lt;/p&gt;
</span><span class="cx">                         &lt;/div&gt;
</span><span class="cx"> 
</span><del>-                        &lt;?php if( $url != 'http://' . $current_site-&gt;domain . $current_site-&gt;path ) : ?&gt;
</del><ins>+                        &lt;?php if ( $url != 'http://' . $current_site-&gt;domain . $current_site-&gt;path ) : ?&gt;
</ins><span class="cx">                                 &lt;p class=&quot;view&quot;&gt;&lt;?php printf(__('Your account is now activated. &lt;a href=&quot;%1$s&quot;&gt;View your site&lt;/a&gt; or &lt;a href=&quot;%2$s&quot;&gt;Login&lt;/a&gt;'), $url, $url . 'wp-login.php' ); ?&gt;&lt;/p&gt;
</span><span class="cx">                         &lt;?php else: ?&gt;
</span><span class="cx">                                 &lt;p class=&quot;view&quot;&gt;&lt;?php printf( __( 'Your account is now activated. &lt;a href=&quot;%1$s&quot;&gt;Login&lt;/a&gt; or go back to the &lt;a href=&quot;%2$s&quot;&gt;homepage&lt;/a&gt;.' ), 'http://' . $current_site-&gt;domain . $current_site-&gt;path . 'wp-login.php', 'http://' . $current_site-&gt;domain . $current_site-&gt;path ); ?&gt;&lt;/p&gt;
</span></span></pre></div>
<a id="trunkwpappphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-app.php (12733 => 12734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-app.php        2010-01-15 22:11:12 UTC (rev 12733)
+++ trunk/wp-app.php        2010-01-15 22:25:40 UTC (rev 12734)
</span><span class="lines">@@ -265,7 +265,7 @@
</span><span class="cx">         function handle_request() {
</span><span class="cx">                 global $always_authenticate;
</span><span class="cx"> 
</span><del>-                if( !empty( $_SERVER['ORIG_PATH_INFO'] ) )
</del><ins>+                if ( !empty( $_SERVER['ORIG_PATH_INFO'] ) )
</ins><span class="cx">                         $path = $_SERVER['ORIG_PATH_INFO'];
</span><span class="cx">                 else
</span><span class="cx">                         $path = $_SERVER['PATH_INFO'];
</span><span class="lines">@@ -278,41 +278,39 @@
</span><span class="cx">                 //$this-&gt;process_conditionals();
</span><span class="cx"> 
</span><span class="cx">                 // exception case for HEAD (treat exactly as GET, but don't output)
</span><del>-                if($method == 'HEAD') {
</del><ins>+                if ($method == 'HEAD') {
</ins><span class="cx">                         $this-&gt;do_output = false;
</span><span class="cx">                         $method = 'GET';
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 // redirect to /service in case no path is found.
</span><del>-                if(strlen($path) == 0 || $path == '/') {
</del><ins>+                if(strlen($path) == 0 || $path == '/')
</ins><span class="cx">                         $this-&gt;redirect($this-&gt;get_service_url());
</span><del>-                }
</del><span class="cx"> 
</span><span class="cx">                 // check to see if AtomPub is enabled
</span><del>-                if( !get_option( 'enable_app' ) )
</del><ins>+                if ( !get_option( 'enable_app' ) )
</ins><span class="cx">                         $this-&gt;forbidden( sprintf( __( 'AtomPub services are disabled on this blog.  An admin user can enable them at %s' ), admin_url('options-writing.php') ) );
</span><span class="cx"> 
</span><span class="cx">                 // dispatch
</span><del>-                foreach($this-&gt;selectors as $regex =&gt; $funcs) {
-                        if(preg_match($regex, $path, $matches)) {
-                        if(isset($funcs[$method])) {
</del><ins>+                foreach ( $this-&gt;selectors as $regex =&gt; $funcs ) {
+                        if ( preg_match($regex, $path, $matches) ) {
+                                if ( isset($funcs[$method]) ) {
</ins><span class="cx"> 
</span><del>-                                // authenticate regardless of the operation and set the current
-                                // user. each handler will decide if auth is required or not.
-                                if(!$this-&gt;authenticate()) {
-                                        if ($always_authenticate) {
-                                                $this-&gt;auth_required('Credentials required.');
</del><ins>+                                        // authenticate regardless of the operation and set the current
+                                        // user. each handler will decide if auth is required or not.
+                                        if ( !$this-&gt;authenticate() ) {
+                                                if ( $always_authenticate )
+                                                        $this-&gt;auth_required('Credentials required.');
</ins><span class="cx">                                         }
</span><del>-                                }
</del><span class="cx"> 
</span><del>-                                array_shift($matches);
-                                call_user_func_array(array(&amp;$this,$funcs[$method]), $matches);
-                                exit();
-                        } else {
-                                // only allow what we have handlers for...
-                                $this-&gt;not_allowed(array_keys($funcs));
</del><ins>+                                        array_shift($matches);
+                                        call_user_func_array(array(&amp;$this,$funcs[$method]), $matches);
+                                        exit();
+                                } else {
+                                        // only allow what we have handlers for...
+                                        $this-&gt;not_allowed(array_keys($funcs));
+                                }
</ins><span class="cx">                         }
</span><del>-                        }
</del><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 // oops, nothing found
</span><span class="lines">@@ -327,7 +325,7 @@
</span><span class="cx">         function get_service() {
</span><span class="cx">                 log_app('function','get_service()');
</span><span class="cx"> 
</span><del>-                if( !current_user_can( 'edit_posts' ) )
</del><ins>+                if ( !current_user_can( 'edit_posts' ) )
</ins><span class="cx">                         $this-&gt;auth_required( __( 'Sorry, you do not have the right to access this blog.' ) );
</span><span class="cx"> 
</span><span class="cx">                 $entries_url = esc_attr($this-&gt;get_entries_url());
</span><span class="lines">@@ -338,7 +336,7 @@
</span><span class="cx">                         $accepted_media_types = $accepted_media_types . &quot;&lt;accept&gt;&quot; . $med . &quot;&lt;/accept&gt;&quot;;
</span><span class="cx">                 }
</span><span class="cx">                 $atom_prefix=&quot;atom&quot;;
</span><del>-                $atom_blogname=get_bloginfo('name');
</del><ins>+                $atom_blogname = get_bloginfo('name');
</ins><span class="cx">                 $service_doc = &lt;&lt;&lt;EOD
</span><span class="cx"> &lt;service xmlns=&quot;$this-&gt;ATOMPUB_NS&quot; xmlns:$atom_prefix=&quot;$this-&gt;ATOM_NS&quot;&gt;
</span><span class="cx">   &lt;workspace&gt;
</span><span class="lines">@@ -368,16 +366,16 @@
</span><span class="cx">         function get_categories_xml() {
</span><span class="cx">                 log_app('function','get_categories_xml()');
</span><span class="cx"> 
</span><del>-                if( !current_user_can( 'edit_posts' ) )
</del><ins>+                if ( !current_user_can( 'edit_posts' ) )
</ins><span class="cx">                         $this-&gt;auth_required( __( 'Sorry, you do not have the right to access this blog.' ) );
</span><span class="cx"> 
</span><span class="cx">                 $home = esc_attr(get_bloginfo_rss('url'));
</span><span class="cx"> 
</span><span class="cx">                 $categories = &quot;&quot;;
</span><span class="cx">                 $cats = get_categories(array('hierarchical' =&gt; 0, 'hide_empty' =&gt; 0));
</span><del>-                foreach ((array) $cats as $cat) {
</del><ins>+                foreach ( (array) $cats as $cat ) {
</ins><span class="cx">                         $categories .= &quot;    &lt;category term=\&quot;&quot; . esc_attr($cat-&gt;name) .  &quot;\&quot; /&gt;\n&quot;;
</span><del>-}
</del><ins>+                }
</ins><span class="cx">                 $output = &lt;&lt;&lt;EOD
</span><span class="cx"> &lt;app:categories xmlns:app=&quot;$this-&gt;ATOMPUB_NS&quot;
</span><span class="cx">         xmlns=&quot;$this-&gt;ATOM_NS&quot;
</span><span class="lines">@@ -385,8 +383,8 @@
</span><span class="cx">         $categories
</span><span class="cx"> &lt;/app:categories&gt;
</span><span class="cx"> EOD;
</span><del>-        $this-&gt;output($output, $this-&gt;CATEGORIES_CONTENT_TYPE);
-}
</del><ins>+                $this-&gt;output($output, $this-&gt;CATEGORIES_CONTENT_TYPE);
+        }
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * Create new post.
</span><span class="lines">@@ -398,24 +396,24 @@
</span><span class="cx">                 $this-&gt;get_accepted_content_type($this-&gt;atom_content_types);
</span><span class="cx"> 
</span><span class="cx">                 $parser = new AtomParser();
</span><del>-                if(!$parser-&gt;parse()) {
</del><ins>+                if ( !$parser-&gt;parse() )
</ins><span class="cx">                         $this-&gt;client_error();
</span><del>-                }
</del><span class="cx"> 
</span><span class="cx">                 $entry = array_pop($parser-&gt;feed-&gt;entries);
</span><span class="cx"> 
</span><span class="cx">                 log_app('Received entry:', print_r($entry,true));
</span><span class="cx"> 
</span><span class="cx">                 $catnames = array();
</span><del>-                foreach($entry-&gt;categories as $cat)
</del><ins>+                foreach ( $entry-&gt;categories as $cat ) {
</ins><span class="cx">                         array_push($catnames, $cat[&quot;term&quot;]);
</span><ins>+                }
</ins><span class="cx"> 
</span><span class="cx">                 $wp_cats = get_categories(array('hide_empty' =&gt; false));
</span><span class="cx"> 
</span><span class="cx">                 $post_category = array();
</span><span class="cx"> 
</span><del>-                foreach($wp_cats as $cat) {
-                        if(in_array($cat-&gt;name, $catnames))
</del><ins>+                foreach ( $wp_cats as $cat ) {
+                        if ( in_array($cat-&gt;name, $catnames) )
</ins><span class="cx">                                 array_push($post_category, $cat-&gt;term_id);
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="lines">@@ -423,7 +421,7 @@
</span><span class="cx"> 
</span><span class="cx">                 $cap = ($publish) ? 'publish_posts' : 'edit_posts';
</span><span class="cx"> 
</span><del>-                if(!current_user_can($cap))
</del><ins>+                if ( !current_user_can($cap) )
</ins><span class="cx">                         $this-&gt;auth_required(__('Sorry, you do not have the right to edit/publish new posts.'));
</span><span class="cx"> 
</span><span class="cx">                 $blog_ID = (int ) $blog_id;
</span><span class="lines">@@ -448,7 +446,7 @@
</span><span class="cx">                 if ( is_wp_error( $postID ) )
</span><span class="cx">                         $this-&gt;internal_error($postID-&gt;get_error_message());
</span><span class="cx"> 
</span><del>-                if (!$postID)
</del><ins>+                if ( !$postID )
</ins><span class="cx">                         $this-&gt;internal_error(__('Sorry, your entry could not be posted. Something wrong happened.'));
</span><span class="cx"> 
</span><span class="cx">                 // getting warning here about unable to set headers
</span><span class="lines">@@ -475,7 +473,7 @@
</span><span class="cx">         function get_post($postID) {
</span><span class="cx">                 global $entry;
</span><span class="cx"> 
</span><del>-                if( !current_user_can( 'edit_post', $postID ) )
</del><ins>+                if ( !current_user_can( 'edit_post', $postID ) )
</ins><span class="cx">                         $this-&gt;auth_required( __( 'Sorry, you do not have the right to access this post.' ) );
</span><span class="cx"> 
</span><span class="cx">                 $this-&gt;set_current_entry($postID);
</span><span class="lines">@@ -498,9 +496,8 @@
</span><span class="cx">                 $this-&gt;get_accepted_content_type($this-&gt;atom_content_types);
</span><span class="cx"> 
</span><span class="cx">                 $parser = new AtomParser();
</span><del>-                if(!$parser-&gt;parse()) {
</del><ins>+                if ( !$parser-&gt;parse() )
</ins><span class="cx">                         $this-&gt;bad_request();
</span><del>-                }
</del><span class="cx"> 
</span><span class="cx">                 $parsed = array_pop($parser-&gt;feed-&gt;entries);
</span><span class="cx"> 
</span><span class="lines">@@ -510,7 +507,7 @@
</span><span class="cx">                 global $entry;
</span><span class="cx">                 $this-&gt;set_current_entry($postID);
</span><span class="cx"> 
</span><del>-                if(!current_user_can('edit_post', $entry['ID']))
</del><ins>+                if ( !current_user_can('edit_post', $entry['ID']) )
</ins><span class="cx">                         $this-&gt;auth_required(__('Sorry, you do not have the right to edit this post.'));
</span><span class="cx"> 
</span><span class="cx">                 $publish = (isset($parsed-&gt;draft) &amp;&amp; trim($parsed-&gt;draft) == 'yes') ? false : true;
</span><span class="lines">@@ -533,9 +530,8 @@
</span><span class="cx"> 
</span><span class="cx">                 $result = wp_update_post($postdata);
</span><span class="cx"> 
</span><del>-                if (!$result) {
</del><ins>+                if ( !$result )
</ins><span class="cx">                         $this-&gt;internal_error(__('For some strange yet very annoying reason, this post could not be edited.'));
</span><del>-                }
</del><span class="cx"> 
</span><span class="cx">                 do_action( 'atompub_put_post', $ID, $parsed );
</span><span class="cx"> 
</span><span class="lines">@@ -556,16 +552,15 @@
</span><span class="cx">                 global $entry;
</span><span class="cx">                 $this-&gt;set_current_entry($postID);
</span><span class="cx"> 
</span><del>-                if(!current_user_can('edit_post', $postID)) {
</del><ins>+                if ( !current_user_can('edit_post', $postID) )
</ins><span class="cx">                         $this-&gt;auth_required(__('Sorry, you do not have the right to delete this post.'));
</span><del>-                }
</del><span class="cx"> 
</span><del>-                if ($entry['post_type'] == 'attachment') {
</del><ins>+                if ( $entry['post_type'] == 'attachment' ) {
</ins><span class="cx">                         $this-&gt;delete_attachment($postID);
</span><span class="cx">                 } else {
</span><span class="cx">                         $result = wp_delete_post($postID);
</span><span class="cx"> 
</span><del>-                        if (!$result) {
</del><ins>+                        if ( !$result ) {
</ins><span class="cx">                                 $this-&gt;internal_error(__('For some strange yet very annoying reason, this post could not be deleted.'));
</span><span class="cx">                         }
</span><span class="cx"> 
</span><span class="lines">@@ -583,10 +578,10 @@
</span><span class="cx">          * @param int $postID Optional. Post ID.
</span><span class="cx">          */
</span><span class="cx">         function get_attachment($postID = null) {
</span><del>-                if( !current_user_can( 'upload_files' ) )
</del><ins>+                if ( !current_user_can( 'upload_files' ) )
</ins><span class="cx">                         $this-&gt;auth_required( __( 'Sorry, you do not have permission to upload files.' ) );
</span><span class="cx"> 
</span><del>-                if (!isset($postID)) {
</del><ins>+                if ( !isset($postID) ) {
</ins><span class="cx">                         $this-&gt;get_attachments();
</span><span class="cx">                 } else {
</span><span class="cx">                         $this-&gt;set_current_entry($postID);
</span><span class="lines">@@ -605,12 +600,12 @@
</span><span class="cx"> 
</span><span class="cx">                 $type = $this-&gt;get_accepted_content_type();
</span><span class="cx"> 
</span><del>-                if(!current_user_can('upload_files'))
</del><ins>+                if ( !current_user_can('upload_files') )
</ins><span class="cx">                         $this-&gt;auth_required(__('You do not have permission to upload files.'));
</span><span class="cx"> 
</span><span class="cx">                 $fp = fopen(&quot;php://input&quot;, &quot;rb&quot;);
</span><span class="cx">                 $bits = null;
</span><del>-                while(!feof($fp)) {
</del><ins>+                while ( !feof($fp) ) {
</ins><span class="cx">                         $bits .= fread($fp, 4096);
</span><span class="cx">                 }
</span><span class="cx">                 fclose($fp);
</span><span class="lines">@@ -678,7 +673,7 @@
</span><span class="cx">                 global $entry;
</span><span class="cx">                 $this-&gt;set_current_entry($postID);
</span><span class="cx"> 
</span><del>-                if(!current_user_can('edit_post', $entry['ID']))
</del><ins>+                if ( !current_user_can('edit_post', $entry['ID']) )
</ins><span class="cx">                         $this-&gt;auth_required(__('Sorry, you do not have the right to edit this post.'));
</span><span class="cx"> 
</span><span class="cx">                 extract($entry);
</span><span class="lines">@@ -694,9 +689,8 @@
</span><span class="cx"> 
</span><span class="cx">                 $result = wp_update_post($postdata);
</span><span class="cx"> 
</span><del>-                if (!$result) {
</del><ins>+                if ( !$result )
</ins><span class="cx">                         $this-&gt;internal_error(__('For some strange yet very annoying reason, this post could not be edited.'));
</span><del>-                }
</del><span class="cx"> 
</span><span class="cx">                 log_app('function',&quot;put_attachment($postID)&quot;);
</span><span class="cx">                 $this-&gt;ok();
</span><span class="lines">@@ -716,14 +710,13 @@
</span><span class="cx">                 global $entry;
</span><span class="cx">                 $this-&gt;set_current_entry($postID);
</span><span class="cx"> 
</span><del>-                if(!current_user_can('edit_post', $postID)) {
</del><ins>+                if ( !current_user_can('edit_post', $postID) )
</ins><span class="cx">                         $this-&gt;auth_required(__('Sorry, you do not have the right to delete this post.'));
</span><del>-                }
</del><span class="cx"> 
</span><span class="cx">                 $location = get_post_meta($entry['ID'], '_wp_attached_file', true);
</span><span class="cx">                 $filetype = wp_check_filetype($location);
</span><span class="cx"> 
</span><del>-                if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']))
</del><ins>+                if ( !isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']) )
</ins><span class="cx">                         $this-&gt;internal_error(__('Error ocurred while accessing post metadata for file location.'));
</span><span class="cx"> 
</span><span class="cx">                 // delete file
</span><span class="lines">@@ -732,9 +725,8 @@
</span><span class="cx">                 // delete attachment
</span><span class="cx">                 $result = wp_delete_post($postID);
</span><span class="cx"> 
</span><del>-                if (!$result) {
</del><ins>+                if ( !$result )
</ins><span class="cx">                         $this-&gt;internal_error(__('For some strange yet very annoying reason, this post could not be deleted.'));
</span><del>-                }
</del><span class="cx"> 
</span><span class="cx">                 log_app('function',&quot;delete_attachment($postID). File '$location' deleted.&quot;);
</span><span class="cx">                 $this-&gt;ok();
</span><span class="lines">@@ -754,27 +746,26 @@
</span><span class="cx">                 $this-&gt;set_current_entry($postID);
</span><span class="cx"> 
</span><span class="cx">                 // then whether user can edit the specific post
</span><del>-                if(!current_user_can('edit_post', $postID)) {
</del><ins>+                if ( !current_user_can('edit_post', $postID) )
</ins><span class="cx">                         $this-&gt;auth_required(__('Sorry, you do not have the right to edit this post.'));
</span><del>-                }
</del><span class="cx"> 
</span><span class="cx">                 $location = get_post_meta($entry['ID'], '_wp_attached_file', true);
</span><span class="cx">                 $location = get_option ('upload_path') . '/' . $location;
</span><span class="cx">                 $filetype = wp_check_filetype($location);
</span><span class="cx"> 
</span><del>-                if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']))
</del><ins>+                if ( !isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']) )
</ins><span class="cx">                         $this-&gt;internal_error(__('Error ocurred while accessing post metadata for file location.'));
</span><span class="cx"> 
</span><span class="cx">                 status_header('200');
</span><span class="cx">                 header('Content-Type: ' . $entry['post_mime_type']);
</span><span class="cx">                 header('Connection: close');
</span><span class="cx"> 
</span><del>-                if ($fp = fopen($location, &quot;rb&quot;)) {
</del><ins>+                if ( $fp = fopen($location, &quot;rb&quot;) ) {
</ins><span class="cx">                         status_header('200');
</span><span class="cx">                         header('Content-Type: ' . $entry['post_mime_type']);
</span><span class="cx">                         header('Connection: close');
</span><span class="cx"> 
</span><del>-                        while(!feof($fp)) {
</del><ins>+                        while ( !feof($fp) ) {
</ins><span class="cx">                                 echo fread($fp, 4096);
</span><span class="cx">                         }
</span><span class="cx"> 
</span><span class="lines">@@ -797,7 +788,7 @@
</span><span class="cx">         function put_file($postID) {
</span><span class="cx"> 
</span><span class="cx">                 // first check if user can upload
</span><del>-                if(!current_user_can('upload_files'))
</del><ins>+                if ( !current_user_can('upload_files') )
</ins><span class="cx">                         $this-&gt;auth_required(__('You do not have permission to upload files.'));
</span><span class="cx"> 
</span><span class="cx">                 // check for not found
</span><span class="lines">@@ -805,9 +796,8 @@
</span><span class="cx">                 $this-&gt;set_current_entry($postID);
</span><span class="cx"> 
</span><span class="cx">                 // then whether user can edit the specific post
</span><del>-                if(!current_user_can('edit_post', $postID)) {
</del><ins>+                if ( !current_user_can('edit_post', $postID) )
</ins><span class="cx">                         $this-&gt;auth_required(__('Sorry, you do not have the right to edit this post.'));
</span><del>-                }
</del><span class="cx"> 
</span><span class="cx">                 $upload_dir = wp_upload_dir( );
</span><span class="cx">                 $location = get_post_meta($entry['ID'], '_wp_attached_file', true);
</span><span class="lines">@@ -820,7 +810,7 @@
</span><span class="cx"> 
</span><span class="cx">                 $fp = fopen(&quot;php://input&quot;, &quot;rb&quot;);
</span><span class="cx">                 $localfp = fopen($location, &quot;w+&quot;);
</span><del>-                while(!feof($fp)) {
</del><ins>+                while ( !feof($fp) ) {
</ins><span class="cx">                         fwrite($localfp,fread($fp, 4096));
</span><span class="cx">                 }
</span><span class="cx">                 fclose($fp);
</span><span class="lines">@@ -837,9 +827,8 @@
</span><span class="cx">                 $post_data = compact('ID', 'post_date', 'post_date_gmt', 'post_modified', 'post_modified_gmt');
</span><span class="cx">                 $result = wp_update_post($post_data);
</span><span class="cx"> 
</span><del>-                if (!$result) {
</del><ins>+                if ( !$result )
</ins><span class="cx">                         $this-&gt;internal_error(__('Sorry, your entry could not be posted. Something wrong happened.'));
</span><del>-                }
</del><span class="cx"> 
</span><span class="cx">                 wp_update_attachment_metadata( $postID, wp_generate_attachment_metadata( $postID, $location ) );
</span><span class="cx"> 
</span><span class="lines">@@ -856,15 +845,13 @@
</span><span class="cx">          * @return string
</span><span class="cx">          */
</span><span class="cx">         function get_entries_url($page = null) {
</span><del>-                if ( isset($GLOBALS['post_type']) &amp;&amp; ( $GLOBALS['post_type'] == 'attachment' ) ) {
</del><ins>+                if ( isset($GLOBALS['post_type']) &amp;&amp; ( $GLOBALS['post_type'] == 'attachment' ) )
</ins><span class="cx">                         $path = $this-&gt;MEDIA_PATH;
</span><del>-                } else {
</del><ins>+                else
</ins><span class="cx">                         $path = $this-&gt;ENTRIES_PATH;
</span><del>-                }
</del><span class="cx">                 $url = $this-&gt;app_base . $path;
</span><del>-                if(isset($page) &amp;&amp; is_int($page)) {
</del><ins>+                if ( isset($page) &amp;&amp; is_int($page) )
</ins><span class="cx">                         $url .= &quot;/$page&quot;;
</span><del>-                }
</del><span class="cx">                 return $url;
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludesloadphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/load.php (12733 => 12734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/load.php        2010-01-15 22:11:12 UTC (rev 12733)
+++ trunk/wp-includes/load.php        2010-01-15 22:25:40 UTC (rev 12734)
</span><span class="lines">@@ -271,10 +271,9 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function wp_not_installed() {
</span><del>-        if( is_multisite() ) {
-                        if ( !is_blog_installed() &amp;&amp; !defined('WP_INSTALLING') ) {
</del><ins>+        if ( is_multisite() ) {
+                        if ( !is_blog_installed() &amp;&amp; !defined('WP_INSTALLING') )
</ins><span class="cx">                                         die( __( 'The blog you have requested is not installed properly. Please contact the system administrator.' ) ); // have to die here ~ Mark
</span><del>-                        }
</del><span class="cx">         } elseif ( !is_blog_installed() &amp;&amp; (strpos($_SERVER['PHP_SELF'], 'install.php') === false &amp;&amp; !defined('WP_INSTALLING')) ) {
</span><span class="cx">                 if ( defined('WP_SITEURL') )
</span><span class="cx">                         $link = WP_SITEURL . '/wp-admin/install.php';
</span><span class="lines">@@ -329,7 +328,6 @@
</span><span class="cx">                 unset($plugin);
</span><span class="cx">         }
</span><span class="cx">         unset($current_plugins);
</span><del>-
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function wp_set_internal_encoding() {
</span></span></pre></div>
<a id="trunkwpsettingsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-settings.php (12733 => 12734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-settings.php        2010-01-15 22:11:12 UTC (rev 12733)
+++ trunk/wp-settings.php        2010-01-15 22:25:40 UTC (rev 12734)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> require (ABSPATH . WPINC . '/default-filters.php');
</span><span class="cx"> include_once(ABSPATH . WPINC . '/pomo/mo.php');
</span><span class="cx"> 
</span><del>-if( is_multisite() &amp;&amp; SHORTINIT ) // stop most of WP being loaded, we just want the basics
</del><ins>+if ( SHORTINIT ) // stop most of WP being loaded, we just want the basics
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx"> require_once (ABSPATH . WPINC . '/l10n.php');
</span><span class="lines">@@ -110,8 +110,8 @@
</span><span class="cx"> 
</span><span class="cx"> wp_default_constants('wp_included');
</span><span class="cx"> 
</span><del>-if( is_multisite() )
-        ms_network_settings();
</del><ins>+if ( is_multisite() )
+    ms_network_settings();
</ins><span class="cx"> 
</span><span class="cx"> wp_default_constants('ms_network_settings_loaded');
</span><span class="cx"> 
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx">  * Used to load network wide plugins
</span><span class="cx">  * @since 3.0
</span><span class="cx">  */
</span><del>-if( is_multisite() )
</del><ins>+if ( is_multisite() )
</ins><span class="cx">         ms_network_plugins();
</span><span class="cx"> 
</span><span class="cx"> do_action('muplugins_loaded');
</span><span class="lines">@@ -130,7 +130,7 @@
</span><span class="cx">  * Used to check site status
</span><span class="cx">  * @since 3.0
</span><span class="cx">  */
</span><del>-if( is_multisite() ) {
</del><ins>+if ( is_multisite() ) {
</ins><span class="cx">         ms_site_check();
</span><span class="cx">         ms_network_cookies();
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>