aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-12-10 20:48:54 -0800
committerfriendica <info@friendica.com>2013-12-10 20:48:54 -0800
commit5279f3bf6f0a61ed925e91016e27cd345e0c8b75 (patch)
treeecc49f0f2a7f166aae669b64ea7795b6377005be
parente5ea4a009b81c7f3fa987ba34d20a996055775d6 (diff)
downloadvolse-hubzilla-5279f3bf6f0a61ed925e91016e27cd345e0c8b75.tar.gz
volse-hubzilla-5279f3bf6f0a61ed925e91016e27cd345e0c8b75.tar.bz2
volse-hubzilla-5279f3bf6f0a61ed925e91016e27cd345e0c8b75.zip
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.
-rw-r--r--mod/item.php5
1 files changed, 4 insertions, 1 deletions
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 . '>';