--- wp-pass.php +++ wp-pass.php @@ -7,5 +7,5 @@ // 10 days setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH); -wp_redirect($_SERVER['HTTP_REFERER']); +wp_redirect(wp_get_referer()); ?> \ No newline at end of file --- wp-login.php +++ wp-login.php @@ -27,7 +27,7 @@ $redirect_to = 'wp-login.php'; if ( isset($_REQUEST['redirect_to']) ) - $redirect_to = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $_REQUEST['redirect_to']); + $redirect_to = $_REQUEST['redirect_to']; wp_redirect($redirect_to); exit(); @@ -170,7 +170,6 @@ $redirect_to = 'wp-admin/'; else $redirect_to = $_REQUEST['redirect_to']; - $redirect_to = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $redirect_to); if( $_POST ) { $user_login = $_POST['log']; @@ -205,6 +204,8 @@ if ( $using_cookie ) $error = __('Your session has expired.'); } + } else if ( $user_login || $user_pass ) { + $error = __('Error: The password field is empty.'); } ?> @@ -237,7 +238,7 @@

- +

- + --- wp-content/themes/default/search.php +++ wp-content/themes/default/search.php @@ -5,7 +5,7 @@

Search Results

- + --- wp-content/themes/default/index.php +++ wp-content/themes/default/index.php @@ -3,27 +3,27 @@
- + - +

- +
- +
- + - +

Not Found

--- wp-content/themes/default/functions.php +++ wp-content/themes/default/functions.php @@ -57,7 +57,7 @@ $color = kubrick_header_color(); if ( false === $color ) return 'white'; - + return $color; } @@ -100,21 +100,21 @@ } } } else { - + if ( isset($_REQUEST['headerimage']) ) { if ( '' == $_REQUEST['headerimage'] ) delete_option('kubrick_header_image'); else update_option('kubrick_header_image', $_REQUEST['headerimage']); } - + if ( isset($_REQUEST['fontcolor']) ) { if ( '' == $_REQUEST['fontcolor'] ) delete_option('kubrick_header_color'); else update_option('kubrick_header_color', $_REQUEST['fontcolor']); } - + if ( isset($_REQUEST['fontdisplay']) ) { if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] ) delete_option('kubrick_header_display'); @@ -123,7 +123,7 @@ } } //print_r($_REQUEST); - header("Location: themes.php?page=functions.php&saved=true"); + wp_redirect("themes.php?page=functions.php&saved=true"); die; } add_action('admin_head', 'kubrick_theme_page_head'); @@ -135,6 +135,7 @@ ?> --- wp-content/themes/default/attachment.php +++ wp-content/themes/default/attachment.php @@ -1,9 +1,9 @@
- + - + --- wp-admin/inline-uploading.php +++ wp-admin/inline-uploading.php @@ -41,7 +41,7 @@ wp_delete_attachment($attachment); -header("Location: " . basename(__FILE__) ."?post=$post&all=$all&action=view&start=$start"); +wp_redirect(basename(__FILE__) ."?post=$post&all=$all&action=view&start=$start"); die; case 'save': @@ -102,7 +102,7 @@ add_post_meta($id, '_wp_attachment_metadata', array()); } -header("Location: " . basename(__FILE__) . "?post=$post&all=$all&action=view&start=0"); +wp_redirect(basename(__FILE__) . "?post=$post&all=$all&action=view&start=0"); die(); case 'upload': @@ -141,7 +141,7 @@ $attachments = $wpdb->get_results("SELECT ID, post_date, post_title, post_mime_type, guid FROM $wpdb->posts WHERE post_status = 'attachment' $and_type $and_post $and_user ORDER BY $sort LIMIT $start, $double", ARRAY_A); if ( count($attachments) == 0 ) { - header("Location: " . basename(__FILE__) ."?post=$post&action=upload" ); + wp_redirect( basename(__FILE__) ."?post=$post&action=upload" ); die; } elseif ( count($attachments) > $num ) { $next = $start + count($attachments) - $num; @@ -238,7 +238,7 @@ $xpadding = (128 - $image['uwidth']) / 2; $ypadding = (96 - $image['uheight']) / 2; $style .= "#target{$ID} img { padding: {$ypadding}px {$xpadding}px; }\n"; - $title = htmlentities($image['post_title'], ENT_QUOTES); + $title = wp_specialchars($image['post_title'], ENT_QUOTES); $script .= "aa[{$ID}] = ''; ab[{$ID}] = ''; imga[{$ID}] = '\"{$title}\"'; @@ -258,7 +258,7 @@
"; } else { - $title = htmlentities($attachment['post_title'], ENT_QUOTES); + $title = wp_specialchars($attachment['post_title'], ENT_QUOTES); $filename = basename($attachment['guid']); $icon = get_attachment_icon($ID); $toggle_icon = "$__using_title"; @@ -299,8 +299,10 @@ + - -

WordPress

+ +

WordPress

The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.

"); switch($step) { case 0: ?> +

Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.

  1. Database name
  2. Database username
  3. -
  4. Database password
  5. +
  6. Database password
  7. Database host
  8. Table prefix (if you want to run more than one WordPress in a single database)
@@ -70,40 +100,42 @@ case 1: ?>

-
+

Below you should enter your database connection details. If you're not sure about these, contact your host.

- + - + - + - + - + -
Database Name The name of the database you want to run WP in.
User Name Your MySQL username
Password ...and MySQL password.
Database Host 99% chance you won't need to change this value.
Table Prefix If you want to run multiple WordPress installations in a single database, change this.
- + +

+ +

All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to run the install!

+?> + --- wp-admin/link-manager.php +++ wp-admin/link-manager.php @@ -49,7 +49,7 @@ //userlevel of the owner of the link then we can proceed. if (count($linkcheck) == 0) { - header('Location: ' . $this_file); + wp_redirect($this_file); exit; } $all_links = join(',', $linkcheck); @@ -62,7 +62,7 @@ $all_links = join(',', $ids_to_change); $q = $wpdb->query("update $wpdb->links SET link_owner='$newowner' WHERE link_id IN ($all_links)"); - header('Location: ' . $this_file); + wp_redirect($this_file); break; } case 'visibility': @@ -75,7 +75,7 @@ //for each link id (in $linkcheck[]): toggle the visibility if (count($linkcheck) == 0) { - header('Location: ' . $this_file); + wp_redirect($this_file); exit; } $all_links = join(',', $linkcheck); @@ -99,7 +99,7 @@ $q = $wpdb->query("update $wpdb->links SET link_visible='Y' WHERE link_id IN ($all_linkson)"); } - header('Location: ' . $this_file); + wp_redirect($this_file); break; } case 'move': @@ -112,14 +112,14 @@ //for each link id (in $linkcheck[]) change category to selected value if (count($linkcheck) == 0) { - header('Location: ' . $this_file); + wp_redirect($this_file); exit; } $all_links = join(',', $linkcheck); // should now have an array of links we can change $q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)"); - header('Location: ' . $this_file); + wp_redirect($this_file); break; } @@ -129,14 +129,14 @@ add_link(); - header('Location: ' . $_SERVER['HTTP_REFERER'] . '?added=true'); + wp_redirect(wp_get_referer() . '?added=true'); break; } // end Add case 'editlink': { $link_id = (int) $_POST['link_id']; - check_admin_referer('update-bookmark' . $link_id); + check_admin_referer('update-bookmark_' . $link_id); if (isset($links_show_cat_id) && ($links_show_cat_id != '')) $cat_id = $links_show_cat_id; @@ -154,10 +154,10 @@ break; } // end Save - case 'Delete': + case 'delete': { $link_id = (int) $_GET['link_id']; - check_admin_referer('delete-bookmark' . $link_id); + check_admin_referer('delete-bookmark_' . $link_id); if ( !current_user_can('manage_links') ) die (__("Cheatin' uh ?")); @@ -382,7 +382,7 @@ if ($show_buttons) { echo '' . __('Edit') . ''; - echo 'link_id , '".sprintf(__("You are about to delete the "%s" bookmark to %s.\\n"Cancel" to stop, "OK" to delete."), wp_specialchars($link->link_name, 1), wp_specialchars($link->link_url)).'\' );" class="delete">'.__('Delete').''; + echo 'link_id , '".sprintf(__("You are about to delete the "%s" bookmark to %s.\\n"Cancel" to stop, "OK" to delete."), js_escape($link->link_name), js_escape($link->link_url)).'\' );">'.__('Delete').''; echo ''; } else { echo "   \n"; --- wp-admin/index.php +++ wp-admin/index.php @@ -43,7 +43,6 @@

»

-
- + + get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 5") ) : ?> --- wp-admin/sidebar.php +++ wp-admin/sidebar.php @@ -48,7 +48,7 @@

WordPress

-
+
--- wp-admin/import.php +++ wp-admin/import.php @@ -36,7 +36,7 @@ $style = ''; foreach ($importers as $id => $data) { $style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate'; - $action = "{$data[0]}"; + $action = "{$data[0]}"; if ($style != '') $style = 'class="'.$style.'"'; --- wp-admin/admin-db.php +++ wp-admin/admin-db.php @@ -156,7 +156,7 @@ $cat_ID = (int) $cat_ID; // Don't delete the default cat. - if (1 == $cat_ID) + if ($cat_ID == get_option('default_category')) return 0; $category = get_category($cat_ID); @@ -170,7 +170,8 @@ $wpdb->query("UPDATE $wpdb->categories SET category_parent = '$parent' WHERE category_parent = '$cat_ID'"); // TODO: Only set categories to general if they're not in another category already - $wpdb->query("UPDATE $wpdb->post2cat SET category_id='1' WHERE category_id='$cat_ID'"); + $default_cat = get_option('default_category'); + $wpdb->query("UPDATE $wpdb->post2cat SET category_id='$default_cat' WHERE category_id='$cat_ID'"); wp_cache_delete($cat_ID, 'category'); wp_cache_delete('all_category_ids', 'category'); --- wp-admin/edit-link-form.php +++ wp-admin/edit-link-form.php @@ -87,7 +87,7 @@ /> -