diff --git a/wp-content/themes/default/comments.php b/wp-content/themes/default/comments.php index 4d83251c33..ee2443e660 100644 --- a/wp-content/themes/default/comments.php +++ b/wp-content/themes/default/comments.php @@ -1,5 +1,5 @@ post_password)) { // if there's a password diff --git a/wp-content/themes/default/header.php b/wp-content/themes/default/header.php index ec70a6af42..b881290554 100644 --- a/wp-content/themes/default/header.php +++ b/wp-content/themes/default/header.php @@ -14,7 +14,7 @@ #page { background: url("/images/kubrickbg-.jpg") repeat-y top; border: none; } diff --git a/wp-includes/cache.php b/wp-includes/cache.php index 895f48589c..bb6cafa398 100644 --- a/wp-includes/cache.php +++ b/wp-includes/cache.php @@ -353,7 +353,9 @@ class WP_Object_Cache { $data = ''; $this->cache[$group][$id] = $data; - unset ($this->non_existant_objects[$group][$id]); + + if(isset($this->non_existant_objects[$group][$id])) + unset ($this->non_existant_objects[$group][$id]); return true; } diff --git a/wp-includes/classes.php b/wp-includes/classes.php index d68f2ce589..39a1b0da83 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -185,14 +185,14 @@ class WP { @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); } else { // We're showing a feed, so WP is indeed the only thing that last changed - if ( $this->query_vars['withcomments'] - || ( !$this->query_vars['withoutcomments'] - && ( $this->query_vars['p'] - || $this->query_vars['name'] - || $this->query_vars['page_id'] - || $this->query_vars['pagename'] - || $this->query_vars['attachment'] - || $this->query_vars['attachment_id'] + if ( !empty($this->query_vars['withcomments']) + || ( empty($this->query_vars['withoutcomments']) + && ( !empty($this->query_vars['p']) + || !empty($this->query_vars['name']) + || !empty($this->query_vars['page_id']) + || !empty($this->query_vars['pagename']) + || !empty($this->query_vars['attachment']) + || !empty($this->query_vars['attachment_id']) ) ) ) @@ -208,7 +208,7 @@ class WP { $client_etag = stripslashes(stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])); else $client_etag = false; - $client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE']); + $client_last_modified = empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? '' : trim($_SERVER['HTTP_IF_MODIFIED_SINCE']); // If string is empty, return 0. If not, attempt to parse into a timestamp $client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0; diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 4edd476345..8f0705ed09 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -729,7 +729,7 @@ function comments_popup_link( $zero = 'No Comments', $one = '1 Comment', $more = } if ( !empty($post->post_password) ) { // if there's a password - if ( $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) { // and it doesn't match the cookie + if ( !isset($_COOKIE['wp-postpass_' . COOKIEHASH]) || $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) { // and it doesn't match the cookie echo __('Enter your password to view comments'); return; } diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 7816398886..2384fe84e3 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -145,7 +145,7 @@ function html_type_rss() { function rss_enclosure() { global $post; - if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) + if ( !empty($post->post_password) && (!isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || $_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) return; foreach (get_post_custom() as $key => $val) { diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index f7c7278e25..05a8504189 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -524,6 +524,7 @@ function get_adjacent_post($in_same_cat = false, $excluded_categories = '', $pre $current_post_date = $post->post_date; $join = ''; + $posts_in_ex_cats_sql = ''; if ( $in_same_cat || !empty($excluded_categories) ) { $join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id"; @@ -615,7 +616,7 @@ function get_pagenum_link($pagenum = 1) { $qs_regex = '|\?.*?$|'; preg_match( $qs_regex, $request, $qs_match ); - if ( $qs_match[0] ) { + if ( !empty( $qs_match[0] ) ) { $query_string = $qs_match[0]; $request = preg_replace( $qs_regex, '', $request ); } else { diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 50958b6b6f..7c16efccdb 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -775,7 +775,7 @@ function wp_safe_redirect($location, $status = 302) { $lp = parse_url($location); $wpp = parse_url(get_option('home')); - $allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), $lp['host']); + $allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : ''); if ( isset($lp['host']) && ( !in_array($lp['host'], $allowed_hosts) && $lp['host'] != strtolower($wpp['host'])) ) $location = get_option('siteurl') . '/wp-admin/'; diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 0395a079b0..0c872e9b64 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -86,7 +86,7 @@ function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_ $output = ''; if ( !empty($post->post_password) ) { // if there's a password - if ( stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password ) { // and it doesn't match the cookie + if ( !isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password ) { // and it doesn't match the cookie $output = get_the_password_form(); return $output; } @@ -141,7 +141,7 @@ function get_the_excerpt($deprecated = '') { $output = ''; $output = $post->post_excerpt; if ( !empty($post->post_password) ) { // if there's a password - if ( $_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password ) { // and it doesn't match the cookie + if ( !isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || $_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password ) { // and it doesn't match the cookie $output = __('There is no excerpt because this is a protected post.'); return $output; } diff --git a/wp-includes/user.php b/wp-includes/user.php index b0cac11c9b..015d94a78f 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -216,7 +216,7 @@ function setup_userdata($user_id = '') { $userdata = $user->data; $user_login = $user->user_login; - $user_level = (int) $user->user_level; + $user_level = (int) isset($user->user_level) ? $user->user_level : 0; $user_ID = (int) $user->ID; $user_email = $user->user_email; $user_url = $user->user_url; diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 4d8c437909..d84d8b59a0 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -339,7 +339,7 @@ class wpdb { $this->query($query); // Extract var out of cached results based x,y vals - if ( $this->last_result[$y] ) { + if ( !empty( $this->last_result[$y] ) ) { $values = array_values(get_object_vars($this->last_result[$y])); } diff --git a/wp-login.php b/wp-login.php index 195405e176..c7fa606a2f 100644 --- a/wp-login.php +++ b/wp-login.php @@ -174,7 +174,7 @@ function register_new_user($user_login, $user_email) { // Main // -$action = $_REQUEST['action']; +$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; $errors = new WP_Error(); if ( isset($_GET['key']) ) @@ -351,17 +351,17 @@ default: $errors->add('test_cookie', __("ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.")); // Some parts of this script use the main login form to display a message - if ( TRUE == $_GET['loggedout'] ) $errors->add('loggedout', __('You are now logged out.')); - elseif ( 'disabled' == $_GET['registration'] ) $errors->add('registerdiabled', __('User registration is currently not allowed.')); - elseif ( 'confirm' == $_GET['checkemail'] ) $errors->add('confirm', __('Check your e-mail for the confirmation link.')); - elseif ( 'newpass' == $_GET['checkemail'] ) $errors->add('newpass', __('Check your e-mail for your new password.')); - elseif ( 'registered' == $_GET['checkemail'] ) $errors->add('registered', __('Registration complete. Please check your e-mail.')); + if ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] ) $errors->add('loggedout', __('You are now logged out.')); + elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) $errors->add('registerdiabled', __('User registration is currently not allowed.')); + elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) $errors->add('confirm', __('Check your e-mail for the confirmation link.')); + elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) $errors->add('newpass', __('Check your e-mail for your new password.')); + elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) $errors->add('registered', __('Registration complete. Please check your e-mail.')); login_header(__('Login'), '', $errors); ?>
- +

@@ -384,7 +384,7 @@ default: