summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-07-05 11:55:16 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-07-05 11:55:16 +0000
commitc1e9ee019dcce4d8c2e5bc7d6feac95afa812598 (patch)
treecf1ce2babb677da1e8ed5980a2b93f50c007db6d
parent4f1ae2b3efc96635b7f4f8d40720f96117927204 (diff)
downloadwordpress-mu-c1e9ee019dcce4d8c2e5bc7d6feac95afa812598.tar.gz
wordpress-mu-c1e9ee019dcce4d8c2e5bc7d6feac95afa812598.tar.xz
wordpress-mu-c1e9ee019dcce4d8c2e5bc7d6feac95afa812598.zip
WP Merge.
Delete feed code and sql git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@636 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--wp-admin/admin-functions.php22
-rw-r--r--wp-admin/admin.php16
-rw-r--r--wp-admin/categories.php16
-rw-r--r--wp-admin/comment.php18
-rw-r--r--wp-admin/index.php2
-rw-r--r--wp-admin/inline-uploading.php17
-rw-r--r--wp-admin/link-add.php18
-rw-r--r--wp-admin/link-manager.php24
-rw-r--r--wp-admin/link.php17
-rw-r--r--wp-admin/menu.php16
-rw-r--r--wp-admin/moderation.php16
-rw-r--r--wp-admin/options-head.php19
-rw-r--r--wp-admin/options.php16
-rw-r--r--wp-admin/page.php18
-rw-r--r--wp-admin/plugin-editor.php20
-rw-r--r--wp-admin/post.php18
-rw-r--r--wp-admin/templates.php18
-rw-r--r--wp-admin/theme-editor.php20
-rw-r--r--wp-admin/upgrade-schema.php11
-rw-r--r--wp-admin/user-edit.php17
-rw-r--r--wp-admin/wp-admin.css5
-rw-r--r--wp-includes/default-filters.php1
-rw-r--r--wp-includes/formatting.php9
-rw-r--r--wp-includes/functions.php4
-rw-r--r--wp-includes/post.php2
-rw-r--r--wp-includes/query.php12
-rw-r--r--wp-login.php2
27 files changed, 89 insertions, 285 deletions
diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php
index 92ac4cb..49fe06e 100644
--- a/wp-admin/admin-functions.php
+++ b/wp-admin/admin-functions.php
@@ -413,7 +413,7 @@ function edit_user($user_id = 0) {
$pass2 = $_POST['pass2'];
if (isset ($_POST['role']) && current_user_can('edit_users')) {
- if ($user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap('edit_users'))
+ if($user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap('edit_users'))
$user->role = $_POST['role'];
}
@@ -712,7 +712,7 @@ function page_rows($parent = 0, $level = 0, $pages = 0, $hierarchy = true) {
<th scope="row"><?php echo $post->ID; ?></th>
<td>
<?php echo $pad; ?><?php the_title() ?>
- <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?></td>
+ <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?>
</td>
<td><?php the_author() ?></td>
<td><?php echo mysql2date('Y-m-d g:i a', $post->post_modified); ?></td>
@@ -1966,6 +1966,24 @@ function get_udims($width, $height) {
return array((int) ($width / $height * 96), 96);
}
+function wp_reset_vars($vars) {
+ for ($i=0; $i<count($vars); $i += 1) {
+ $var = $vars[$i];
+ global $$var;
+
+ if (!isset($$var)) {
+ if (empty($_POST["$var"])) {
+ if (empty($_GET["$var"]))
+ $$var = '';
+ else
+ $$var = $_GET["$var"];
+ } else {
+ $$var = $_POST["$var"];
+ }
+ }
+ }
+}
+
function autocomplete_css() {
?>
<style type='text/css'>
diff --git a/wp-admin/admin.php b/wp-admin/admin.php
index ffec08f..d1b98fb 100644
--- a/wp-admin/admin.php
+++ b/wp-admin/admin.php
@@ -33,21 +33,7 @@ $what_to_show = get_settings('what_to_show');
$date_format = get_settings('date_format');
$time_format = get_settings('time_format');
-$wpvarstoreset = array('profile','redirect','redirect_url','a','popuptitle','popupurl','text', 'trackback', 'pingback');
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset($$wpvar)) {
- if (empty($_POST["$wpvar"])) {
- if (empty($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback'));
wp_enqueue_script( 'fat' );
diff --git a/wp-admin/categories.php b/wp-admin/categories.php
index 7c66c6d..4edcda5 100644
--- a/wp-admin/categories.php
+++ b/wp-admin/categories.php
@@ -4,21 +4,7 @@ require_once('admin.php');
$title = __('Categories');
$parent_file = 'edit.php';
-$wpvarstoreset = array('action','cat');
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset($$wpvar)) {
- if (empty($_POST["$wpvar"])) {
- if (empty($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+wp_reset_vars(array('action', 'cat'));
switch($action) {
diff --git a/wp-admin/comment.php b/wp-admin/comment.php
index 52ec008..bc6f510 100644
--- a/wp-admin/comment.php
+++ b/wp-admin/comment.php
@@ -3,22 +3,8 @@ require_once('admin.php');
$parent_file = 'edit.php';
$submenu_file = 'edit-comments.php';
-$wpvarstoreset = array('action');
-
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset($$wpvar)) {
- if (empty($_POST["$wpvar"])) {
- if (empty($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+
+wp_reset_vars(array('action'));
if ( isset( $_POST['deletecomment'] ) )
$action = 'deletecomment';
diff --git a/wp-admin/index.php b/wp-admin/index.php
index ba05ee3..c07e2f2 100644
--- a/wp-admin/index.php
+++ b/wp-admin/index.php
@@ -55,7 +55,6 @@ foreach ($comments as $comment) {
}
?>
</ul>
-
</div>
<?php endif; ?>
@@ -112,6 +111,7 @@ if (0 < $numcats) $numcats = number_format($numcats);
<?php do_action('activity_box_end'); ?>
</div>
+
<h3><?php _e('Welcome to WordPress MU'); ?></h3>
<p><?php _e('Use these links to get started:'); ?></p>
diff --git a/wp-admin/inline-uploading.php b/wp-admin/inline-uploading.php
index ca9f945..c5c969d 100644
--- a/wp-admin/inline-uploading.php
+++ b/wp-admin/inline-uploading.php
@@ -7,22 +7,7 @@ header('Content-Type: text/html; charset=' . get_option('blog_charset'));
if (!current_user_can('upload_files'))
die(__('You do not have permission to upload files.'));
-$wpvarstoreset = array('action', 'post', 'all', 'last', 'link', 'sort', 'start', 'imgtitle', 'descr', 'attachment');
-
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset($$wpvar)) {
- if (empty($_POST["$wpvar"])) {
- if (empty($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+wp_reset_vars(array('action', 'post', 'all', 'last', 'link', 'sort', 'start', 'imgtitle', 'descr', 'attachment'));
$post = (int) $post;
$images_width = 1;
diff --git a/wp-admin/link-add.php b/wp-admin/link-add.php
index 71ce294..4d451fb 100644
--- a/wp-admin/link-add.php
+++ b/wp-admin/link-add.php
@@ -6,24 +6,10 @@ $this_file = 'link-manager.php';
$parent_file = 'link-manager.php';
-$wpvarstoreset = array('action', 'cat_id', 'linkurl', 'name', 'image',
+wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image',
'description', 'visible', 'target', 'category', 'link_id',
'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel',
- 'notes', 'linkcheck[]');
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset($$wpvar)) {
- if (empty($_POST["$wpvar"])) {
- if (empty($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+ 'notes', 'linkcheck[]'));
wp_enqueue_script( array('xfn', 'dbx-admin-key?pagenow=link.php') );
if ( current_user_can( 'manage_categories' ) )
diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php
index e2edd38..c5e2049 100644
--- a/wp-admin/link-manager.php
+++ b/wp-admin/link-manager.php
@@ -10,22 +10,7 @@ $title = __('Manage Bookmarks');
$this_file = $parent_file = 'link-manager.php';
wp_enqueue_script( 'listman' );
-$wpvarstoreset = array ('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]');
-
-for ($i = 0; $i < count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset ($$wpvar)) {
- if (empty ($_POST["$wpvar"])) {
- if (empty ($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]'));
if (empty ($cat_id))
$cat_id = 'all';
@@ -106,7 +91,7 @@ bookmarks ordered by
<option value="order_name" <?php if ($order_by == 'order_name') echo " selected='selected'";?>><?php _e('Name') ?></option>
<option value="order_url" <?php if ($order_by == 'order_url') echo " selected='selected'";?>><?php _e('URI') ?></option>
</select>
-<input type="submit" name="action" value="<?php _e('Update &raquo;') ?>" />
+<input type="submit" name="action" value="<?php _e('Update &raquo;') ?>" /></p>
</form>
<form id="links" method="post" action="link.php">
@@ -176,7 +161,7 @@ if ($links)
<?php
echo '<td><a href="link.php?link_id='.$link->link_id.'&amp;action=edit" class="edit">'.__('Edit').'</a></td>';
- echo '<td><a href="' . wp_nonce_url('link.php?link_id='.$link->link_id.'&amp;action=delete', 'delete-bookmark_' . $link->link_id ) . '"'." class='delete' onclick=\"return deleteSomething( 'link', $link->link_id , '".sprintf(__("You are about to delete the &quot;%s&quot; bookmark to %s.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape($link->link_name), js_escape($link->link_url)).'\' );" class="delete">'.__('Delete').'</a></td>';
+ echo '<td><a href="' . wp_nonce_url('link.php?link_id='.$link->link_id.'&amp;action=delete', 'delete-bookmark_' . $link->link_id ) . '"'." onclick=\"return deleteSomething( 'link', $link->link_id , '".sprintf(__("You are about to delete the &quot;%s&quot; bookmark to %s.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), js_escape($link->link_name), js_escape($link->link_url)).'\' );" class="delete">'.__('Delete').'</a></td>';
echo '<td align="center"><input type="checkbox" name="linkcheck[]" value="'.$link->link_id.'" /></td>';
echo "\n </tr>\n";
}
@@ -187,9 +172,8 @@ if ($links)
<div id="ajax-response"></div>
<p class="submit"><input type="submit" class="button" name="deletebookmarks" id="deletebookmarks" value="<?php _e('Delete Checked Bookmarks') ?> &raquo;" onclick="return confirm('<?php _e("You are about to delete these bookmarks permanently \\n \'Cancel\' to stop, \'OK\' to delete.") ?>')" /></p>
-</div>
</form>
-
+</div>
<?php
if( wp_cache_get( "checked_bookmarks_table", "options" ) == false ) {
$results = $wpdb->get_results( "SELECT link_id, category_id, count( * ) AS c FROM {$wpdb->link2cat} GROUP BY link_id, category_id" );
diff --git a/wp-admin/link.php b/wp-admin/link.php
index 967a02c..a62c01c 100644
--- a/wp-admin/link.php
+++ b/wp-admin/link.php
@@ -1,22 +1,7 @@
<?php
require_once ('admin.php');
-$wpvarstoreset = array ('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]');
-
-for ($i = 0; $i < count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset ($$wpvar)) {
- if (empty ($_POST["$wpvar"])) {
- if (empty ($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]'));
if ('' != $_POST['deletebookmarks'])
$action = 'deletebookmarks';
diff --git a/wp-admin/menu.php b/wp-admin/menu.php
index 1859608..809d2e1 100644
--- a/wp-admin/menu.php
+++ b/wp-admin/menu.php
@@ -4,14 +4,22 @@
// Menu item name
// The minimum level the user needs to access the item: between 0 and 10
// The URL of the item's file
+$menu[0] = array(__('Dashboard'), 'read', 'index.php');
+
+if ( strstr($_SERVER['REQUEST_URI'], 'edit-pages.php') )
+ $menu[5] = array(__('Write'), 'edit_pages', 'page-new.php');
+else
+ $menu[5] = array(__('Write'), 'edit_posts', 'post-new.php');
+if ( strstr($_SERVER['REQUEST_URI'], 'page-new.php') )
+ $menu[10] = array(__('Manage'), 'edit_pages', 'edit-pages.php');
+else
+ $menu[10] = array(__('Manage'), 'edit_posts', 'edit.php');
+
$menu_perms = get_site_option( "menu_items" );
if( is_array( $menu_perms ) == false )
$menu_perms = array();
-$menu[0] = array(__('Dashboard'), 'read', 'index.php');
-$menu[5] = array(__('Write'), 'edit_posts', 'post-new.php');
-$menu[10] = array(__('Manage'), 'edit_posts', 'edit.php');
$menu[20] = array(__('Bookmarks'), 'manage_links', 'link-manager.php');
$menu[25] = array(__('Presentation'), 'switch_themes', 'themes.php');
if( $menu_perms[ 'plugins' ] == 1 )
@@ -22,6 +30,7 @@ else
$menu[35] = array(__('Profile'), 'read', 'profile.php');
$menu[40] = array(__('Options'), 'manage_options', 'options-general.php');
+
$submenu['post-new.php'][5] = array(__('Write Post'), 'edit_posts', 'post-new.php');
$submenu['post-new.php'][10] = array(__('Write Page'), 'edit_pages', 'page-new.php');
@@ -117,7 +126,6 @@ if( is_site_admin() ) {
$menu[1] = array(__('Site Admin'), '10', 'wpmu-admin.php' );
$submenu[ 'wpmu-admin.php' ][5] = array( 'Blogs', '10', 'wpmu-blogs.php' );
$submenu[ 'wpmu-admin.php' ][10] = array( 'Users', '10', 'wpmu-users.php' );
- $submenu[ 'wpmu-admin.php' ][15] = array( 'Feeds', '10', 'wpmu-feeds.php' );
$submenu[ 'wpmu-admin.php' ][20] = array( 'Themes', '10', 'wpmu-themes.php' );
$submenu[ 'wpmu-admin.php' ][25] = array( 'Options', '10', 'wpmu-options.php' );
$submenu[ 'wpmu-admin.php' ][30] = array( 'Upgrade', '10', 'wpmu-upgrade-site.php' );
diff --git a/wp-admin/moderation.php b/wp-admin/moderation.php
index 530a99e..7b411cc 100644
--- a/wp-admin/moderation.php
+++ b/wp-admin/moderation.php
@@ -5,21 +5,7 @@ $title = __('Moderate comments');
$parent_file = 'edit.php';
wp_enqueue_script( 'admin-comments' );
-$wpvarstoreset = array('action', 'item_ignored', 'item_deleted', 'item_approved', 'item_spam', 'feelinglucky');
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset($$wpvar)) {
- if (empty($_POST["$wpvar"])) {
- if (empty($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+wp_reset_vars(array('action', 'item_ignored', 'item_deleted', 'item_approved', 'item_spam', 'feelinglucky'));
$comment = array();
if (isset($_POST["comment"])) {
diff --git a/wp-admin/options-head.php b/wp-admin/options-head.php
index 54f426c..8d097f4 100644
--- a/wp-admin/options-head.php
+++ b/wp-admin/options-head.php
@@ -1,21 +1,4 @@
-<?php
-
-$wpvarstoreset = array('action','standalone', 'option_group_id');
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset($$wpvar)) {
- if (empty($_POST["$wpvar"])) {
- if (empty($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
-?>
+<?php wp_reset_vars(array('action', 'standalone', 'option_group_id')); ?>
<br clear="all" />
diff --git a/wp-admin/options.php b/wp-admin/options.php
index 020f0e1..78d49fe 100644
--- a/wp-admin/options.php
+++ b/wp-admin/options.php
@@ -5,21 +5,7 @@ $title = __('Options');
$this_file = 'options.php';
$parent_file = 'options-general.php';
-$wpvarstoreset = array('action');
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset($$wpvar)) {
- if (empty($_POST["$wpvar"])) {
- if (empty($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+wp_reset_vars(array('action'));
if ( !current_user_can('manage_options') )
die ( __('Cheatin&#8217; uh?') );
diff --git a/wp-admin/page.php b/wp-admin/page.php
index 16e2d9d..19c6efe 100644
--- a/wp-admin/page.php
+++ b/wp-admin/page.php
@@ -5,23 +5,7 @@ $parent_file = 'edit.php';
$submenu_file = 'edit-pages.php';
$wp_rewrite->flush_rules();
-
-$wpvarstoreset = array('action');
-
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset($$wpvar)) {
- if (empty($_POST["$wpvar"])) {
- if (empty($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+wp_reset_vars(array('action'));
if (isset($_POST['deletepost'])) {
$action = "delete";
diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php
index 4c3c600..3085261 100644
--- a/wp-admin/plugin-editor.php
+++ b/wp-admin/plugin-editor.php
@@ -5,21 +5,7 @@ require_once('admin.php');
$title = __("Edit Plugins");
$parent_file = 'plugins.php';
-$wpvarstoreset = array('action','redirect','profile','error','warning','a','file');
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset($$wpvar)) {
- if (empty($_POST["$wpvar"])) {
- if (empty($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file'));
$plugins = get_plugins();
$plugin_files = array_keys($plugins);
@@ -38,7 +24,7 @@ case 'update':
check_admin_referer('edit-plugin_' . $file);
if ( !current_user_can('edit_plugins') )
- die('<p>'.__('You have do not have sufficient permissions to edit templates for this blog.').'</p>');
+ die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>');
$newcontent = stripslashes($_POST['newcontent']);
if (is_writeable($real_file)) {
@@ -58,7 +44,7 @@ default:
require_once('admin-header.php');
if ( !current_user_can('edit_plugins') )
- die('<p>'.__('You have do not have sufficient permissions to edit plugins for this blog.').'</p>');
+ die('<p>'.__('You do not have sufficient permissions to edit plugins for this blog.').'</p>');
update_recently_edited("wp-content/plugins/$file");
diff --git a/wp-admin/post.php b/wp-admin/post.php
index 7f3c2ab..d1a0ff7 100644
--- a/wp-admin/post.php
+++ b/wp-admin/post.php
@@ -3,22 +3,8 @@ require_once('admin.php');
$parent_file = 'edit.php';
$submenu_file = 'edit.php';
-$wpvarstoreset = array('action', 'safe_mode', 'withcomments', 'posts', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder' );
-
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset($$wpvar)) {
- if (empty($_POST["$wpvar"])) {
- if (empty($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+
+wp_reset_vars(array('action', 'safe_mode', 'withcomments', 'posts', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder'));
if ( isset( $_POST['deletepost'] ) )
$action = 'delete';
diff --git a/wp-admin/templates.php b/wp-admin/templates.php
index ab5f1c1..1aaabbe 100644
--- a/wp-admin/templates.php
+++ b/wp-admin/templates.php
@@ -4,21 +4,7 @@ require_once('admin.php');
$title = __('Template &amp; File Editing');
$parent_file = 'edit.php';
-$wpvarstoreset = array('action','redirect','profile','error','warning','a','file');
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset($$wpvar)) {
- if (empty($_POST["$wpvar"])) {
- if (empty($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file'));
$recents = get_option('recently_edited');
@@ -65,7 +51,7 @@ default:
require_once('./admin-header.php');
if ( ! current_user_can('edit_files') )
- die('<p>'.__('You have do not have sufficient permissions to edit templates for this blog.').'</p>');
+ die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>');
if ( strstr( $file, 'wp-config.php' ) )
die('<p>'.__('The config file cannot be edited or viewed through the web interface. Sorry!').'</p>');
diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php
index 3213cc4..43ee21f 100644
--- a/wp-admin/theme-editor.php
+++ b/wp-admin/theme-editor.php
@@ -5,21 +5,7 @@ require_once('admin.php');
$title = __("Edit Themes");
$parent_file = 'themes.php';
-$wpvarstoreset = array('action','redirect','profile','error','warning','a','file', 'theme');
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset($$wpvar)) {
- if (empty($_POST["$wpvar"])) {
- if (empty($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'theme'));
$themes = get_themes();
@@ -51,7 +37,7 @@ case 'update':
check_admin_referer('edit-theme_' . $file . $theme);
if ( !current_user_can('edit_themes') )
- die('<p>'.__('You have do not have sufficient permissions to edit templates for this blog.').'</p>');
+ die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>');
$newcontent = stripslashes($_POST['newcontent']);
$theme = urlencode($theme);
@@ -72,7 +58,7 @@ default:
require_once('admin-header.php');
if ( !current_user_can('edit_themes') )
- die('<p>'.__('You have do not have sufficient permissions to edit themes for this blog.').'</p>');
+ die('<p>'.__('You do not have sufficient permissions to edit themes for this blog.').'</p>');
update_recently_edited($file);
diff --git a/wp-admin/upgrade-schema.php b/wp-admin/upgrade-schema.php
index 702fe4c..08ec537 100644
--- a/wp-admin/upgrade-schema.php
+++ b/wp-admin/upgrade-schema.php
@@ -279,11 +279,11 @@ function populate_options() {
add_option('use_linksupdate', 0);
add_option('template', 'default');
add_option('stylesheet', 'default');
- add_option('comment_whitelist', 0);
+ add_option('comment_whitelist', 1);
add_option('page_uris');
add_option('blacklist_keys');
add_option('comment_registration', 0);
- add_option('open_proxy_check', 1);
+ add_option('open_proxy_check', 0);
add_option('rss_language', 'en');
add_option('html_type', 'text/html');
// 1.5.1
@@ -310,13 +310,6 @@ function populate_options() {
add_option('default_link_category', 2);
add_option('show_on_front', 'posts');
- add_site_option( 'customizefeed1', '0' );
- add_site_option( 'customizefeed2', '0' );
- add_site_option( 'dashboardfeed1', 'http://wordpress.org/development/feed/' );
- add_site_option( 'dashboardfeed2', 'http://planet.wordpress.org/feed/' );
- add_site_option( 'dashboardfeed1name', 'WordPress Development Blog' );
- add_site_option( 'dashboardfeed2name', 'Other WordPress News' );
-
// Delete unused options
$unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog');
foreach ($unusedoptions as $option) :
diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php
index 26376b7..1731520 100644
--- a/wp-admin/user-edit.php
+++ b/wp-admin/user-edit.php
@@ -8,21 +8,7 @@ else
$parent_file = 'profile.php';
$submenu_file = 'users.php';
-$wpvarstoreset = array('action', 'redirect', 'profile', 'user_id', 'wp_http_referer');
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
- $wpvar = $wpvarstoreset[$i];
- if (!isset($$wpvar)) {
- if (empty($_POST["$wpvar"])) {
- if (empty($_GET["$wpvar"])) {
- $$wpvar = '';
- } else {
- $$wpvar = $_GET["$wpvar"];
- }
- } else {
- $$wpvar = $_POST["$wpvar"];
- }
- }
-}
+wp_reset_vars(array('action', 'redirect', 'profile', 'user_id', 'wp_http_referer'));
$wp_http_referer = remove_query_arg(array('update', 'delete_count'), stripslashes($wp_http_referer));
// Only allow site admins to edit every user.
@@ -102,6 +88,7 @@ if ( !current_user_can('edit_user', $user_id) )
<p><label><?php _e('Username: (no editing)'); ?><br />
<input type="text" name="user_login" value="<?php echo $profileuser->user_login; ?>" disabled="disabled" />
</label></p>
+
<p><label><?php _e('Role:') ?><br />
<?php
// print_r($profileuser);
diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css
index eb7052d..f7769f6 100644
--- a/wp-admin/wp-admin.css
+++ b/wp-admin/wp-admin.css
@@ -905,6 +905,11 @@ table .vers {
padding-right: 2px;
}
+#moremeta fieldset.dbx-box-closed {
+ background: url(images/box-butt.gif) no-repeat bottom;
+ padding-bottom: 9px;
+}
+
/* handles */
.dbx-handle {
diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php
index d596500..9a34aeb 100644
--- a/wp-includes/default-filters.php
+++ b/wp-includes/default-filters.php
@@ -42,6 +42,7 @@ add_filter('comment_url', 'clean_url');
add_filter('comment_text', 'convert_chars');
add_filter('comment_text', 'make_clickable');
+add_filter('comment_text', 'force_balance_tags', 25);
add_filter('comment_text', 'wpautop', 30);
add_filter('comment_text', 'convert_smilies', 20);
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 7d52ed9..cc5e76b 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -70,7 +70,11 @@ function wpautop($pee, $br = 1) {
$pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);
$pee = preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)!', "$1", $pee);
$pee = preg_replace('!(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee);
- if ($br) $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
+ if ($br) {
+ $pee = preg_replace('/<(script|style).*?<\/\\1>/se', 'str_replace("\n", "<WPPreserveNewline />", "\\0")', $pee);
+ $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
+ $pee = str_replace('<WPPreserveNewline />', "\n", $pee);
+ }
$pee = preg_replace('!(</?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*<br />!', "$1", $pee);
$pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $pee);
$pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '</pre>' ", $pee);
@@ -505,6 +509,9 @@ function balanceTags($text, $is_comment = 0, $force = false) {
return $newtext;
}
+function force_balance_tags($text) {
+ return balanceTags($text, 0, true);
+}
function format_to_edit($content, $richedit = false) {
$content = apply_filters('format_to_edit', $content);
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 91d3379..f36a79a 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -829,7 +829,7 @@ function is_blog_installed() {
}
function wp_nonce_url($actionurl, $action = -1) {
- return add_query_arg('_wpnonce', wp_create_nonce($action), $actionurl);
+ return wp_specialchars(add_query_arg('_wpnonce', wp_create_nonce($action), $actionurl));
}
function wp_nonce_field($action = -1) {
@@ -1036,7 +1036,7 @@ function wp_check_filetype($filename, $mimes = null) {
function wp_proxy_check($ipnum) {
if ( get_option('open_proxy_check') && isset($ipnum) ) {
$rev_ip = implode( '.', array_reverse( explode( '.', $ipnum ) ) );
- $lookup = $rev_ip . '.opm.blitzed.org.';
+ $lookup = $rev_ip . '.sbl-xbl.spamhaus.org.';
if ( $lookup != gethostbyname( $lookup ) )
return true;
}
diff --git a/wp-includes/post.php b/wp-includes/post.php
index b29d0d2..c89c552 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -1259,7 +1259,7 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) {
wp_set_post_categories($post_ID, $post_category);
if ( $file )
- add_post_meta($post_ID, '_wp_attached_file', $file );
+ add_post_meta($post_ID, '_wp_attached_file', quotemeta( $file ) );
clean_post_cache($post_ID);
diff --git a/wp-includes/query.php b/wp-includes/query.php
index 3bb98b0..d42aa9e 100644
--- a/wp-includes/query.php
+++ b/wp-includes/query.php
@@ -555,6 +555,7 @@ class WP_Query {
if (isset($q['page'])) {
$q['page'] = trim($q['page'], '/');
$q['page'] = (int) $q['page'];
+ $q['page'] = abs($q['page']);
}
$add_hours = intval(get_settings('gmt_offset'));
@@ -842,11 +843,11 @@ class WP_Query {
}
if ( $this->is_attachment ) {
- $where .= ' AND (post_type = "attachment")';
+ $where .= " AND (post_type = 'attachment')";
} elseif ($this->is_page) {
- $where .= ' AND (post_type = "page")';
+ $where .= " AND (post_type = 'page')";
} elseif ($this->is_single) {
- $where .= ' AND (post_type = "post")';
+ $where .= " AND (post_type = 'post')";
} else {
$where .= " AND (post_type = '$post_type' AND (post_status = 'publish'";
@@ -875,18 +876,19 @@ class WP_Query {
// Paging
if (empty($q['nopaging']) && ! $this->is_single && ! $this->is_page) {
- $page = $q['paged'];
+ $page = abs(intval($q['paged']));
if (empty($page)) {
$page = 1;
}
if (($q['what_to_show'] == 'posts')) {
+ $q['offset'] = abs(intval($q['offset']));
if ( empty($q['offset']) ) {
$pgstrt = '';
$pgstrt = (intval($page) -1) * $q['posts_per_page'] . ', ';
$limits = 'LIMIT '.$pgstrt.$q['posts_per_page'];
} else { // we're ignoring $page and using 'offset'
- $pgstrt = intval($q['offset']) . ', ';
+ $pgstrt = $q['offset'] . ', ';
$limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
}
} elseif ($q['what_to_show'] == 'days') {
diff --git a/wp-login.php b/wp-login.php
index 87c765f..b169ee5 100644
--- a/wp-login.php
+++ b/wp-login.php
@@ -207,6 +207,8 @@ default:
if ( $using_cookie )
$error = __('Your session has expired.');
}
+ } else if ( $user_login || $user_pass ) {
+ $error = __('<strong>Error</strong>: The password field is empty.');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">