Changeset 810 for trunk/wp-includes/functions.php
- Timestamp:
- 01/30/2004 02:39:01 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r779 r810 413 413 global $wpdb, $cache_userdata, $use_cache, $tableusers; 414 414 if ((empty($cache_userdata[$userid])) || (!$use_cache)) { 415 $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID = $userid");415 $user = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID = '$userid'"); 416 416 $user->user_nickname = stripslashes($user->user_nickname); 417 417 $user->user_firstname = stripslashes($user->user_firstname); … … 465 465 function get_usernumposts($userid) { 466 466 global $tableposts, $tablecomments, $wpdb; 467 return $wpdb->get_var("SELECT COUNT(*) FROM $tableposts WHERE post_author = $userid");467 return $wpdb->get_var("SELECT COUNT(*) FROM $tableposts WHERE post_author = '$userid'"); 468 468 } 469 469 … … 528 528 529 529 // Otherwise, build a WHERE clause, making the values safe along the way: 530 if ($year) $where .= " AND YEAR(post_date) = " . intval($year);531 if ($monthnum) $where .= " AND MONTH(post_date) = " . intval($monthnum);532 if ($day) $where .= " AND DAYOFMONTH(post_date) = " . intval($day);530 if ($year) $where .= " AND YEAR(post_date) = '" . intval($year) . "'"; 531 if ($monthnum) $where .= " AND MONTH(post_date) = '" . intval($monthnum) . "'"; 532 if ($day) $where .= " AND DAYOFMONTH(post_date) = '" . intval($day) . "'"; 533 533 if ($postname) $where .= " AND post_name = '" . $wpdb->escape($postname) . "' "; 534 534 … … 585 585 global $post, $tableusers, $tablecategories, $tableposts, $tablecomments, $wpdb; 586 586 587 $post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID = $postid");587 $post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID = '$postid'"); 588 588 589 589 $postdata = array ( … … 630 630 global $postc,$id,$commentdata,$tablecomments, $wpdb; 631 631 if ($no_cache) { 632 $query = "SELECT * FROM $tablecomments WHERE comment_ID = $comment_ID";632 $query = "SELECT * FROM $tablecomments WHERE comment_ID = '$comment_ID'"; 633 633 if (false == $include_unapproved) { 634 634 $query .= " AND comment_approved = '1'"; … … 681 681 SELECT category_id 682 682 FROM $tablecategories, $tablepost2cat 683 WHERE $tablepost2cat.category_id = cat_ID AND $tablepost2cat.post_id = $post->ID683 WHERE $tablepost2cat.category_id = cat_ID AND $tablepost2cat.post_id = '$post->ID' 684 684 "); 685 685 } else { … … 938 938 @fclose($fs); 939 939 940 $wpdb->query("UPDATE $tableposts SET pinged = CONCAT(pinged, '\n', '$tb_url') WHERE ID = $ID");941 $wpdb->query("UPDATE $tableposts SET to_ping = REPLACE(to_ping, '$tb_url', '') WHERE ID = $ID");940 $wpdb->query("UPDATE $tableposts SET pinged = CONCAT(pinged, '\n', '$tb_url') WHERE ID = '$ID'"); 941 $wpdb->query("UPDATE $tableposts SET to_ping = REPLACE(to_ping, '$tb_url', '') WHERE ID = '$ID'"); 942 942 return $result; 943 943 }
Note: See TracChangeset
for help on using the changeset viewer.