diff --git a/wp-blog-header.php b/wp-blog-header.php
index d89dab4866..0c884920c8 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 d1d267b66e..4586c92b3d 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 daceeec7e6..9e86eb58af 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 c454231d79..ba0d3e5f5d 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 e783bb3c3c..9ac56dc905 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 1c599dfac4..bab2aae428 100644
--- a/wp-rss2.php
+++ b/wp-rss2.php
@@ -1,5 +1,5 @@