forked from GNUsocial/gnu-social
Tidying up getUser calls to profiles and some events
getUser calls are much more strict, and one place where this was found was in the (un)subscribe start/end event handlers, which resulted in making the Subscription class a bit stricter, regarding ::start and ::cancel at least. Several minor fixes in many files were made due to this. This does NOT touch the Foreign_link function, which should also have a more strict getUser call. That is a future project.
This commit is contained in:
@@ -158,9 +158,10 @@ class Blog_entry extends Managed_DataObject
|
||||
// Use user's preferences for short URLs, if possible
|
||||
|
||||
try {
|
||||
$user = $profile->getUser();
|
||||
$shortUrl = File_redirection::makeShort($url,
|
||||
empty($user) ? null : $user);
|
||||
$user = $profile->isLocal()
|
||||
? $profile->getUser()
|
||||
: null;
|
||||
$shortUrl = File_redirection::makeShort($url, $user);
|
||||
} catch (Exception $e) {
|
||||
// Don't let this stop us.
|
||||
$shortUrl = $url;
|
||||
|
Reference in New Issue
Block a user