From f445ed47df9d706cb0cfb3d24f1c967f9ae86658 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Fri, 14 Sep 2012 18:22:56 -0600 Subject: [PATCH 1/2] fix permissions for uploaded images with size specified --- mod/item.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/item.php b/mod/item.php index 52ea9d58c9..8fe1c05c12 100644 --- a/mod/item.php +++ b/mod/item.php @@ -373,8 +373,8 @@ function item_post(&$a) { $match = null; - if((! $preview) && preg_match_all("/\[img\](.*?)\[\/img\]/",$body,$match)) { - $images = $match[1]; + if((! $preview) && preg_match_all("/\[img([\=0-9x]*)\](.*?)\[\/img\]/",$body,$match)) { + $images = $match[2]; if(count($images)) { foreach($images as $image) { if(! stristr($image,$a->get_baseurl() . '/photo/')) From 8a4dcc28c1e3a0bdb5b8b4fa971ff48cf3e0fb75 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Fri, 14 Sep 2012 18:33:07 -0600 Subject: [PATCH 2/2] make size search less greedy --- mod/item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/item.php b/mod/item.php index 8fe1c05c12..7d36d7f70a 100644 --- a/mod/item.php +++ b/mod/item.php @@ -373,7 +373,7 @@ function item_post(&$a) { $match = null; - if((! $preview) && preg_match_all("/\[img([\=0-9x]*)\](.*?)\[\/img\]/",$body,$match)) { + if((! $preview) && preg_match_all("/\[img([\=0-9x]*?)\](.*?)\[\/img\]/",$body,$match)) { $images = $match[2]; if(count($images)) { foreach($images as $image) {