Quiz
Why are these examples of dangerous code?
Heine — Thu, 09/10/2008 - 09:35
Just think about it for a minute before jumping to someone, who has the first one right or Gordon, who nails them both.
Example I
function example_one($nid) {
// Lots of code
$node = node_load($nid);
// ...
$user = user_load(array('uid' => $node->uid));
}
// Lots of code
$node = node_load($nid);
// ...
$user = user_load(array('uid' => $node->uid));
}
Example II
function example_two($account) {
// ...
$account = user_load(array('uid' => $uid));
}
// ...
$account = user_load(array('uid' => $uid));
}