From 83256c9ccd2cf3cff74ac10c0ea8e46cb9f77aca Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 12 Feb 2020 14:17:28 -0800 Subject: issue with multi-line poll elements --- Zotlabs/Module/Item.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index dbcbe5d22..4b866eace 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -1414,7 +1414,7 @@ class Item extends Controller { $matches = null; $obj['type'] = 'Question'; - if (preg_match_all('/\[answer\](.*?)\[\/answer\]/',$body,$matches,PREG_SET_ORDER)) { + if (preg_match_all('/\[answer\](.*?)\[\/answer\]/ism',$body,$matches,PREG_SET_ORDER)) { foreach ($matches as $match) { $ptr[] = [ 'name' => $match[1], 'type' => 'Note', 'replies' => [ 'type' => 'Collection', 'totalItems' => 0 ]]; $body = str_replace('[answer]' . $match[1] . '[/answer]', EMPTY_STR, $body); @@ -1423,7 +1423,7 @@ class Item extends Controller { $matches = null; - if (preg_match('/\[question\](.*?)\[\/question\]/',$body,$matches)) { + if (preg_match('/\[question\](.*?)\[\/question\]/ism',$body,$matches)) { $obj['content'] = bbcode($matches[1]); $body = str_replace('[question]' . $matches[1] . '[/question]', $matches[1], $body); $obj['oneOf'] = $ptr; @@ -1431,7 +1431,7 @@ class Item extends Controller { $matches = null; - if (preg_match('/\[question=multiple\](.*?)\[\/question\]/',$body,$matches)) { + if (preg_match('/\[question=multiple\](.*?)\[\/question\]/ism',$body,$matches)) { $obj['content'] = bbcode($matches[1]); $body = str_replace('[question=multiple]' . $matches[1] . '[/question]', $matches[1], $body); $obj['anyOf'] = $ptr; @@ -1439,7 +1439,7 @@ class Item extends Controller { $matches = null; - if (preg_match('/\[ends\](.*?)\[\/ends\]/',$body,$matches)) { + if (preg_match('/\[ends\](.*?)\[\/ends\]/ism',$body,$matches)) { $obj['endTime'] = datetime_convert(date_default_timezone_get(),'UTC', $matches[1],ATOM_TIME); $body = str_replace('[ends]' . $matches[1] . '[/ends]', EMPTY_STR, $body); } -- cgit v1.2.3