Browse Source

Protect pictures URL in Posts to prevent to load large images as thumbnails

pull/477/head
Timothée Jaussoin 8 years ago
parent
commit
63a616b51c
  1. 8
      app/helpers/UtilsHelper.php
  2. 2
      app/models/postn/Postn.php

8
app/helpers/UtilsHelper.php

@ -618,6 +618,14 @@ function getSmileyPath($id)
return BASE_URI.'/themes/material/img/emojis/svg/'.$id.'.svg';
}
/*
* @desc Protect a picture URL by using the internal Proxy
*/
function protectPicture($url)
{
return \Movim\Route::urlize('picture', urlencode($url));
}
/*
* @desc Translate something
*/

2
app/models/postn/Postn.php

@ -322,7 +322,7 @@ class Postn extends Model
&& isset($enc['type'])
&& typeIsPicture($enc['type'])
/*&& isSmallPicture($enc['href'])*/) {
$this->picture = $enc['href'];
$this->picture = protectPicture($enc['href']);
}
if($enc['rel'] == 'alternate'

Loading…
Cancel
Save