Redirect activity permalinks to home URL when activity user_id = 0

This prevents harmful redirect loops when plugins add activity items that are
not associated with a specific user or group, which means that BP has no
template-loading function.

Fixes #4971

git-svn-id: https://buddypress.svn.wordpress.org/trunk@6980 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Coding standards in bp_activity_action_permalink_router()

git-svn-id: https://buddypress.svn.wordpress.org/trunk@6981 cdf35c40-ae34-48e0-9cc9-0c9da1808c22