When using HOOK_node_view() you should take care because when the search (Search API especially) is indexing, this hook is also being called. You can not rely on a user displaying the node display currently. Here's a way to ensure this...
function MYMODULE_node_view($node, $view_mode, $langcode) {
if ($view_mode != 'full' || arg(0) != 'node') {
// Skip if this is not in full view mode or the node is not displayed as is (but by search indexing for example):
return;
}
?>
Otherwise this may lead to malfunction for example if you're using drupal_goto in this hook (which should not be done by general, but perhaps there's no other way sometimes...)