summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--index-install.php213
-rw-r--r--wp-admin/admin-footer.php5
-rw-r--r--wp-admin/css/press-this-ie.css15
-rw-r--r--wp-admin/edit-tag-form.php5
-rw-r--r--wp-admin/import/textpattern.php2
-rw-r--r--wp-admin/includes/image.php10
-rw-r--r--wp-admin/includes/media.php10
-rw-r--r--wp-admin/includes/mu.php41
-rw-r--r--wp-admin/includes/template.php2
-rw-r--r--wp-admin/includes/update.php16
-rw-r--r--wp-admin/users.php1
-rw-r--r--wp-admin/wpmu-edit.php7
-rw-r--r--wp-admin/wpmu-options.php8
-rw-r--r--wp-admin/wpmu-users.php2
-rw-r--r--wp-content/themes/home/searchform.php1
-rw-r--r--wp-includes/class-snoopy.php72
-rw-r--r--wp-includes/feed.php12
-rw-r--r--wp-includes/formatting.php3
-rw-r--r--wp-includes/functions.php16
-rw-r--r--wp-includes/pluggable.php44
-rw-r--r--wp-includes/plugin.php1
-rw-r--r--wp-includes/post.php33
-rw-r--r--wp-includes/query.php67
-rw-r--r--wp-includes/rss.php57
-rw-r--r--wp-includes/update.php16
-rw-r--r--wp-includes/version.php4
-rw-r--r--wp-includes/widgets.php8
-rw-r--r--wp-includes/wpmu-functions.php87
-rw-r--r--wp-login.php2
-rw-r--r--wp-settings.php17
-rw-r--r--wp-signup.php18
-rw-r--r--wpmu-settings.php3
-rw-r--r--xmlrpc.php9
33 files changed, 525 insertions, 282 deletions
diff --git a/index-install.php b/index-install.php
index 3e9d08a..5fc4ba5 100644
--- a/index-install.php
+++ b/index-install.php
@@ -22,57 +22,158 @@ function printheader() {
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style media="screen" type="text/css">
- html {
- background: #eee;
- }
+ html { background: #f1f1f1; }
+
body {
background: #fff;
- color: #000;
- font-family: Georgia, "Times New Roman", Times, serif;
- margin-left: 20%;
- margin-right: 20%;
- padding: .2em 2em;
+ color: #333;
+ font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+ margin: 2em auto 0 auto;
+ width: 700px;
+ padding: 1em 2em;
+ -moz-border-radius: 12px;
+ -khtml-border-radius: 12px;
+ -webkit-border-radius: 12px;
+ border-radius: 12px;
}
- h1, h2 {
- color: #006;
- font-size: 18px;
- font-weight: lighter;
+ a { color: #2583ad; text-decoration: none; }
+
+ a:hover { color: #d54e21; }
+
+
+ h1 {
+ font-size: 18px;
+ margin-bottom: 0;
}
- p, li, dt {
- line-height: 140%;
+ h2 { font-size: 16px; }
+
+ p, li {
padding-bottom: 2px;
+ font-size: 13px;
+ line-height: 18px;
+ }
+
+ code {
+ font-size: 13px;
+ }
+
+ ul, ol { padding: 5px 5px 5px 22px; }
+
+ #logo { margin: 6px 0 14px 0px; border-bottom: none;}
+
+ .step {
+ margin: 20px 0 15px;
+ }
+
+ .step input {
+ font-size: 18px;
+ }
+
+ a.button {
+ font-size: 18px;
+ }
+
+ .step, th { text-align: left; padding: 0; }
+
+ .submit input, .button, .button-secondary {
+ font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+ padding: 5px 7px 7px;
+ border: 1px solid #a3a3a3;
+ margin-left: 0;
+ -moz-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ color: #246;
+ background: #e5e5e5;
+ }
+
+ .button-secondary {
+ background: #cee1ef;
+ }
+
+ .submit input:hover, .button:hover, .button-secondary:hover {
+ color: #d54e21;
+ border-color: #535353;
}
- ul, ol {
- padding: 5px 5px 5px 20px;
+ .form-table {
+ border-collapse: collapse;
+ margin-top: 1em;
+ width: 100%;
}
- #logo {
- margin-bottom: 2em;
+
+ .form-table td {
+ margin-bottom: 9px;
+ padding: 10px;
+ border-bottom: 8px solid #fff;
+ font-size: 12px;
}
- .step a, .step input {
- font-size: 2em;
+
+ .form-table th {
+ font-size: 13px;
+ text-align: left;
+ padding: 16px 10px 10px 10px;
+ border-bottom: 8px solid #fff;
+ width: 110px;
+ vertical-align: top;
}
- .step, th {
- text-align: right;
+
+ .form-table tr {
+ background: #eaf3fa;
}
- #footer {
- text-align: center; border-top: 1px solid #ccc; padding-top: 1em; font-style: italic;
+
+ .form-table code {
+ line-height: 18px;
+ font-size: 18px;
}
- .fakelink {
- color: #00a;
- text-decoration: underline;
+
+ .form-table p {
+ margin: 4px 0 0 0;
+ font-size: 11px;
+ }
+
+ .form-table input {
+ line-height: 20px;
+ font-size: 15px;
+ padding: 2px;
+ margin-bottom:3px;
+ }
+
+ h1 {
+ border-bottom: 1px solid #dadada;
+ clear: both;
+ color: #666666;
+ font: 24px Georgia, "Times New Roman", Times, serif;
+ margin: 5px 0 0 -4px;
+ padding: 0;
+ padding-bottom: 7px;
+ }
+
+ #error-page {
+ margin-top: 50px;
+ }
+
+ #error-page p {
+ font-size: 14px;
+ line-height: 16px;
+ margin: 25px 0 20px;
+ }
+
+ #error-page code {
+ font-size: 15px;
}
</style>
</head>
<body>
- <h1><img src="wp-includes/images/wordpress-mu.png" alt="WordPress &micro;" /></h1>
+ <h1 id="logo"><img src="wp-includes/images/wordpress-mu.png" alt="WordPress &micro;" /></h1>
<?php
}
function filestats( $err ) {
- print "<h1>Server Summary</h1>";
+ print "<h2>Server Summary</h2>";
print "<p>If you post a message to the &micro; support forum at <a target='_blank' href='http://mu.wordpress.org/forums/'>http://mu.wordpress.org/forums/</a> then copy and paste the following information into your message:</p>";
print "<blockquote style='background: #eee; border: 1px solid #333; padding: 5px;'>";
@@ -140,7 +241,7 @@ function do_htaccess( $oldfilename, $newfilename, $base, $url ) {
}
if( $err != '' ) {
- print "<h1>Warning!</h1>";
+ print "<h2>Warning!</h2>";
print "<p><strong>There was a problem creating the .htaccess file.</strong> </p>";
print "<p style='color: #900'>Error: ";
if( $err == "could not open $newfilename for writing" ) {
@@ -219,7 +320,7 @@ function step1() {
<p><strong>Welcome to WordPress &micro;.</strong> I will help you install this software by asking you a few questions and asking that you change the permissions on a few directories so I can create configuration files and make a directory to store all your uploaded files.</p>
<p>If you have installed the single-blog version of WordPress before, please note that the WordPress &micro; installer is different and trying to create the configuration file wp-config.php youself may result in a broken site. It's much easier to use this installer to get the job done.</p>
- <h3>What do I need?</h3>
+ <h2>What do I need?</h2>
<ul>
<li>Access to your server to change directory permissions. This can be done through ssh or ftp for example.</li>
<li>A valid email where your password and administrative emails will be sent.</li>
@@ -276,7 +377,7 @@ function printstep1form( $dbname = 'wordpress', $uname = 'username', $pwd = 'pas
<h2>Database</h2>
<p>Below you should enter your database connection details. If you're not sure about these, contact your host.</p>
- <table cellpadding='5'>
+ <table class="form-table">
<tr>
<th scope='row' width='33%'>Database Name</th>
<td><input name='dbname' type='text' size='45' value='<?php echo $dbname ?>' /></td>
@@ -296,24 +397,34 @@ function printstep1form( $dbname = 'wordpress', $uname = 'username', $pwd = 'pas
</table>
<h2>Server Address</h2>
- <p><label>What is the Internet address of your site? You should enter the shortest address possible. For example, use <em>example.com</em> instead of <em>www.example.com</em> but if you are going to use an address like <em>blogs.example.com</em> then enter that unaltered in the box below.<br />
- <label><strong>Server Address:</strong> <input type='text' name='basedomain' value='<?php echo $hostname ?>'></label>
- </p>
+ <table class="form-table">
+ <tr>
+ <th scope='row'>Server Address</th>
+ <td>
+ <input type='text' name='basedomain' value='<?php echo $hostname ?>' />
+ <br />What is the Internet address of your site? You should enter the shortest address possible. For example, use <em>example.com</em> instead of <em>www.example.com</em> but if you are going to use an address like <em>blogs.example.com</em> then enter that unaltered in the box below.
+ </td>
+ </tr>
+ </table>
<h2>Site Details</h2>
- <table width='100%'>
+ <table class="form-table">
<tr>
<th scope='row'>Site&nbsp;Title</th>
- <td><input name='weblog_title' type='text' size='45' value='<?php echo $weblog_title ?>' /></td>
- <td>What would you like to call your site? </td>
+ <td>
+ <input name='weblog_title' type='text' size='45' value='<?php echo $weblog_title ?>' />
+ <br />What would you like to call your site?
+ </td>
</tr>
<tr>
<th scope='row'>Email</th>
- <td><input name='email' type='text' size='45' value='<?php echo $email ?>' /></td>
- <td>Your email address.</td>
+ <td>
+ <input name='email' type='text' size='45' value='<?php echo $email ?>' />
+ <br />Your email address.
+ </td>
</tr>
</table>
- <p class='submit'><input name='submit' type='submit' value='Submit' /></p>
+ <p class='submit'><input class="button" name='submit' type='submit' value='Submit' /></p>
</form>
<?php
}
@@ -456,10 +567,12 @@ Thanks!
$msg = "Your new WordPress MU site has been created at\nhttp://{$domain}{$base}\n\nLogin details:\nUsername: admin\nPassword: $pass\nLogin: http://{$domain}{$base}wp-login.php\n";
wp_mail( $email, "Your new WordPress MU site is ready!", $msg, "From: wordpress@" . $_SERVER[ 'HTTP_HOST' ] );
- ?><h2>Installation Finished!</h2>
+ ?>
+ <h2>Installation Finished!</h2>
<p>Congratulations! <br />Your <a href='http://<?php echo $domain . $base; ?>'>WordPress &micro; site</a> has been configured.</p>
- <p>You can <a href='wp-login.php'>log in</a> using the username "admin" and password <?php echo $pass; ?></p>
- <h3>Directory Permissions</h3>
+ <p>You can <a class="button" href='wp-login.php'>log in</a> using the username "admin" and password <?php echo $pass; ?></p>
+
+ <h2>Directory Permissions</h2>
<p>Please remember to reset the permissions on the following directories:
<ul>
<?php
@@ -471,16 +584,18 @@ Thanks!
</ul>
</p>
<p>You can probably use the following command to fix the permissions but check with your host if it doubt:
- <br /><code>chmod&nbsp;755&nbsp;
+ <br />
+ <code>chmod&nbsp;755&nbsp;
<?php
reset( $dirs );
foreach( (array) $dirs as $dir ) {
echo "$dir&nbsp;";
}
- ?></code>
+ ?>
+ </code>
</p>
- <h3>Further reading</h3>
+ <h2>Further reading</h2>
<p>
<ul>
<li>If you run into problems, please search the <a href='http://mu.wordpress.org/forums/'>WordPress &micro; Forums</a> where you will most likely find a solution. Please don't post there before searching. It's not polite.</li>
@@ -494,7 +609,7 @@ Thanks!
function nowww() {
$nowww = str_replace( 'www.', '', $_POST[ 'basedomain' ] );
?>
- <h1>No-www</h1>
+ <h2>No-www</h2>
<p>WordPress &micro; strips the string "www" from the URLs of sites using this software. It is still possible to visit your site using the "www" prefix with an address like <em><?php echo $_POST[ 'basedomain' ] ?></em> but any links will not have the "www" prefix. They will instead point at <?php echo $nowww ?>.</p>
<p>The preferred method of hosting blogs is without the "www" prefix as it's more compact and simple.</p>
<p>You can still use "<?php echo $_POST[ 'basedomain' ] ?>" and URLs like "www.blog1.<?php echo $nowww; ?>" to address your site and blogs after installation but internal links will use the <?php echo $nowww ?> format.</p>
@@ -511,7 +626,7 @@ function nowww() {
<input type='hidden' name='email' value='<?php echo $_POST[ 'email' ]; ?>' />
<input type='hidden' name='action' value='step2' />
<input type='hidden' name='basedomain' value='<?echo $nowww ?>' />
- <input type='submit' value='Continue' />
+ <input class="button" type='submit' value='Continue' />
</form>
</p>
<?php
diff --git a/wp-admin/admin-footer.php b/wp-admin/admin-footer.php
index 889c2f9..8e707b1 100644
--- a/wp-admin/admin-footer.php
+++ b/wp-admin/admin-footer.php
@@ -4,7 +4,10 @@
<div id="footer">
<p><?php
do_action('in_admin_footer', '');
-$footer_text = __('Thank you for creating with <a href="http://mu.wordpress.org/">WordPress MU</a>') . ' | ' . __('<a href="http://mu.wordpress.org/docs/">Documentation</a>');
+$footer_text = __('Thank you for creating with <a href="http://mu.wordpress.org/">WordPress MU</a>');
+if( is_site_admin() )
+ $footer_text .= ' ' . $wpmu_version;
+$footer_text .= ' | ' . __('<a href="http://mu.wordpress.org/docs/">Documentation</a>');
echo apply_filters( 'admin_footer_text', $footer_text );
?></p>
</div>
diff --git a/wp-admin/css/press-this-ie.css b/wp-admin/css/press-this-ie.css
index 54a1bfe..e9667c1 100644
--- a/wp-admin/css/press-this-ie.css
+++ b/wp-admin/css/press-this-ie.css
@@ -1,8 +1,7 @@
-
-#posting {
- position: static !important;
-}
- .ui-tabs-nav {
- margin-left: 0;
- border: 0 !important;
-}
+#posting {
+ position: static !important;
+}
+ .ui-tabs-nav {
+ margin-left: 0;
+ border: 0 !important;
+}
diff --git a/wp-admin/edit-tag-form.php b/wp-admin/edit-tag-form.php
index de0f6c8..087873c 100644
--- a/wp-admin/edit-tag-form.php
+++ b/wp-admin/edit-tag-form.php
@@ -29,11 +29,6 @@ if ( ! empty($tag_ID) ) {
<td><input name="name" id="name" type="text" value="<?php echo attribute_escape($tag->name); ?>" size="40" aria-required="true" />
<p><?php _e('The name is how the tag appears on your site.'); ?></p></td>
</tr>
- <tr class="form-field">
- <th scope="row" valign="top"><label for="slug"><?php _e('Tag slug') ?></label></th>
- <td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
- <p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td>
- </tr>
</table>
<p class="submit"><input type="submit" class="button" name="submit" value="<?php echo $submit_text ?>" /></p>
<?php do_action('edit_tag_form', $tag); ?>
diff --git a/wp-admin/import/textpattern.php b/wp-admin/import/textpattern.php
index c3fb1d7..bbddc08 100644
--- a/wp-admin/import/textpattern.php
+++ b/wp-admin/import/textpattern.php
@@ -333,7 +333,7 @@ class Textpattern_Import {
$category1 = get_category_by_slug($Category1);
$category1 = $category1->term_id;
$category2 = get_category_by_slug($Category2);
- $category2 = $category1->term_id;
+ $category2 = $category2->term_id;
if($cat1 = $category1) { $cats[1] = $cat1; }
if($cat2 = $category2) { $cats[2] = $cat2; }
diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php
index 7699f98..8de2907 100644
--- a/wp-admin/includes/image.php
+++ b/wp-admin/includes/image.php
@@ -219,17 +219,17 @@ function wp_read_image_metadata( $file ) {
if ( !empty($info['APP13']) ) {
$iptc = iptcparse($info['APP13']);
if ( !empty($iptc['2#110'][0]) ) // credit
- $meta['credit'] = trim( $iptc['2#110'][0] );
+ $meta['credit'] = utf8_encode(trim($iptc['2#110'][0]));
elseif ( !empty($iptc['2#080'][0]) ) // byline
- $meta['credit'] = trim( $iptc['2#080'][0] );
+ $meta['credit'] = utf8_encode(trim($iptc['2#080'][0]));
if ( !empty($iptc['2#055'][0]) and !empty($iptc['2#060'][0]) ) // created datee and time
$meta['created_timestamp'] = strtotime($iptc['2#055'][0] . ' ' . $iptc['2#060'][0]);
if ( !empty($iptc['2#120'][0]) ) // caption
- $meta['caption'] = trim( $iptc['2#120'][0] );
+ $meta['caption'] = utf8_encode(trim($iptc['2#120'][0]));
if ( !empty($iptc['2#116'][0]) ) // copyright
- $meta['copyright'] = trim( $iptc['2#116'][0] );
+ $meta['copyright'] = utf8_encode(trim($iptc['2#116'][0]));
if ( !empty($iptc['2#005'][0]) ) // title
- $meta['title'] = trim( $iptc['2#005'][0] );
+ $meta['title'] = utf8_encode(trim($iptc['2#005'][0]));
}
}
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index d91ffc2..12ae283 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -618,11 +618,11 @@ function get_attachment_fields_to_edit($post, $errors = null) {
'input' => 'html',
'html' => "
<input type='text' name='attachments[$post->ID][url]' value='" . attribute_escape($file) . "' /><br />
- <button type='button' class='button url-$post->ID' value=''>" . __('None') . "</button>
- <button type='button' class='button url-$post->ID' value='" . attribute_escape($file) . "'>" . __('File URL') . "</button>
- <button type='button' class='button url-$post->ID' value='" . attribute_escape($link) . "'>" . __('Post URL') . "</button>
+ <button type='button' class='button url-$post->ID' title=''>" . __('None') . "</button>
+ <button type='button' class='button url-$post->ID' title='" . attribute_escape($file) . "'>" . __('File URL') . "</button>
+ <button type='button' class='button url-$post->ID' title='" . attribute_escape($link) . "'>" . __('Post URL') . "</button>
<script type='text/javascript'>
- jQuery('button.url-$post->ID').bind('click', function(){jQuery(this).siblings('input').val(this.value);});
+ jQuery('button.url-$post->ID').bind('click', function(){jQuery(this).siblings('input').val(jQuery(this).attr('title'));});
</script>\n",
'helps' => __('Enter a link URL or click above for presets.'),
),
@@ -813,7 +813,7 @@ function get_media_item( $attachment_id, $args = null ) {
if ( !empty($field[$field['input']]) )
$item .= $field[$field['input']];
elseif ( $field['input'] == 'textarea' ) {
- $item .= "<textarea type='text' id='$name' name='$name'>" . attribute_escape( $field['value'] ) . $aria_required . "</textarea>";
+ $item .= "<textarea type='text' id='$name' name='$name'" . $aria_required . ">" . htmlspecialchars( $field['value'] ) . "</textarea>";
} else {
$item .= "<input type='text' id='$name' name='$name' value='" . attribute_escape( $field['value'] ) . "'" . $aria_required . "/>";
}
diff --git a/wp-admin/includes/mu.php b/wp-admin/includes/mu.php
index d30bd84..f289132 100644
--- a/wp-admin/includes/mu.php
+++ b/wp-admin/includes/mu.php
@@ -46,7 +46,7 @@ function wpmu_delete_blog($blog_id, $drop = false) {
reset( $drop_tables );
foreach ( (array) $drop_tables as $name ) {
- $wpdb->query( "DROP TABLE IF EXISTS ". current( $name ) ."" );
+ $wpdb->query( "DROP TABLE IF EXISTS ". current( $name ) ."" );
}
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->blogs WHERE blog_id = %d", $blog_id) );
@@ -133,9 +133,9 @@ function wpmu_delete_user($id) {
function confirm_delete_users( $users ) {
if( !is_array( $users ) )
return false;
-
+
echo '<p>' . __( 'Transfer posts before deleting users:' ) . '</p>';
-
+
echo '<form action="wpmu-edit.php?action=allusers" method="post">';
echo '<input type="hidden" name="alluser_transfer_delete" />';
wp_nonce_field( 'allusers' );
@@ -427,15 +427,15 @@ function wpmu_menu() {
$submenu[ 'wpmu-admin.php' ][30] = array( __('Upgrade'), '10', 'wpmu-upgrade-site.php' );
}
unset( $submenu['themes.php'][10] );
- unset( $submenu['plugins.php'][5] );
- unset( $submenu['plugins.php'][10] );
- unset( $menu['35'] ); // Plugins
$menu_perms = get_site_option( "menu_items" );
if( is_array( $menu_perms ) == false )
$menu_perms = array();
- if( $menu_perms[ 'plugins' ] == 1 )
- $menu[35] = array(__('Plugins'), 'activate_plugins', 'plugins.php');
+ if( $menu_perms[ 'plugins' ] != 1 ) {
+ unset( $submenu['plugins.php'][5] );
+ unset( $menu['35'] ); // Plugins
+ }
+ unset( $submenu['plugins.php'][10] ); // always remove the plugin editor
}
add_action( '_admin_menu', 'wpmu_menu' );
@@ -662,9 +662,24 @@ function mu_media_buttons() {
$context = apply_filters('media_buttons_context', __('Add media: %s'));
$media_upload_iframe_src = "media-upload.php?post_id=$uploading_iframe_ID";
$media_title = __('Add Media');
- $out = <<<EOF
- <a href="{$media_upload_iframe_src}&amp;TB_iframe=true&amp;height=500&amp;width=640" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>
-EOF;
+ $mu_media_buttons = get_site_option( 'mu_media_buttons' );
+ $out = '';
+ if( $mu_media_buttons[ 'image' ] ) {
+ $image_upload_iframe_src = apply_filters('image_upload_iframe_src', "$media_upload_iframe_src&amp;type=image");
+ $image_title = __('Add an Image');
+ $out .= "<a href='{$image_upload_iframe_src}&amp;TB_iframe=true' id='add_image' class='thickbox' title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>";
+ }
+ if( $mu_media_buttons[ 'video' ] ) {
+ $video_upload_iframe_src = apply_filters('video_upload_iframe_src', "$media_upload_iframe_src&amp;type=video");
+ $video_title = __('Add Video');
+ $out .= "<a href='{$video_upload_iframe_src}&amp;TB_iframe=true' id='add_video' class='thickbox' title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>";
+ }
+ if( $mu_media_buttons[ 'audio' ] ) {
+ $audio_upload_iframe_src = apply_filters('audio_upload_iframe_src', "$media_upload_iframe_src&amp;type=audio");
+ $audio_title = __('Add Audio');
+ $out .= "<a href='{$audio_upload_iframe_src}&amp;TB_iframe=true' id='add_audio' class='thickbox' title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a>";
+ }
+ $out .= "<a href='{$media_upload_iframe_src}&amp;TB_iframe=true&amp;height=500&amp;width=640' class='thickbox' title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>";
printf($context, $out);
}
add_action( 'media_buttons', 'mu_media_buttons' );
@@ -694,10 +709,6 @@ function mu_dashboard() {
}
add_action( 'wp_dashboard_setup', 'mu_dashboard' );
-/* Unused update message called from Dashboard */
-function update_right_now_message() {
-}
-
function profile_update_primary_blog() {
global $current_user;
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index 3d6aac5..e132733 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -715,7 +715,7 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num ) {
$approved
ORDER BY comment_date_gmt DESC LIMIT $start, $num");
} else {
- $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments USE INDEX (comment_date_gmt) WHERE $approved ORDER BY comment_date_gmt DESC LIMIT $start, $num" );
+ $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE $approved ORDER BY comment_date_gmt DESC LIMIT $start, $num" );
}
update_comment_cache($comments);
diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php
index 5cc83f7..da1bb56 100644
--- a/wp-admin/includes/update.php
+++ b/wp-admin/includes/update.php
@@ -1,13 +1,14 @@
<?php
-/*
// The admin side of our 1.1 update system
function core_update_footer( $msg = '' ) {
+ if( !is_site_admin() )
+ return false;
if ( !current_user_can('manage_options') )
return sprintf( '| '.__( 'Version %s' ), $GLOBALS['wp_version'] );
- $cur = get_option( 'update_core' );
+ $cur = get_site_option( 'update_core' );
switch ( $cur->response ) {
case 'development' :
@@ -29,13 +30,15 @@ function core_update_footer( $msg = '' ) {
add_filter( 'update_footer', 'core_update_footer' );
function update_nag() {
- $cur = get_option( 'update_core' );
+ if( !is_site_admin() )
+ return false;
+ $cur = get_site_option( 'update_core' );
if ( ! isset( $cur->response ) || $cur->response != 'upgrade' )
return false;
if ( current_user_can('manage_options') )
- $msg = sprintf( __('WordPress %2$s is available! <a href="%1$s">Please update now</a>.'), $cur->url, $cur->current );
+ $msg = sprintf( __('<strong>Site Administrator</strong>: WordPress %2$s is available! A new version of WordPress MU will be <a href="%1$s">available</a> soon.'), $cur->url, $cur->current );
else
$msg = sprintf( __('WordPress %2$s is available! Please notify the site administrator.'), $cur->url, $cur->current );
@@ -45,7 +48,9 @@ add_action( 'admin_notices', 'update_nag', 3 );
// Called directly from dashboard
function update_right_now_message() {
- $cur = get_option( 'update_core' );
+ if( !is_site_admin() )
+ return false;
+ $cur = get_site_option( 'update_core' );
$msg = sprintf( __('This is WordPress version %s.'), $GLOBALS['wp_version'] );
if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('manage_options') )
@@ -53,7 +58,6 @@ function update_right_now_message() {
echo "<span id='wp-version-message'>$msg</span>";
}
-*/
function wp_plugin_update_row( $file, $plugin_data ) {
if( !is_site_admin() )
diff --git a/wp-admin/users.php b/wp-admin/users.php
index 0321cce..2fff69f 100644
--- a/wp-admin/users.php
+++ b/wp-admin/users.php
@@ -128,6 +128,7 @@ case 'delete':
<?php
$go_delete = false;
foreach ( (array) $userids as $id ) {
+ $id = (int) $id;
$user = new WP_User($id);
if ( $id == $current_user->ID ) {
echo "<li>" . sprintf(__('ID #%1s: %2s <strong>The current user will not be deleted.</strong>'), $id, $user->user_login) . "</li>\n";
diff --git a/wp-admin/wpmu-edit.php b/wp-admin/wpmu-edit.php
index 7e4b3f6..337b591 100644
--- a/wp-admin/wpmu-edit.php
+++ b/wp-admin/wpmu-edit.php
@@ -61,6 +61,7 @@ switch( $_GET['action'] ) {
}
update_site_option( "menu_items", $_POST['menu_items'] );
+ update_site_option( "mu_media_buttons", $_POST['mu_media_buttons'] );
update_site_option( "blog_upload_space", $_POST['blog_upload_space'] );
update_site_option( "upload_filetypes", $_POST['upload_filetypes'] );
update_site_option( "site_name", $_POST['site_name'] );
@@ -112,6 +113,11 @@ switch( $_GET['action'] ) {
$path = $base.$domain.'/';
}
+ $domain = strtolower( $domain );
+ $newdomain = strtolower( $newdomain );
+ $path = strtolower( $path );
+
+ $password = 'N/A';
$user_id = email_exists($email);
if( !$user_id ) {
$password = generate_random_password();
@@ -131,6 +137,7 @@ switch( $_GET['action'] ) {
update_user_option( $user_id, 'primary_blog', $id, true );
$content_mail = sprintf( __( "New blog created by %1s\n\nAddress: http://%2s\nName: %3s"), $current_user->user_login , $newdomain.$path, stripslashes( $title ) );
wp_mail( get_site_option('admin_email'), sprintf(__('[%s] New Blog Created'), $current_site->site_name), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' );
+ wpmu_welcome_notification( $id, $user_id, $password, $title, array( "public" => 1 ) );
wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'add-blog'), $_SERVER['HTTP_REFERER'] ) );
exit();
} else {
diff --git a/wp-admin/wpmu-options.php b/wp-admin/wpmu-options.php
index cd772a4..71d8342 100644
--- a/wp-admin/wpmu-options.php
+++ b/wp-admin/wpmu-options.php
@@ -117,6 +117,14 @@ if (isset($_GET['updated'])) {
</tr>
<tr valign="top">
+ <th scope="row"><?php _e('Upload media button') ?></th>
+ <?php $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ); ?>
+ <td><label><input type='checkbox' id="mu_media_buttons_image" name="mu_media_buttons[image]" value='1' <?php if( $mu_media_buttons[ 'image' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Images' ); ?></label><br />
+ <label><input type='checkbox' id="mu_media_buttons_video" name="mu_media_buttons[video]" value='1' <?php if( $mu_media_buttons[ 'video' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Videos' ); ?></label><br />
+ <label><input type='checkbox' id="mu_media_buttons_audio" name="mu_media_buttons[audio]" value='1' <?php if( $mu_media_buttons[ 'audio' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Music' ); ?></label><br />
+ <?php _e( 'The media upload buttons to display on the "Write Post" page. Make sure you update the "Upload File Types" below as well.' ); ?></td>
+ </tr>
+ <tr valign="top">
<th scope="row"><?php _e('Blog upload space') ?></th>
<td><input name="blog_upload_space" type="text" id="blog_upload_space" value="<?php echo get_site_option('blog_upload_space', 10) ?>" size="3" /> MB</td>
</tr>
diff --git a/wp-admin/wpmu-users.php b/wp-admin/wpmu-users.php
index a2bad03..43ed315 100644
--- a/wp-admin/wpmu-users.php
+++ b/wp-admin/wpmu-users.php
@@ -107,7 +107,7 @@ if ( $_GET['updated'] == 'true' ) {
<br class="clear" />
<?php if( isset($_GET['s']) && $_GET['s'] != '' ) : ?>
- <p><a href="wpmu-blogs.php?action=blogs&amp;s=<?php echo urlencode( stripslashes( $s ) ); ?>"><?php _e('Search Blogs:') ?> <strong><?php echo stripslashes( $s ) ?></strong></a></p>
+ <p><a href="wpmu-blogs.php?action=blogs&amp;s=<?php echo urlencode( stripslashes( $s ) ); ?>&blog_name=Search+blogs+by+name"><?php _e('Search Blogs:') ?> <strong><?php echo stripslashes( $s ) ?></strong></a></p>
<?php endif; ?>
<?php
diff --git a/wp-content/themes/home/searchform.php b/wp-content/themes/home/searchform.php
index 2282083..300a1c4 100644
--- a/wp-content/themes/home/searchform.php
+++ b/wp-content/themes/home/searchform.php
@@ -1,4 +1,5 @@
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
+<label class="hidden" for="s"><?php _e('Search for:'); ?></label>
<div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
diff --git a/wp-includes/class-snoopy.php b/wp-includes/class-snoopy.php
index 5ec5dce..b1b32d2 100644
--- a/wp-includes/class-snoopy.php
+++ b/wp-includes/class-snoopy.php
@@ -1,22 +1,12 @@
<?php
-/**
- * Snoopy - the PHP net client
- * @author Monte Ohrt <monte@ispi.net>
- * @copyright 1999-2000 ispi, all rights reserved
- * @version 1.01
- * @license GNU Lesser GPL
- * @link http://snoopy.sourceforge.net/
- * @package Snoopy
- */
-
if ( !in_array('Snoopy', get_declared_classes() ) ) :
-/**
- * Snoopy - the PHP net client
- *
- * @author Monte Ohrt <monte@ispi.net>
- * @copyright (c): 1999-2000 ispi, all rights reserved
- * @version 1.01
- *
+/*************************************************
+
+Snoopy - the PHP net client
+Author: Monte Ohrt <monte@ispi.net>
+Copyright (c): 1999-2008 New Digital Group, all rights reserved
+Version: 1.2.4
+
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@@ -30,19 +20,15 @@ if ( !in_array('Snoopy', get_declared_classes() ) ) :
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * You may contact the author of Snoopy by e-mail at:
- * monte@ispi.net
- *
- * Or, write to:
- * Monte Ohrt
- * CTO, ispi
- * 237 S. 70th suite 220
- * Lincoln, NE 68510
- *
- * @link http://snoopy.sourceforge.net/ The latest version of Snoopy can be
- * obtained
- */
+
+You may contact the author of Snoopy by e-mail at:
+monte@ohrt.com
+
+The latest version of Snoopy can be obtained from:
+http://snoopy.sourceforge.net/
+
+*************************************************/
+
class Snoopy
{
/**** Public variables ****/
@@ -56,7 +42,7 @@ class Snoopy
var $proxy_user = ""; // proxy user to use
var $proxy_pass = ""; // proxy password to use
- var $agent = "Snoopy v1.2.3"; // agent we masquerade as
+ var $agent = "Snoopy v1.2.4"; // agent we masquerade as
var $referer = ""; // referer info to pass
var $cookies = array(); // array of cookies to pass
// $cookies["username"]="joe";
@@ -85,7 +71,7 @@ class Snoopy
var $error = ""; // error messages sent here
var $response_code = ""; // response code returned from server
var $headers = array(); // headers returned from server sent here
- var $maxlength = 8192; // max return data length (body)
+ var $maxlength = 500000; // max return data length (body)
var $read_timeout = 0; // timeout on read operations, in seconds
// supported only since PHP 4 Beta 4
// set to 0 to disallow timeouts
@@ -727,13 +713,13 @@ class Snoopy
chr(176),
chr(39),
chr(128),
- "ä",
- "ö",
- "ü",
- "Ä",
- "Ö",
- "Ü",
- "ß",
+ "ä",
+ "ö",
+ "ü",
+ "Ä",
+ "Ö",
+ "Ü",
+ "ß",
);
$text = preg_replace($search,$replace,$document);
@@ -1020,8 +1006,7 @@ class Snoopy
$headerfile = tempnam($temp_dir, "sno");
- $safer_URI = strtr( $URI, "\"", " " ); // strip quotes from the URI to avoid shell access
- exec(escapeshellcmd($this->curl_path." -D \"$headerfile\"".$cmdline_params." \"".$safer_URI."\""),$results,$return);
+ exec($this->curl_path." -k -D \"$headerfile\"".$cmdline_params." \"".escapeshellcmd($URI)."\"",$results,$return);
if($return)
{
@@ -1245,9 +1230,7 @@ class Snoopy
if (!is_readable($file_name)) continue;
$fp = fopen($file_name, "r");
- while (!feof($fp)) {
- $file_content .= fread($fp, filesize($file_name));
- }
+ $file_content = fread($fp, filesize($file_name));
fclose($fp);
$base_name = basename($file_name);
@@ -1264,5 +1247,4 @@ class Snoopy
}
}
endif;
-
?>
diff --git a/wp-includes/feed.php b/wp-includes/feed.php
index 3ff5b9a..7b3138e 100644
--- a/wp-includes/feed.php
+++ b/wp-includes/feed.php
@@ -495,10 +495,14 @@ function prep_atom_text_construct($data) {
* @since 2.5
*/
function self_link() {
- echo 'http'
- . ( $_SERVER['https'] == 'on' ? 's' : '' ) . '://'
- . $_SERVER['HTTP_HOST']
- . wp_specialchars(stripslashes($_SERVER['REQUEST_URI']), 1);
+ $host = @parse_url(get_option('home'));
+ $host = $host['host'];
+ echo clean_url(
+ 'http'
+ . ( (isset($_SERVER['https']) && $_SERVER['https'] == 'on') ? 's' : '' ) . '://'
+ . $host
+ . stripslashes($_SERVER['REQUEST_URI'])
+ );
}
?>
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index e2b969a..eeafe0b 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -332,6 +332,9 @@ function sanitize_user( $username, $strict = false ) {
if ( $strict )
$username = preg_replace('|[^a-z0-9 _.\-@]|i', '', $username);
+ // Consolidate contiguous whitespace
+ $username = preg_replace('|\s+|', ' ', $username);
+
return apply_filters('sanitize_user', $username, $raw_username, $strict);
}
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 261097e..9f482af 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -319,7 +319,7 @@ function is_serialized_string( $data ) {
* @param string $setting Name of option to retrieve. Should already be SQL-escaped
* @return mixed Value set for the option.
*/
-function get_option( $setting ) {
+function get_option( $setting, $default = false ) {
global $wpdb, $switched, $current_blog;
$wpdb->hide_errors();
@@ -330,7 +330,7 @@ function get_option( $setting ) {
$value = _get_option_cache( $setting );
if ( false === $value )
- return false;
+ return $default;
// If home is not set use siteurl.
if ( 'home' == $setting && '' == $value )
@@ -392,13 +392,13 @@ function form_option( $option ) {
* @return array List of all options.
*/
function get_alloptions() {
- global $wpdb, $wp_queries;
+ global $wpdb;
$show = $wpdb->hide_errors();
if ( !$options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'" ) )
$options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" );
$wpdb->show_errors($show);
- foreach ( $options as $option ) {
+ foreach ( (array) $options as $option ) {
// "When trying to design a foolproof system,
// never underestimate the ingenuity of the fools :)" -- Dougal
if ( in_array( $option->option_name, array( 'siteurl', 'home', 'category_base', 'tag_base' ) ) )
@@ -441,8 +441,8 @@ function wp_load_alloptions() {
}
$suppress = $wpdb->suppress_errors();
- if ( !$alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'" ) )
- $alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" );
+ // order by option_id asc in case there are duplicate values - this makes the most recent value overwrite the others in the array
+ $alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options FORCE INDEX(PRIMARY) ORDER BY option_id ASC" );
$wpdb->suppress_errors($suppress);
foreach ( (array) $alloptions_db as $o )
$_wp_alloptions[$blog_id][$o->option_name] = $o->option_value;
@@ -1481,7 +1481,7 @@ function wp_upload_dir( $time = NULL ) {
// $dir is absolute, $path is (maybe) relative to ABSPATH
$dir = path_join( ABSPATH, $dir );
-
+
if ( !$url = get_option( 'upload_url_path' ) ) {
if ( empty($upload_path) or ( $upload_path == $dir ) )
$url = WP_CONTENT_URL . '/uploads';
@@ -1515,7 +1515,7 @@ function wp_upload_dir( $time = NULL ) {
$message = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), $dir );
return array( 'error' => $message );
}
-
+
$uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'basedir' => $bdir, 'baseurl' => $burl, 'error' => false );
return apply_filters( 'upload_dir', $uploads );
diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php
index 0007633..8ca7ba1 100644
--- a/wp-includes/pluggable.php
+++ b/wp-includes/pluggable.php
@@ -1295,11 +1295,53 @@ function wp_generate_password($length = 12, $special_chars = true) {
$password = '';
for ( $i = 0; $i < $length; $i++ )
- $password .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
+ $password .= substr($chars, wp_rand(0, strlen($chars) - 1), 1);
return $password;
}
endif;
+if ( !function_exists('wp_rand') ) :
+ /**
+ * Generates a random number
+ *
+ * @since 2.6.2
+ *
+ * @param int $min Lower limit for the generated number (optional, default is 0)
+ * @param int $max Upper limit for the generated number (optional, default is 4294967295)
+ * @return int A random number between min and max
+ */
+function wp_rand( $min = 0, $max = 0 ) {
+ global $rnd_value;
+
+ $seed = get_option('random_seed');
+
+ // Reset $rnd_value after 14 uses
+ // 32(md5) + 40(sha1) + 40(sha1) / 8 = 14 random numbers from $rnd_value
+ if ( strlen($rnd_value) < 8 ) {
+ $rnd_value = md5( uniqid(microtime() . mt_rand(), true ) . $seed );
+ $rnd_value .= sha1($rnd_value);
+ $rnd_value .= sha1($rnd_value . $seed);
+ $seed = md5($seed . $rnd_value);
+ update_option('random_seed', $seed);
+ }
+
+ // Take the first 8 digits for our value
+ $value = substr($rnd_value, 0, 8);
+
+ // Strip the first eight, leaving the remainder for the next call to wp_rand().
+ $rnd_value = substr($rnd_value, 8);
+
+ $value = abs(hexdec($value));
+
+ // Reduce the value to be within the min - max range
+ // 4294967295 = 0xffffffff = max random number
+ if ( $max != 0 )
+ $value = $min + (($max - $min + 1) * ($value / (4294967295 + 1)));
+
+ return abs(intval($value));
+}
+endif;
+
if ( !function_exists('wp_set_password') ) :
/**
* Updates the user's password with a new encrypted one.
diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php
index 57e2677..c161119 100644
--- a/wp-includes/plugin.php
+++ b/wp-includes/plugin.php
@@ -452,6 +452,7 @@ function plugin_basename($file) {
$plugin_dir = str_replace('\\','/',WP_PLUGIN_DIR); // sanitize for Win32 installs
$plugin_dir = preg_replace('|/+|','/', $plugin_dir); // remove any duplicate slash
$file = preg_replace('|^' . preg_quote($plugin_dir, '|') . '/|','',$file); // get relative path from plugins dir
+
$file = preg_replace('|^.*/' . MUPLUGINDIR . '/|','',$file); // get relative path from plugins dir
return $file;
}
diff --git a/wp-includes/post.php b/wp-includes/post.php
index bf7d922..0a580f9 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -465,7 +465,7 @@ function get_posts($args = null) {
'order' => 'DESC', 'include' => '',
'exclude' => '', 'meta_key' => '',
'meta_value' =>'', 'post_type' => 'post',
- 'post_parent' => 0
+ 'post_parent' => 0, 'suppress_filters' => true
);
$r = wp_parse_args( $args, $defaults );
@@ -549,7 +549,9 @@ function add_post_meta($post_id, $meta_key, $meta_value, $unique = false) {
function delete_post_meta($post_id, $key, $value = '') {
global $wpdb;
- $post_id = absint( $post_id );
+ // make sure meta is added to the post, not a revision
+ if ( $the_post = wp_is_post_revision($post_id) )
+ $post_id = $the_post;
// expected_slashed ($key, $value)
$key = stripslashes( $key );
@@ -594,27 +596,20 @@ function get_post_meta($post_id, $key, $single = false) {
$meta_cache = wp_cache_get($post_id, 'post_meta');
+ if ( !$meta_cache ) {
+ update_postmeta_cache($post_id);
+ $meta_cache = wp_cache_get($post_id, 'post_meta');
+ }
+
if ( isset($meta_cache[$key]) ) {
if ( $single ) {
return maybe_unserialize( $meta_cache[$key][0] );
} else {
- return maybe_unserialize( $meta_cache[$key] );
+ return array_map('maybe_unserialize', $meta_cache[$key]);
}
}
- if ( !$meta_cache ) {
- update_postmeta_cache($post_id);
- $meta_cache = wp_cache_get($post_id, 'post_meta');
- }
-
- if ( $single ) {
- if ( isset($meta_cache[$key][0]) )
- return maybe_unserialize($meta_cache[$key][0]);
- else
- return '';
- } else {
- return maybe_unserialize($meta_cache[$key]);
- }
+ return '';
}
/**
@@ -637,6 +632,10 @@ function get_post_meta($post_id, $key, $single = false) {
function update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '') {
global $wpdb;
+ // make sure meta is added to the post, not a revision
+ if ( $the_post = wp_is_post_revision($post_id) )
+ $post_id = $the_post;
+
// expected_slashed ($meta_key)
$meta_key = stripslashes($meta_key);
@@ -3297,7 +3296,7 @@ function _wp_put_post_revision( $post = null, $autosave = false ) {
if ( !$post || empty($post['ID']) )
return;
- if ( isset($post['post_type']) && 'revision' == $post_post['type'] )
+ if ( isset($post['post_type']) && 'revision' == $post['post_type'] )
return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
$post = _wp_post_revision_fields( $post, $autosave );
diff --git a/wp-includes/query.php b/wp-includes/query.php
index 35e53f3..e318020 100644
--- a/wp-includes/query.php
+++ b/wp-includes/query.php
@@ -775,7 +775,7 @@ class WP_Query {
if ( !empty($qv['post_status']) )
$qv['post_status'] = preg_replace('|[^a-z0-9_,-]|', '', $qv['post_status']);
- if ( $this->is_posts_page && !$qv['withcomments'] )
+ if ( $this->is_posts_page && ( ! isset($qv['withcomments']) || ! $qv['withcomments'] ) )
$this->is_comment_feed = false;
$this->is_singular = $this->is_single || $this->is_page || $this->is_attachment;
@@ -829,7 +829,12 @@ class WP_Query {
$join = '';
$search = '';
$groupby = '';
+ $fields = "$wpdb->posts.*";
$post_status_join = false;
+ $page = 1;
+
+ if ( !isset($q['suppress_filters']) )
+ $q['suppress_filters'] = false;
if ( !isset($q['post_type']) ) {
if ( $this->is_search )
@@ -1361,8 +1366,10 @@ class WP_Query {
// Apply filters on where and join prior to paging so that any
// manipulations to them are reflected in the paging by day queries.
- $where = apply_filters('posts_where', $where);
- $join = apply_filters('posts_join', $join);
+ if ( !$q['suppress_filters'] ) {
+ $where = apply_filters('posts_where', $where);
+ $join = apply_filters('posts_join', $join);
+ }
// Paging
if ( empty($q['nopaging']) && !$this->is_singular ) {
@@ -1394,9 +1401,11 @@ class WP_Query {
$cgroupby = '';
}
- $cjoin = apply_filters('comment_feed_join', $cjoin);
- $cwhere = apply_filters('comment_feed_where', $cwhere);
- $cgroupby = apply_filters('comment_feed_groupby', $cgroupby);
+ if ( !$q['suppress_filters'] ) {
+ $cjoin = apply_filters('comment_feed_join', $cjoin);
+ $cwhere = apply_filters('comment_feed_where', $cwhere);
+ $cgroupby = apply_filters('comment_feed_groupby', $cgroupby);
+ }
$this->comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby ORDER BY comment_date_gmt DESC LIMIT " . get_option('posts_per_rss'));
$this->comment_count = count($this->comments);
@@ -1414,28 +1423,33 @@ class WP_Query {
$where = "AND 0";
}
+ $orderby = $q['orderby'];
+
// Apply post-paging filters on where and join. Only plugins that
// manipulate paging queries should use these hooks.
-
- $where = apply_filters('posts_where_paged', $where);
- $groupby = apply_filters('posts_groupby', $groupby);
- $join = apply_filters('posts_join_paged', $join);
- $orderby = apply_filters('posts_orderby', $q['orderby']);
- $distinct = apply_filters('posts_distinct', $distinct);
- $fields = apply_filters('posts_fields', "$wpdb->posts.*");
- $limits = apply_filters( 'post_limits', $limits );
+ if ( !$q['suppress_filters'] ) {
+ $where = apply_filters('posts_where_paged', $where);
+ $groupby = apply_filters('posts_groupby', $groupby);
+ $join = apply_filters('posts_join_paged', $join);
+ $orderby = apply_filters('posts_orderby', $orderby);
+ $distinct = apply_filters('posts_distinct', $distinct);
+ $fields = apply_filters('posts_fields', $fields);
+ $limits = apply_filters( 'post_limits', $limits );
+ }
// Announce current selection parameters. For use by caching plugins.
do_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join );
// Filter again for the benefit of caching plugins. Regular plugins should use the hooks above.
- $where = apply_filters('posts_where_request', $where);
- $groupby = apply_filters('posts_groupby_request', $groupby);
- $join = apply_filters('posts_join_request', $join);
- $orderby = apply_filters('posts_orderby_request', $orderby);
- $distinct = apply_filters('posts_distinct_request', $distinct);
- $fields = apply_filters('posts_fields_request', $fields);
- $limits = apply_filters( 'post_limits_request', $limits );
+ if ( !$q['suppress_filters'] ) {
+ $where = apply_filters('posts_where_request', $where);
+ $groupby = apply_filters('posts_groupby_request', $groupby);
+ $join = apply_filters('posts_join_request', $join);
+ $orderby = apply_filters('posts_orderby_request', $orderby);
+ $distinct = apply_filters('posts_distinct_request', $distinct);
+ $fields = apply_filters('posts_fields_request', $fields);
+ $limits = apply_filters( 'post_limits_request', $limits );
+ }
if ( ! empty($groupby) )
$groupby = 'GROUP BY ' . $groupby;
@@ -1445,12 +1459,14 @@ class WP_Query {
if ( !empty($limits) )
$found_rows = 'SQL_CALC_FOUND_ROWS';
- $request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
- $this->request = apply_filters('posts_request', $request);
+ $this->request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
+ if ( !$q['suppress_filters'] )
+ $this->request = apply_filters('posts_request', $this->request);
$this->posts = $wpdb->get_results($this->request);
// Raw results filter. Prior to status checks.
- $this->posts = apply_filters('posts_results', $this->posts);
+ if ( !$q['suppress_filters'] )
+ $this->posts = apply_filters('posts_results', $this->posts);
if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) {
$cjoin = apply_filters('comment_feed_join', '');
@@ -1497,7 +1513,8 @@ class WP_Query {
}
}
- $this->posts = apply_filters('the_posts', $this->posts);
+ if ( !$q['suppress_filters'] )
+ $this->posts = apply_filters('the_posts', $this->posts);
update_post_caches($this->posts);
diff --git a/wp-includes/rss.php b/wp-includes/rss.php
index 561e3f9..7636a75 100644
--- a/wp-includes/rss.php
+++ b/wp-includes/rss.php
@@ -673,19 +673,15 @@ class RSSCache {
Output: true on sucess
\*=======================================================================*/
function set ($url, $rss) {
- global $wpdb, $wp_object_cache;
$cache_option = 'rss_' . $this->file_name( $url );
$cache_timestamp = 'rss_' . $this->file_name( $url ) . '_ts';
- if( $wp_object_cache->cache_enabled ) {
- wp_cache_set( $cache_option, $rss, 'rss' );
- wp_cache_set( $cache_timestamp, $cache_timestamp, 'rss' );
- } else {
- if( !get_site_option( $cache_option ) )
- add_site_option( $cache_option, $rss );
- if( !get_site_option( $cache_timestamp ) )
- add_site_option( $cache_timestamp, $cache_timestamp );
- }
+ add_site_option( $cache_option, $rss );
+ add_site_option( $cache_timestamp, time() );
+
+ if ( !wp_next_scheduled( 'wp_rss_gc' ) )
+ wp_schedule_event(time(), 'twicedaily', 'wp_rss_gc');
+
return $cache_option;
}
@@ -697,23 +693,14 @@ class RSSCache {
Output: cached object on HIT, false on MISS
\*=======================================================================*/
function get ($url) {
- global $wp_object_cache;
$this->ERROR = "";
$cache_option = 'rss_' . $this->file_name( $url );
- if( $wp_object_cache->cache_enabled ) {
- if( ! wp_cache_get( $cache_option, 'rss' ) ) {
- $this->debug( "Cache doesn't contain: $url (cache option: $cache_option)" );
- return 0;
- }
- return wp_cache_get( $cache_option, 'rss' );
- } else {
- if ( ! get_site_option( $cache_option ) ) {
- $this->debug( "Cache doesn't contain: $url (cache option: $cache_option)" );
- return 0;
- }
- return get_site_option( $cache_option );
+ if ( ! get_site_option( $cache_option ) ) {
+ $this->debug( "Cache doesn't contain: $url (cache option: $cache_option)" );
+ return 0;
}
+ return get_site_option( $cache_option );
}
/*=======================================================================*\
@@ -724,18 +711,11 @@ class RSSCache {
Output: cached object on HIT, false on MISS
\*=======================================================================*/
function check_cache ( $url ) {
- global $wp_object_cache;
$this->ERROR = "";
$cache_option = $this->file_name( $url );
$cache_timestamp = 'rss_' . $this->file_name( $url ) . '_ts';
- if( $wp_object_cache->cache_enabled ) {
- $mtime = wp_cache_get( $cache_timestamp, 'rss' );
- } else {
- $mtime = get_site_option($cache_timestamp);
- }
-
- if ( $mtime ) {
+ if ( $mtime = get_site_option($cache_timestamp) ) {
// find how long ago the file was added to the cache
// and whether that is longer then MAX_AGE
$age = time() - $mtime;
@@ -889,4 +869,19 @@ function get_rss ($url, $num_items = 5) { // Like get posts, but for RSS
}
endif;
+if ( !function_exists('rss_gc') ) :
+function rss_gc() {
+ global $wpdb;
+ // Garbage Collection
+ $rows = $wpdb->get_results( "SELECT meta_key FROM {$wpdb->sitemeta} WHERE meta_key LIKE 'rss\_%\_ts' AND meta_value < unix_timestamp( date_sub( NOW(), interval 7200 second ) )" );
+ if( is_array( $rows ) ) {
+ foreach( $rows as $row ) {
+ $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->sitemeta} WHERE meta_key = %s", $row->meta_key ) );
+ $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->sitemeta} WHERE meta_key = %s", str_replace( '_ts', '', $row->meta_key ) ) );
+ }
+ }
+}
+endif;
+add_action( 'wp_rss_gc', 'rss_gc' );
+
?>
diff --git a/wp-includes/update.php b/wp-includes/update.php
index beeee9f..437e938 100644
--- a/wp-includes/update.php
+++ b/wp-includes/update.php
@@ -22,27 +22,27 @@ function wp_version_check() {
if ( !function_exists('fsockopen') || defined('WP_INSTALLING') )
return;
- global $wp_version;
+ global $wp_version, $wpmu_version, $current_site;
$php_version = phpversion();
- $current = get_option( 'update_core' );
+ $current = get_site_option( 'update_core' );
$locale = get_locale();
if (
isset( $current->last_checked ) &&
43200 > ( time() - $current->last_checked ) &&
- $current->version_checked == $wp_version
+ $current->version_checked == $wpmu_version
)
return false;
$new_option = '';
$new_option->last_checked = time(); // this gets set whether we get a response or not, so if something is down or misconfigured it won't delay the page load for more than 3 seconds, twice a day
- $new_option->version_checked = $wp_version;
+ $new_option->version_checked = $wpmu_version;
- $http_request = "GET /core/version-check/1.1/?version=$wp_version&php=$php_version&locale=$locale HTTP/1.0\r\n";
+ $http_request = "GET /core/version-check/1.1/?version=$wp_version&wpmuversion=$wpmu_version&php=$php_version&locale=$locale&blogs=" . get_blog_count() . " HTTP/1.0\r\n";
$http_request .= "Host: api.wordpress.org\r\n";
$http_request .= 'Content-Type: application/x-www-form-urlencoded; charset=' . get_option('blog_charset') . "\r\n";
- $http_request .= 'User-Agent: WordPress/' . $wp_version . '; ' . get_bloginfo('url') . "\r\n";
+ $http_request .= 'User-Agent: WordPress MU/' . $wpmu_version . '; ' . apply_filters( 'currentsite_on_version_check', 'http://' . $current_site->domain . $current_site->path ) . "\r\n";
$http_request .= "\r\n";
$response = '';
@@ -63,11 +63,11 @@ function wp_version_check() {
$new_option->response = attribute_escape( $returns[0] );
if ( isset( $returns[1] ) )
- $new_option->url = clean_url( $returns[1] );
+ $new_option->url = 'http://mu.wordpress.org/';
if ( isset( $returns[2] ) )
$new_option->current = attribute_escape( $returns[2] );
}
- update_option( 'update_core', $new_option );
+ update_site_option( 'update_core', $new_option );
}
add_action( 'init', 'wp_version_check' );
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 38e145a..0325751 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -8,7 +8,7 @@
*
* @global string $wp_version
*/
-$wp_version = '2.6.1';
+$wp_version = '2.6.5';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
@@ -17,5 +17,5 @@ $wp_version = '2.6.1';
*/
$wp_db_version = 8204;
-$wpmu_version = '2.6.1';
+$wpmu_version = '2.6.5';
?>
diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php
index 2a71a02..73e1f6e 100644
--- a/wp-includes/widgets.php
+++ b/wp-includes/widgets.php
@@ -1162,8 +1162,12 @@ function wp_widget_rss_output( $rss, $args = array() ) {
$author = ' <cite>' . wp_specialchars( strip_tags( $item['author_name'] ) ) . '</cite>';
}
- echo "<li><a class='rsswidget' href='$link' title='$desc'>$title</a>{$date}{$summary}{$author}</li>";
- }
+ if ( $link == '' ) {
+ echo "<li>$title{$date}{$summary}{$author}</li>";
+ } else {
+ echo "<li><a class='rsswidget' href='$link' title='$desc'>$title</a>{$date}{$summary}{$author}</li>";
+ }
+}
echo '</ul>';
} else {
echo '<ul><li>' . __( 'An error has occurred; the feed is probably down. Try again later.' ) . '</li></ul>';
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php
index 6d5227d..9a3f6ec 100644
--- a/wp-includes/wpmu-functions.php
+++ b/wp-includes/wpmu-functions.php
@@ -16,7 +16,7 @@ function load_muplugin_textdomain($domain, $path = false) {
function wpmu_update_blogs_date() {
global $wpdb;
-
+
$wpdb->update( $wpdb->blogs, array('last_updated' => current_time('mysql')), array('blog_id' => $wpdb->blogid) );
refresh_blog_details( $wpdb->blogid );
@@ -83,9 +83,9 @@ function get_admin_users_for_domain( $sitedomain = '', $path = '' ) {
} else {
$site_id = $wpdb->get_var( $wpdb->prepare("SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $sitedomain, $path) );
}
-
+
if( $site_id != false ) {
- return $wpdb->get_results( $wpdb->prepare("SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = %d AND sm.site_id = %d", $wpdb->sitemeta.'.meta_value', $site_id), ARRAY_A );
+ return $wpdb->get_results( $wpdb->prepare("SELECT u.ID, u.user_login, u.user_pass FROM $wpdb->users AS u, $wpdb->sitemeta AS sm WHERE sm.meta_key = 'admin_user_id' AND u.ID = sm.meta_value AND sm.site_id = %d", $site_id), ARRAY_A );
}
return false;
}
@@ -132,7 +132,7 @@ function get_blog_details( $id, $getall = true ) {
return $details;
}
- $details = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->blogs WHERE blog_id = %d", $id) ); // get_blog_details ?
+ $details = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->blogs WHERE blog_id = %d /* get_blog_details */", $id) );
if ( !$details ) {
wp_cache_set( $id . $all, -1, 'blog-details' );
return false;
@@ -415,8 +415,7 @@ function get_blogs_of_user( $id, $all = false ) {
$blogs = $match = array();
foreach ( (array) $user as $key => $value ) {
- if ( strstr( $key, '_capabilities') && strstr( $key, $wpdb->base_prefix) ) {
- preg_match('/' . $wpdb->base_prefix . '(\d+)_capabilities/', $key, $match);
+ if ( false !== strpos( $key, '_capabilities') && 0 === strpos( $key, $wpdb->base_prefix ) && preg_match( '/' . $wpdb->base_prefix . '(\d+)_capabilities/', $key, $match ) ) {
$blog = get_blog_details( $match[1] );
if ( $blog && isset( $blog->domain ) && ( $all == true || $all == false && ( $blog->archived == 0 && $blog->spam == 0 && $blog->deleted == 0 ) ) ) {
$blogs[$match[1]]->userblog_id = $match[1];
@@ -445,6 +444,8 @@ function get_active_blog_for_user( $user_id ) { // get an active blog for user -
$ret = false;
if( is_array( $blogs ) && count( $blogs ) > 0 ) {
foreach( (array) $blogs as $blog_id => $blog ) {
+ if ( $blog->site_id != $wpdb->siteid )
+ continue;
$details = get_blog_details( $blog_id );
if( is_object( $details ) && $details->archived == 0 && $details->spam == 0 && $details->deleted == 0 ) {
$ret = $blog;
@@ -460,7 +461,7 @@ function get_active_blog_for_user( $user_id ) { // get an active blog for user -
}
}
-function is_user_member_of_blog( $user_id, $blog_id = 0 ) {
+function is_user_member_of_blog( $user_id, $blog_id = 0 ) {
$user_id = (int) $user_id;
$blog_id = (int) $blog_id;
@@ -649,7 +650,8 @@ function add_user_to_blog( $blog_id, $user_id, $role ) {
return true;
}
-function remove_user_from_blog($user_id, $blog_id = '') {
+function remove_user_from_blog($user_id, $blog_id = '', $reassign = '') {
+ global $wpdb;
switch_to_blog($blog_id);
$user_id = (int) $user_id;
do_action('remove_user_from_blog', $user_id, $blog_id);
@@ -681,6 +683,12 @@ function remove_user_from_blog($user_id, $blog_id = '') {
update_usermeta($user_id, 'source_domain', '');
}
+ if( $reassign != '' ) {
+ $reassign = (int) $reassign;
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE post_author = %d", $reassign, $user_id) );
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_owner = %d WHERE link_owner = %d", $reassign, $user_id) );
+ }
+
restore_current_blog();
}
@@ -721,6 +729,30 @@ function get_blog_permalink( $blog_id, $post_id ) {
return $link;
}
+function get_blog_id_from_url( $domain, $path = '/' ) {
+ global $wpdb;
+
+ $domain = strtolower( $wpdb->escape( $domain ) );
+ $path = strtolower( $wpdb->escape( $path ) );
+ $id = wp_cache_get( md5( $domain . $path ), 'blog-id-cache' );
+
+ if( $id == -1 ) { // blog does not exist
+ return 0;
+ } elseif( $id ) {
+ return (int)$id;
+ }
+
+ $id = $wpdb->get_var( "SELECT blog_id FROM $wpdb->blogs WHERE domain = '$domain' and path = '$path' /* get_blog_id_from_url */" );
+
+ if ( !$id ) {
+ wp_cache_set( md5( $domain . $path ), -1, 'blog-id-cache' );
+ return false;
+ }
+ wp_cache_set( md5( $domain . $path ), $id, 'blog-id-cache' );
+
+ return $id;
+}
+
// wpmu admin functions
function wpmu_admin_do_redirect( $url = '' ) {
@@ -729,7 +761,7 @@ function wpmu_admin_do_redirect( $url = '' ) {
$ref = $_GET['ref'];
if ( isset( $_POST['ref'] ) )
$ref = $_POST['ref'];
-
+
if( $ref ) {
$ref = wpmu_admin_redirect_add_updated_param( $ref );
wp_redirect( $ref );
@@ -814,7 +846,7 @@ function is_email_address_unsafe( $user_email ) {
strstr( $banned_domain, '/' ) &&
preg_match( $banned_domain, $email_domain )
)
- )
+ )
return true;
}
}
@@ -1082,9 +1114,9 @@ function wpmu_signup_user_notification($user, $user_email, $key, $meta = '') {
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
$from_name = get_site_option( "site_name" ) == '' ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) );
$message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
- $message = sprintf(__("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"), clean_url("http://{$current_site->domain}{$current_site->path}wp-activate.php?key=$key") );
+ $message = sprintf(__( apply_filters( 'wpmu_signup_user_notification_email', "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" ) ), clean_url("http://{$current_site->domain}{$current_site->path}wp-activate.php?key=$key") );
// TODO: Don't hard code activation link.
- $subject = sprintf(__('Activate %s'), $user);
+ $subject = sprintf(__( apply_filters( 'wpmu_signup_user_notification_subject', 'Activate %s' )), $user);
wp_mail($user_email, $subject, $message, $message_headers);
return true;
}
@@ -1168,7 +1200,7 @@ function wpmu_create_user( $user_name, $password, $email) {
return false;
$user_id = wp_create_user( $user_name, $password, $email );
- $user = new WP_User($user_id);
+ $user = new WP_User($user_id);
// Newly created users have no roles or caps until they are added to a blog.
update_usermeta($user_id, 'capabilities', '');
@@ -1295,13 +1327,13 @@ function insert_blog($domain, $path, $site_id) {
// Install an empty blog. wpdb should already be switched.
function install_blog($blog_id, $blog_title = '') {
global $wpdb, $table_prefix, $wp_roles;
-
+ $wpdb->suppress_errors();
+
// Cast for security
$blog_id = (int) $blog_id;
require_once( ABSPATH . 'wp-admin/includes/upgrade.php');
-
- $wpdb->suppress_errors();
+
if ( $wpdb->get_results("SELECT ID FROM $wpdb->posts") )
die(__('<h1>Already Installed</h1><p>You appear to have already installed WordPress. To reinstall please clear your old database tables first.</p>') . '</body></html>');
$wpdb->suppress_errors( false);
@@ -1313,7 +1345,7 @@ function install_blog($blog_id, $blog_title = '') {
populate_options();
populate_roles();
$wp_roles->_init();
-
+
// fix url.
update_option('siteurl', $url);
update_option('home', $url);
@@ -1344,8 +1376,6 @@ function install_blog($blog_id, $blog_title = '') {
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE meta_key = %s", $table_prefix.'user_level') );
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE meta_key = %s", $table_prefix.'capabilities') );
- wp_cache_delete('notoptions', 'options');
- wp_cache_delete('alloptions', 'options');
$wpdb->suppress_errors( false );
}
@@ -1480,7 +1510,7 @@ SITE_NAME" ) );
$message = $welcome_email;
if( empty( $current_site->site_name ) )
$current_site->site_name = "WordPress MU";
- $subject = sprintf(__('New %1$s Blog: %2$s'), $current_site->site_name, $title);
+ $subject = sprintf(__('New %1$s Blog: %2$s'), $current_site->site_name, stripslashes( $title ) );
wp_mail($user->user_email, $subject, $message, $message_headers);
return true;
}
@@ -1787,7 +1817,7 @@ function global_terms( $term_id, $deprecated = '' ) {
if( get_option( 'default_category' ) == $term_id )
update_option( 'default_category', $global_id );
-
+
$wpdb->update( $wpdb->terms, array('term_id' => $global_id), array('term_id' => $term_id) );
$wpdb->update( $wpdb->term_taxonomy, array('term_id' => $global_id), array('term_id' => $term_id) );
$wpdb->update( $wpdb->term_taxonomy, array('parent' => $global_id), array('parent' => $term_id) );
@@ -1890,9 +1920,9 @@ XMLRPC getUsersBlogs() for a multiblog environment
http://trac.mu.wordpress.org/attachment/ticket/551/xmlrpc-mu.php
*/
function wpmu_blogger_getUsersBlogs($args) {
- $site_details = get_blog_details( 1, true );
- $domain = $site_details->domain;
- $path = $site_details->path . 'xmlrpc.php';
+ global $current_blog;
+ $domain = $current_blog->domain;
+ $path = $current_blog->path . 'xmlrpc.php';
$rpc = new IXR_Client("http://{$domain}{$path}");
$rpc->query('wp.getUsersBlogs', $args[1], $args[2]);
@@ -1994,4 +2024,13 @@ function add_existing_user_to_blog() {
}
}
}
+
+function add_new_user_to_blog( $user_id, $email, $meta ) {
+ if( $meta[ 'add_to_blog' ] ) {
+ $blog_id = $meta[ 'add_to_blog' ];
+ $role = $meta[ 'new_role' ];
+ add_user_to_blog( $blog_id, $user_id, $role );
+ }
+}
+add_action( 'wpmu_activate_user', $user_id, $email, $meta );
?>
diff --git a/wp-login.php b/wp-login.php
index 8116267..c958599 100644
--- a/wp-login.php
+++ b/wp-login.php
@@ -420,6 +420,8 @@ default:
$user = wp_signon('', $secure_cookie);
+ $redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);
+
if ( !is_wp_error($user) ) {
// If the user can't edit posts, send them to their profile.
if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' ) )
diff --git a/wp-settings.php b/wp-settings.php
index cb9138c..0d25991 100644
--- a/wp-settings.php
+++ b/wp-settings.php
@@ -95,13 +95,9 @@ if ( isset($_SERVER['SCRIPT_FILENAME']) && ( strpos($_SERVER['SCRIPT_FILENAME'],
if (strpos($_SERVER['SCRIPT_NAME'], 'php.cgi') !== false)
unset($_SERVER['PATH_INFO']);
-// Fix empty PHP_SELF
-$PHP_SELF = $_SERVER['PHP_SELF'];
-if ( empty($PHP_SELF) || constant( 'VHOST' ) == 'no' )
- $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]);
if ( version_compare( '4.3', phpversion(), '>' ) ) {
- die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %s but WordPress requires at least 4.3.'/*/WP_I18N_OLD_PHP*/, php_version() ) );
+ die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %s but WordPress requires at least 4.3.'/*/WP_I18N_OLD_PHP*/, phpversion() ) );
}
if ( !defined('WP_CONTENT_DIR') )
@@ -238,7 +234,16 @@ $wpdb->siteid = $current_blog->site_id;
$wpdb->set_prefix($table_prefix); // set up blog tables
$table_prefix = $table_prefix . $blog_id . '_';
+// Fix empty PHP_SELF
+$PHP_SELF = $_SERVER['PHP_SELF'];
+if ( empty($PHP_SELF) || ( constant( 'VHOST' ) == 'no' && $current_blog->path != '/' ) )
+ $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]);
+
wp_cache_init(); // need to init cache again after blog_id is set
+if ( function_exists('wp_cache_add_global_groups') ) { // need to add these again. Yes, it's an ugly hack
+ wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss'));
+ wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' ));
+}
if( !defined( "UPLOADS" ) )
define( "UPLOADS", "wp-content/blogs.dir/{$wpdb->blogid}/files/" );
@@ -290,7 +295,7 @@ if ( !defined('WP_CONTENT_URL') )
define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
require_once( ABSPATH . WPINC . '/wpmu-functions.php' );
-require (ABSPATH . WPINC . '/wpmu-default-filters.php'); // WPmu Filters
+require( ABSPATH . WPINC . '/wpmu-default-filters.php' ); // WPmu Filters
/**
* Allows for the plugins directory to be moved from the default location.
diff --git a/wp-signup.php b/wp-signup.php
index 602fa61..28e7d6b 100644
--- a/wp-signup.php
+++ b/wp-signup.php
@@ -14,7 +14,10 @@ if( is_array( get_site_option( 'illegal_names' )) && $_GET[ 'new' ] != '' && in_
die();
}
-do_action("signup_header");
+function do_signup_header() {
+ do_action("signup_header");
+}
+add_action( 'wp_head', 'do_signup_header' );
function signuppageheaders() {
echo "<meta name='robots' content='noindex,nofollow' />\n";
@@ -356,7 +359,7 @@ function confirm_blog_signup($domain, $path, $blog_title, $user_name = '', $user
<p>
<?php _e("If you haven't received your email yet, there are a number of things you can do:") ?>
<ul>
- <li><p><strong><?php _e('Wait a little longer. Sometimes delivery of email can be delayed by precesses outside of our control.') ?></strong></p></li>
+ <li><p><strong><?php _e('Wait a little longer. Sometimes delivery of email can be delayed by processes outside of our control.') ?></strong></p></li>
<li><p><?php _e('Check the junk email or spam folder of your email client. Sometime emails wind up there by mistake.') ?></p></li>
<li><?php printf(__("Have you entered your email correctly? We think it's %s but if you've entered it incorrectly, you won't receive it."), $user_email) ?></li>
</ul>
@@ -380,10 +383,15 @@ $newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-
$current_user = wp_get_current_user();
if( $active_signup == "none" ) {
_e( "Registration has been disabled." );
+} elseif( $active_signup == 'blog' && !is_user_logged_in() ){
+ if( is_ssl() ) {
+ $proto = 'https://';
+ } else {
+ $proto = 'http://';
+ }
+ $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode($proto . $_SERVER['HTTP_HOST'] . '/wp-signup.php' ));
+ echo sprintf( __( "You must first <a href=\"%s\">login</a>, and then you can create a new blog."), $login_url );
} else {
- if( $active_signup == 'blog' && !is_user_logged_in() )
- wp_die( 'You must be logged in to register a blog.' );
-
switch ($_POST['stage']) {
case 'validate-user-signup' :
if( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' )
diff --git a/wpmu-settings.php b/wpmu-settings.php
index 08790fd..ff08b18 100644
--- a/wpmu-settings.php
+++ b/wpmu-settings.php
@@ -5,7 +5,7 @@ if( $current_site && $current_blog )
// depreciated
$wpmuBaseTablePrefix = $table_prefix;
-$domain = addslashes( $_SERVER['HTTP_HOST'] );
+$domain = strtolower( addslashes( $_SERVER['HTTP_HOST'] ) );
if( substr( $domain, 0, 4 ) == 'www.' )
$domain = substr( $domain, 4 );
if( strpos( $domain, ':' ) ) {
@@ -26,6 +26,7 @@ if( substr( $domain, -1 ) == '.' )
$path = preg_replace( '|([a-z0-9-]+.php.*)|', '', $_SERVER['REQUEST_URI'] );
$path = str_replace ( '/wp-admin/', '/', $path );
$path = preg_replace( '|(/[a-z0-9-]+?/).*|', '$1', $path );
+$path = strtolower( $path );
function wpmu_current_site() {
global $wpdb, $current_site, $domain, $path, $sites;
diff --git a/xmlrpc.php b/xmlrpc.php
index e52e454..ed191b5 100644
--- a/xmlrpc.php
+++ b/xmlrpc.php
@@ -343,10 +343,6 @@ class wp_xmlrpc_server extends IXR_Server {
$struct = array( );
foreach( $blogs as $blog ) {
- // Don't include blogs that aren't hosted at this site
- if( $blog->site_id != 1 )
- continue;
-
$blog_id = $blog->userblog_id;
switch_to_blog($blog_id);
$is_admin = current_user_can('level_8');
@@ -358,6 +354,7 @@ class wp_xmlrpc_server extends IXR_Server {
'blogName' => get_option( 'blogname' ),
'xmlrpc' => get_option( 'home' ) . '/xmlrpc.php'
);
+ restore_current_blog();
}
return $struct;
@@ -1343,7 +1340,7 @@ class wp_xmlrpc_server extends IXR_Server {
$actual_post = wp_get_single_post($post_ID,ARRAY_A);
- if (!$actual_post) {
+ if (!$actual_post || $actual_post['post_type'] != 'post') {
return new IXR_Error(404, __('Sorry, no such post.'));
}
@@ -2366,7 +2363,7 @@ class wp_xmlrpc_server extends IXR_Server {
$actual_post = wp_get_single_post($post_ID, ARRAY_A);
- if (!$actual_post) {
+ if (!$actual_post || $actual_post['post_type'] != 'post') {
return new IXR_Error(404, __('Sorry, no such post.'));
}