From 5279f3bf6f0a61ed925e91016e27cd345e0c8b75 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 10 Dec 2013 20:48:54 -0800 Subject: 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. --- mod/item.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mod/item.php') diff --git a/mod/item.php b/mod/item.php index 6781eba2d..7f881d28d 100644 --- a/mod/item.php +++ b/mod/item.php @@ -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 . '>'; -- cgit v1.2.3