Merge pull request #7748 from MrPetovan/bug/7747-fix-mod-item-url-regex

Prevent empty [url] label regular expression to break image insertion
This commit is contained in:
Michael Vogel 2019-10-16 20:38:15 +02:00 committed by GitHub
commit 24289fb004
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View 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'];