]> git.mxchange.org Git - friendica.git/commitdiff
Prevent empty [url] label regular expression to break image insertion
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 16 Oct 2019 17:53:16 +0000 (13:53 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 16 Oct 2019 17:53:16 +0000 (13:53 -0400)
mod/item.php

index 77f23fee8d24d4b72c70f0b74051934d19ee128d..7c8ebee4abfdf5e3ae5c8271b394bd8bf4d0147e 100644 (file)
@@ -230,7 +230,7 @@ function item_post(App $a) {
        }
 
        // Convert links with empty descriptions to links without an explicit description
-       $body = preg_replace('(\[url=(.*?)\]\[\/url\])ism', '[url]$1[/url]', $body);
+       $body = preg_replace('#\[url=([^\]]*?)\]\[/url\]#ism', '[url]$1[/url]', $body);
 
        if (!empty($orig_post)) {
                $str_group_allow   = $orig_post['allow_gid'];