Skip to content

Commit 1cf1825

Browse files
authored
Merge pull request #1459 from mambax7/feature/fix_textsanitizer_preg_replace_for_color_size
Fix for #1458
2 parents a31cfb7 + b458fae commit 1cf1825

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

htdocs/class/module.textsanitizer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,9 @@ public function &xoopsCodeDecode(&$text, $allowimage = 1)
367367
$replacements[] = '<a href="\\2" rel="external" title="">\\3</a>';
368368
$patterns[] = "/\[url=(['\"]?)([^'\"<>]*)\\1](.*)\[\/url\]/sU";
369369
$replacements[] = '<a href="http://\\2" rel="noopener external" title="">\\3</a>';
370-
$patterns[] = "/\[color=(['\"]?)([a-zA-Z0-9#]*)\\1](.*)\[\/color\]/sU";
371-
$replacements[] = '<span style="color: \\2;">\\3</span>';
372-
$patterns[] = "/\[size=(['\"]?)([a-zA-Z0-9.#]*)\\1](.*)\[\/size\]/sU";
370+
$patterns[] = "/\[color=(['\"]?)([a-zA-Z0-9#]+)\\1?](.*)\[\/color\]/sU";
371+
$replacements[] = '<span style="color: #\\2;">\\3</span>';
372+
$patterns[] = "/\[size=(['\"]?)([a-zA-Z0-9-]+)\\1?](.*)\[\/size\]/sU";
373373
$replacements[] = '<span style="font-size: \\2;">\\3</span>';
374374
$patterns[] = "/\[font=(['\"]?)([^;<>\*\(\)\"']*)\\1](.*)\[\/font\]/sU";
375375
$replacements[] = '<span style="font-family: \\2;">\\3</span>';

0 commit comments

Comments
 (0)