Browse Source

Merge pull request #4758 from annando/fix-regexp

Fixes warning "missing terminating ] for character class"
pull/4761/head
Tobias Diekershoff 4 years ago
committed by GitHub
parent
commit
f0590145b9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/Content/Text/BBCode.php

3
src/Content/Text/BBCode.php

@ -242,9 +242,10 @@ class BBCode extends BaseObject
// Simplify image codes
$body = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $body);
$URLSearchString = "^\[\]";
$body = preg_replace("/\[img\=([$URLSearchString]*)\](.*?)\[\/img\]/ism", '[img]$1[/img]', $body);
$URLSearchString = "^\[\]";
if (preg_match_all("(\[url=([$URLSearchString]*)\]\s*\[img\]([$URLSearchString]*)\[\/img\]\s*\[\/url\])ism", $body, $pictures, PREG_SET_ORDER)) {
if ((count($pictures) == 1) && !$has_title) {
// Checking, if the link goes to a picture

Loading…
Cancel
Save