Commit 028c8e60 authored by Steven Wittens's avatar Steven Wittens

#148678: Fix notices/warnings on invalid paths like 'node/zzz'. (chx/pwolanin/webernet)

parent b1d45297
......@@ -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);
......
......@@ -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.
......
......@@ -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') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment