summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/comment/comment.module2
-rw-r--r--modules/node/node.module5
-rw-r--r--modules/user/user.module3
3 files changed, 8 insertions, 2 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index bb1dee560..d12798c59 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -973,7 +973,7 @@ function comment_render($node, $cid = 0) {
$order = _comment_get_display_setting('sort');
$comments_per_page = _comment_get_display_setting('comments_per_page');
- if ($cid) {
+ if ($cid && is_numeric($cid)) {
// Single comment view.
$query = 'SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.score, c.users, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d';
$query_args = array($cid);
diff --git a/modules/node/node.module b/modules/node/node.module
index f1f6c2440..6463a7f81 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -568,7 +568,7 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) {
$cond = 'n.nid = %d';
$arguments[] = $param;
}
- else {
+ elseif (is_array($param)) {
// Turn the conditions into a query.
foreach ($param as $key => $value) {
$cond[] = 'n.'. db_escape_string($key) ." = '%s'";
@@ -576,6 +576,9 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) {
}
$cond = implode(' AND ', $cond);
}
+ else {
+ return FALSE;
+ }
// Retrieve the node.
// No db_rewrite_sql is applied so as to get complete indexing for search.
diff --git a/modules/user/user.module b/modules/user/user.module
index 48b7c9034..0f95e10d1 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -130,6 +130,9 @@ function user_load($array = array()) {
if (is_numeric($array)) {
$array = array('uid' => $array);
}
+ elseif (!is_array($array)) {
+ return FALSE;
+ }
foreach ($array as $key => $value) {
if ($key == 'uid' || $key == 'status') {