XOOPS / XoopsCore25

XOOPS Core 2.5.x (current release is 2.5.11: https://github.com/XOOPS/XoopsCore25/releases)
GNU General Public License v2.0
71 stars 59 forks source link

Fix for https://github.com/XOOPS/XoopsCore25/issues/1458 #1459

Closed mambax7 closed 7 months ago

mambax7 commented 7 months ago

Color pattern: Problem: The pattern /\[color=(['\"]?)([a-zA-Z0-9#]*)\\1](.*)\[\/color\]/sU is expecting the color value to be enclosed in either single quotes or double quotes, but the example [color=009900] doesn't have any quotes. Solution: We remove the quote capturing group and make it optional: /\[color=(['\"]?)([a-zA-Z0-9#]+)\\1?](.*)\[\/color\]/sU

Size pattern: Problem: The pattern /\[size=(['\"]?)([a-zA-Z0-9.#]*)\\1](.*)\[\/size\]/sU is allowing dot (.) and hash (#) characters in the size value, which are not valid for font sizes. Solution: We remove the dot (.) and hash (#) characters from the size value capturing group: /\[size=(['\"]?)([a-zA-Z0-9-]+)\\1?](.*)\[\/size\]/sU

The updated patterns make the quotes optional by using \\1? instead of \\1. This allows the color and size values to be specified with or without quotes.