mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
squelch another prefinery error
This commit is contained in:
parent
fafc5c32ad
commit
f0232af01a
2 changed files with 21 additions and 3 deletions
|
@ -180,11 +180,18 @@ class DownloadActions extends Actions
|
|||
|
||||
$prefineryUser = Prefinery::findUser($userId);
|
||||
|
||||
preg_match('/\?r\=(\w+)/', $prefineryUser['share_link'], $matches);
|
||||
if ($prefineryUser)
|
||||
{
|
||||
preg_match('/\?r\=(\w+)/', $prefineryUser['share_link'], $matches);
|
||||
}
|
||||
else
|
||||
{
|
||||
$matches = null;
|
||||
}
|
||||
|
||||
return $vars + [
|
||||
'prefineryUser' => $prefineryUser,
|
||||
'referralCode' => $matches[1] ?: 'unknown'
|
||||
'referralCode' => $matches[1] ?? 'unknown'
|
||||
];
|
||||
}
|
||||
|
||||
|
|
13
lib/thirdparty/Prefinery.class.php
vendored
13
lib/thirdparty/Prefinery.class.php
vendored
|
@ -33,7 +33,18 @@ class Prefinery
|
|||
}
|
||||
}
|
||||
|
||||
$user = is_numeric($emailOrId) ? Prefinery::findTesterById($emailOrId) : Prefinery::findTesterByEmail($emailOrId);
|
||||
try
|
||||
{
|
||||
$user = is_numeric($emailOrId) ? Prefinery::findTesterById($emailOrId) : Prefinery::findTesterByEmail($emailOrId);
|
||||
}
|
||||
catch (PrefineryException $e)
|
||||
{
|
||||
if (stripos($e->getMessage(), 'Tester is hidden.') === false)
|
||||
{
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
if ($user)
|
||||
{
|
||||
unset($user['invitation_code']); // so we dont leak it
|
||||
|
|
Loading…
Add table
Reference in a new issue