From ce474a1cd184f6a4e7441a1aba0a7f10eae06634 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 20 Jun 2022 08:56:56 -0600 Subject: [PATCH] Fix IDE reformatting of templates could cause template mangler to discard attributes that were reflowed to a new line --- api/etemplate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/etemplate.php b/api/etemplate.php index 440a5c91c4..90e086cc99 100644 --- a/api/etemplate.php +++ b/api/etemplate.php @@ -180,7 +180,7 @@ function send_template() // handling of select and taglist widget, incl. removing of type attribute $str = preg_replace_callback('#<(select|taglist)(-[^ ]+)? ([^>]+?)(/|>(.*?)#s', static function (array $matches) { - preg_match_all('/(^| )([a-z0-9_-]+)="([^"]*)"/i', $matches[3], $attrs, PREG_PATTERN_ORDER); + preg_match_all('/(^|\s)([a-z0-9_-]+)="([^"]*)"/i', $matches[3], $attrs, PREG_PATTERN_ORDER); $attrs = array_combine($attrs[2], $attrs[3]); if (isset($attrs['tags']))