I would fix this error, if I could figure out exactly what the code was doing:
if (count($parts) < 1 || intval($parts[1]) == 0) {
$node = node_load($parts[1]);
if ($node == FALSE || !function_exists('uc_product_node_info') || !uc_product_is_product($node->type)) {
break;
}
}
Obviously if count($parts) < 1, then there won't be a $parts[1]. Any ideas what this should be doing?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | footer_logic.patch | 564 bytes | Island Usurper |
Comments
Comment #1
cha0s commentedThat code is seriously messed up. I don't understand how it functions right now, it's one of those freaks of nature logic blocks you see in a museum =p.
Anyways, the gist of the code makes sense, even if it was logically correct, because it's looking for a *fail* state. The part that doesn't make sense is that since the if is looking for a fail, if it passes, then the node_load is certainly incorrect. Upon passing, there should be a break, if the code gets that far, THEN the node_load should be done and tested.
The #*&$'d up part is that somehow, the code functions. *shakes head in disbelief*
Comment #2
rszrama commentedIt just looks like the second check is superfluous. Let's let Lyle weigh in on this since he wrote it. : P
Comment #3
Island Usurper commentedYeah, I don't know what I was thinking. This patch is what I meant. I hope.
Comment #4
Island Usurper commentedCommitted.