summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-includes/functions.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-01-30 12:03:26 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-01-30 12:03:26 +0000
commit229ea6db0019536f1efea2dadfe3ad53284a9574 (patch)
tree723b7da1fc5c0b8629cc4176da19b5c80036d710 /wp-inst/wp-includes/functions.php
parent7322c2da3ce036e18768aa2f79bc4897796b6ac8 (diff)
downloadwordpress-mu-229ea6db0019536f1efea2dadfe3ad53284a9574.tar.gz
wordpress-mu-229ea6db0019536f1efea2dadfe3ad53284a9574.tar.xz
wordpress-mu-229ea6db0019536f1efea2dadfe3ad53284a9574.zip
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@520 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/functions.php')
-rw-r--r--wp-inst/wp-includes/functions.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/wp-inst/wp-includes/functions.php b/wp-inst/wp-includes/functions.php
index 61d5278..c596a98 100644
--- a/wp-inst/wp-includes/functions.php
+++ b/wp-inst/wp-includes/functions.php
@@ -466,7 +466,7 @@ AND meta_key = '$key'");
$wpdb->query("DELETE FROM $wpdb->postmeta WHERE post_id = '$post_id'
AND meta_key = '$key' AND meta_value = '$value'");
$cache_key = $post_meta_cache['$post_id'][$key];
- foreach ( $cache_key as $index => $data )
+ if ($cache_key) foreach ( $cache_key as $index => $data )
if ( $data == $value )
unset($post_meta_cache['$post_id'][$key][$index]);
}
@@ -820,7 +820,7 @@ function get_all_category_ids() {
function get_all_page_ids() {
global $wpdb;
- if ( ! $page_ids = wp_cache_get('all_page_ids', 'posts') ) {
+ if ( ! $page_ids = wp_cache_get('all_page_ids', 'pages') ) {
$page_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_status='static'");
wp_cache_add('all_page_ids', $page_ids, 'pages');
}
@@ -1007,6 +1007,9 @@ function spawn_pinger() {
if ( $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_pingme' OR meta_key = '_encloseme' LIMIT 1") )
$doping = true;
+ if ( substr(php_sapi_name(), 0, 3) == 'cgi' )
+ return $doping;
+
if ( $doping ) {
$ping_url = get_settings('siteurl') .'/wp-admin/execute-pings.php';
$parts = parse_url($ping_url);
@@ -2224,9 +2227,10 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) {
if ( is_array($meta_value) || is_object($meta_value) )
$meta_value = serialize($meta_value);
$meta_value = trim( $meta_value );
-
- if ( '' == $meta_value )
- return false;
+
+ if (empty($meta_value)) {
+ delete_usermeta($user_id, $meta_key);
+ }
$cur = $wpdb->get_row("SELECT * FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
if ( !$cur ) {