From b4a0d174d840cbcac4605533c8f28a432eae68cb Mon Sep 17 00:00:00 2001 From: saxmatt Date: Wed, 5 May 2004 21:29:23 +0000 Subject: [PATCH] Some E_ALL fixes. git-svn-id: http://svn.automattic.com/wordpress/trunk@1235 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-blog-header.php | 6 +++--- wp-includes/functions.php | 4 +++- wp-includes/links.php | 9 ++++++--- wp-includes/template-functions-category.php | 10 ++++++---- wp-includes/template-functions-general.php | 2 +- wp-rss2.php | 2 +- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/wp-blog-header.php b/wp-blog-header.php index d89dab486..0c884920c 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -499,10 +499,10 @@ if ($posts) { $mval = $metarow['meta_value']; // Force subkeys to be array type: - if (!is_array($post_meta_cache[$mpid])) + if (!isset($post_meta_cache[$mpid]) || !is_array($post_meta_cache[$mpid])) $post_meta_cache[$mpid] = array(); - if (!is_array($post_meta_cache[$mpid][$mkey])) - $post_meta_cache[$mpid][$mkey] = array(); + if (!isset($post_meta_cache[$mpid]["$mkey"]) || !is_array($post_meta_cache[$mpid]["$mkey"])) + $post_meta_cache[$mpid]["$mkey"] = array(); // Add a value to the current pid/key: $post_meta_cache[$mpid][$mkey][] = $mval; diff --git a/wp-includes/functions.php b/wp-includes/functions.php index d1d267b66..4586c92b3 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -163,7 +163,9 @@ function user_pass_ok($user_login,$user_pass) { function get_currentuserinfo() { // a bit like get_userdata(), on steroids global $user_login, $userdata, $user_level, $user_ID, $user_nickname, $user_email, $user_url, $user_pass_md5, $cookiehash; // *** retrieving user's data from cookies and db - no spoofing - $user_login = $_COOKIE['wordpressuser_' . $cookiehash]; + + if (isset($_COOKIE['wordpressuser_' . $cookiehash])) + $user_login = $_COOKIE['wordpressuser_' . $cookiehash]; $userdata = get_userdatabylogin($user_login); $user_level = $userdata->user_level; $user_ID = $userdata->ID; diff --git a/wp-includes/links.php b/wp-includes/links.php index daceeec7e..9e86eb58a 100644 --- a/wp-includes/links.php +++ b/wp-includes/links.php @@ -123,7 +123,9 @@ function get_links($category = -1, $before = '', $after = '
', } if (get_settings('links_recently_updated_time')) { $recently_updated_test = ", IF (DATE_ADD(link_updated, INTERVAL ".get_settings('links_recently_updated_time')." MINUTE) >= NOW(), 1,0) as recently_updated "; - } + } else { + $recently_updated_test = ''; + } if ($show_updated) { $get_updated = ", UNIX_TIMESTAMP(link_updated) AS link_updated_f "; } @@ -167,6 +169,7 @@ function get_links($category = -1, $before = '', $after = '
', return; } foreach ($results as $row) { + if (!isset($row->recently_updated)) $row->recently_updated = false; echo($before); if ($show_updated && $row->recently_updated) { echo get_settings('links_recently_updated_prepend'); @@ -533,8 +536,8 @@ function get_links_list($order = 'name', $hide_if_empty = 'obsolete') { // if 'name' wasn't specified, assume 'id': $cat_order = ('name' == $order) ? 'cat_name' : 'cat_id'; - - // Fetch the link category data as an array of hashes + if (!isset($direction)) $direction = ''; + // Fetch the link category data as an array of hashesa $cats = $wpdb->get_results(" SELECT DISTINCT link_category, cat_name, show_images, show_description, show_rating, show_updated, sort_order, diff --git a/wp-includes/template-functions-category.php b/wp-includes/template-functions-category.php index c454231d7..ba0d3e5f5 100644 --- a/wp-includes/template-functions-category.php +++ b/wp-includes/template-functions-category.php @@ -264,8 +264,8 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde $file = get_settings('home') . '/' . get_settings('blogfilename'); } + $exclusions = ''; if (!empty($exclude)) { - $exclusions = ''; // initialize for safety $excats = preg_split('/[\s,]+/',$exclude); if (count($excats)) { foreach ($excats as $excat) { @@ -326,7 +326,7 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde $thelist = ""; foreach ($categories as $category) { - if ((intval($hide_empty) == 0 || $category_posts["$category->cat_ID"] > 0) && (!$children || $category->category_parent == $child_of)) { + if ((intval($hide_empty) == 0 || isset($category_posts["$category->cat_ID"])) && (!$children || $category->category_parent == $child_of)) { $num_found++; $link = 'category_description)) { @@ -395,8 +395,10 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde if ($list && $child_of && $num_found && $recurse) { $pre = "\t\t\n"; - } - $thelist=$pre.$thelist.$post; + } else { + $pre = $post = ''; + } + $thelist = $pre . $thelist . $post; if ($recurse) { return $thelist; } diff --git a/wp-includes/template-functions-general.php b/wp-includes/template-functions-general.php index e783bb3c3..9ac56dc90 100644 --- a/wp-includes/template-functions-general.php +++ b/wp-includes/template-functions-general.php @@ -441,7 +441,7 @@ function get_calendar($daylength = 1) { $ak_titles_for_day['day_'.$ak_post_title->dom] = ''; } if (empty($ak_titles_for_day["$ak_post_title->dom"])) { // first one - $ak_titles_for_day["$ak_post_title->dom"] .= htmlspecialchars(stripslashes($ak_post_title->post_title)); + $ak_titles_for_day["$ak_post_title->dom"] = htmlspecialchars(stripslashes($ak_post_title->post_title)); } else { $ak_titles_for_day["$ak_post_title->dom"] .= $ak_title_separator . htmlspecialchars(stripslashes($ak_post_title->post_title)); } diff --git a/wp-rss2.php b/wp-rss2.php index 1c599dfac..bab2aae42 100644 --- a/wp-rss2.php +++ b/wp-rss2.php @@ -1,5 +1,5 @@