sforkowany z mirror/friendica
Merge pull request #8272 from MrPetovan/bug/8254-regex-url-img
Increase specificity of [url][img] capture regex in BBCode::getAttachedData2022.09-rc
commit
01640a7045
|
@ -289,7 +289,7 @@ class BBCode
|
|||
$body = preg_replace("/\[img\=(.*?)\](.*?)\[\/img\]/ism", '[img]$1[/img]', $body);
|
||||
$post['text'] = $body;
|
||||
|
||||
if (preg_match_all("(\[url=(.*?)\]\s*\[img\](.*?)\[\/img\]\s*\[\/url\])ism", $body, $pictures, PREG_SET_ORDER)) {
|
||||
if (preg_match_all("#\[url=([^\]]+?)\]\s*\[img\]([^\[]+?)\[/img\]\s*\[/url\]#ism", $body, $pictures, PREG_SET_ORDER)) {
|
||||
if ((count($pictures) == 1) && !$has_title) {
|
||||
if (!empty($item['object-type']) && ($item['object-type'] == Activity\ObjectType::IMAGE)) {
|
||||
// Replace the preview picture with the real picture
|
||||
|
|
Ładowanie…
Reference in New Issue