diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-06-24 00:38:40 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-06-24 00:38:40 +0000 |
commit | 028c8e60504546b1ad2342f168bbf5bf3d25f618 (patch) | |
tree | abff3976f64cfab51a953c05a178de43e8e03bcb | |
parent | b1d45297e7ea4b26c7b8f484bddae704a26e2c34 (diff) | |
download | brdo-028c8e60504546b1ad2342f168bbf5bf3d25f618.tar.gz brdo-028c8e60504546b1ad2342f168bbf5bf3d25f618.tar.bz2 |
#148678: Fix notices/warnings on invalid paths like 'node/zzz'. (chx/pwolanin/webernet)
-rw-r--r-- | modules/comment/comment.module | 2 | ||||
-rw-r--r-- | modules/node/node.module | 5 | ||||
-rw-r--r-- | modules/user/user.module | 3 |
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') { |