issue #237 - when manually changing an uploaded photo URL in a post to an invalid URL that happens to not throw an error, it affects the ability to parse the URL to see if it's a local image and correct permissions. The correct way to do this is to change the '-2' to '-1' if you want 640 instead of 320 and '-0' if you want the original size - which is not likely to win you many friends if it happens to be a 42 megapixel photo. We might have limits in place to prevent monster photos from destroying everybody's streams, but many services you export the post to will probably not.

This commit is contained in:
friendica 2013-12-10 20:48:54 -08:00
parent e5ea4a009b
commit 5279f3bf6f

View File

@ -1049,7 +1049,10 @@ function fix_attached_photo_permissions($uid,$xchan_hash,$body,
if(! stristr($image,get_app()->get_baseurl() . '/photo/'))
continue;
$image_uri = substr($image,strrpos($image,'/') + 1);
$image_uri = substr($image_uri,0, strpos($image_uri,'-'));
if(strpos($image_uri,'-') !== false)
$image_uri = substr($image_uri,0, strpos($image_uri,'-'));
if(strpos($image_uri,'.') !== false)
$image_uri = substr($image_uri,0, strpos($image_uri,'.'));
if(! strlen($image_uri))
continue;
$srch = '<' . $xchan_hash . '>';