mirror of
https://github.com/friendica/friendica
synced 2025-04-27 21:50:11 +00:00
Sensitive previews are now blurred
This commit is contained in:
parent
9b4ade4542
commit
0a6dff0618
3 changed files with 31 additions and 20 deletions
|
@ -177,15 +177,20 @@ class PostMedia extends BaseEntity
|
|||
/**
|
||||
* Get preview path for given media id relative to the base URL
|
||||
*
|
||||
* @param string $size One of the Proxy::SIZE_* constants
|
||||
* @param string $size One of the Proxy::SIZE_* constants
|
||||
* @param bool $vlurred If "true", the preview will be blurred
|
||||
* @return string preview link
|
||||
*/
|
||||
public function getPreviewPath(string $size = ''): string
|
||||
public function getPreviewPath(string $size = '', bool $blurred = false): string
|
||||
{
|
||||
return '/photo/preview/' .
|
||||
$path = '/photo/preview/' .
|
||||
(Proxy::getPixelsFromSize($size) ? Proxy::getPixelsFromSize($size) . '/' : '') .
|
||||
$this->id;
|
||||
|
||||
if ($blurred) {
|
||||
$path .= '?' . http_build_query(['blur' => true]);
|
||||
}
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue