Return directly if user doesn't have access (#10730)

This commit is contained in:
Jellyfrog
2019-10-21 19:04:23 +02:00
committed by Tony Murray
parent 186059de54
commit d3994b3671

View File

@@ -46,6 +46,10 @@ class Url
*/
public static function deviceLink($device, $text = null, $vars = [], $start = 0, $end = 0, $escape_text = 1, $overlib = 1)
{
if (!$device->canAccess(Auth::user())) {
return $device->displayName();
}
if (!$start) {
$start = Carbon::now()->subDay(1)->timestamp;
}
@@ -107,11 +111,7 @@ class Url
$link = Url::overlibLink($url, $text, $contents, $class);
}
if ($device->canAccess(Auth::user())) {
return $link;
} else {
return $device->displayName();
}
return $link;
}
/**