From dd374eaebfd6452f3a4a184efdb3a531aec88130 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 24 May 2019 07:57:46 +0000 Subject: [PATCH 1/2] get channel from photo uid (cherry picked from commit 9ea483d1dc01fa9439e6f261d04f1b97fb1302a3) --- Zotlabs/Photo/PhotoDriver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Photo/PhotoDriver.php b/Zotlabs/Photo/PhotoDriver.php index bacf926ff..146ef0ae4 100644 --- a/Zotlabs/Photo/PhotoDriver.php +++ b/Zotlabs/Photo/PhotoDriver.php @@ -509,7 +509,7 @@ abstract class PhotoDriver { $arr['imgscale'] = $scale; if(boolval(get_config('system','filesystem_storage_thumbnails', 0)) && $scale > 0) { - $channel = \App::get_channel(); + $channel = channelx_by_n($arr['uid']); $arr['os_storage'] = 1; $arr['os_syspath'] = 'store/' . $channel['channel_address'] . '/' . $arr['os_path'] . '-' . $scale; if(! $this->saveImage($arr['os_syspath'])) From 385be35ed56a4dfffb0cd2fabdb094bd26535b86 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 24 May 2019 08:27:45 +0000 Subject: [PATCH 2/2] fix #1374 (cherry picked from commit 528b9b6a60d847b0ecb639cb7fb8e01ee79b11d4) --- include/markdown.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/markdown.php b/include/markdown.php index 2513a7d77..7d1f16958 100644 --- a/include/markdown.php +++ b/include/markdown.php @@ -76,6 +76,8 @@ function markdown_to_bb($s, $use_zrl = false, $options = []) { $s = html2bbcode($s); + $s = bb_code_protect($s); + // Convert everything that looks like a link to a link if($use_zrl) { if (strpos($s,'[/img]') !== false) { @@ -88,6 +90,8 @@ function markdown_to_bb($s, $use_zrl = false, $options = []) { $s = preg_replace("/([^\]\=\{\/]|^)(https?\:\/\/)([a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@\(\)]+)/ismu", '$1[url=$2$3]$2$3[/url]',$s); } + $s = bb_code_unprotect($s); + // remove duplicate adjacent code tags $s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s);