With PHP < 5.5, this results in an error:
//Determine if it's a user or node
$node = isset($form_state['node']) && !empty($user = is_object($form_state['node']));
$user = isset($form_state['user']) && is_object($form_state['user']) && !empty($form_state['user']);
Because empty() only supports variables. Also, $user is being set and then being reassigned on the next line.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | errors-when-checking-user-or-node-2869154-4.patch | 689 bytes | kevinwalsh |
Comments
Comment #2
generalconsensus commentedThanks for the bug report, will look into this week!
Comment #3
kevinwalsh commentedComment #4
kevinwalsh commentedThis resolves the errors on php 5.4.x and below, and removes a redundant isset().
Comment #6
generalconsensus commentedThanks for patch, committed!