1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 02:04:35 +02:00

Fix issue in InputfieldRepeater where entity encoded quotes could get confused as hex color codes for repeater item colors feature

This commit is contained in:
Ryan Cramer
2022-03-06 09:10:34 -05:00
parent 1dc0f0e524
commit 8b46cb6fd0

View File

@@ -477,7 +477,7 @@ class InputfieldRepeater extends Inputfield implements InputfieldItemList {
$wrapLabel = str_replace($matches[0], '', $wrapLabel); $wrapLabel = str_replace($matches[0], '', $wrapLabel);
$wrapIcon = $matches[1]; $wrapIcon = $matches[1];
} }
if(strpos($wrapLabel, '#') !== false && preg_match('/#([0-9a-fA-F]{3,})/', $wrapLabel, $matches)) { if(strpos($wrapLabel, '#') !== false && preg_match('/(?<!&)#([0-9a-fA-F]{3,})/', $wrapLabel, $matches)) {
// background-color definition // background-color definition
if(strlen($matches[1]) === 3 || strlen($matches[1]) === 6) { if(strlen($matches[1]) === 3 || strlen($matches[1]) === 6) {
$wrapLabel = str_replace($matches[0], '', $wrapLabel); $wrapLabel = str_replace($matches[0], '', $wrapLabel);