Increase specificity of [url][img] capture regex in BBCode::getAttachedData
- Prevents it from over capturing when there's a [url] tag before the image
This commit is contained in:
parent
16acf1db95
commit
d2ca5ccd35
1 changed files with 1 additions and 1 deletions
|
@ -273,7 +273,7 @@ class BBCode
|
||||||
$body = preg_replace("/\[img\=(.*?)\](.*?)\[\/img\]/ism", '[img]$1[/img]', $body);
|
$body = preg_replace("/\[img\=(.*?)\](.*?)\[\/img\]/ism", '[img]$1[/img]', $body);
|
||||||
$post['text'] = $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 ((count($pictures) == 1) && !$has_title) {
|
||||||
if (!empty($item['object-type']) && ($item['object-type'] == Activity\ObjectType::IMAGE)) {
|
if (!empty($item['object-type']) && ($item['object-type'] == Activity\ObjectType::IMAGE)) {
|
||||||
// Replace the preview picture with the real picture
|
// Replace the preview picture with the real picture
|
||||||
|
|
Loading…
Reference in a new issue