의 미러
https://github.com/friendica/friendica
synced 2025-09-07 21:21:52 +02:00
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:
부모
16acf1db95
커밋
d2ca5ccd35
1개의 변경된 파일과 1개의 추가작업 그리고 1개의 파일을 삭제
|
@ -273,7 +273,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
|
||||
|
|
불러오는 중…
테이블 추가
Add a link
Reference in a new issue