diff --git a/api/etemplate.php b/api/etemplate.php
index e8bce13fb1..b061bfefe7 100644
--- a/api/etemplate.php
+++ b/api/etemplate.php
@@ -13,7 +13,7 @@
use EGroupware\Api;
// add et2- prefix to following widgets/tags, if NO -->
- $str = preg_replace_callback('##u', function ($matches) use ($name) {
+ $str = preg_replace_callback('##s', function ($matches) use ($name) {
$tag = 'et2-button';
- preg_match_all('/(^| )([a-z0-9_-]+)="([^"]+)"/i', $matches[2], $attrs, PREG_PATTERN_ORDER);
+ preg_match_all('/(^|\s)([a-z0-9_-]+)="([^"]+)"/i', $matches[2], $attrs, PREG_PATTERN_ORDER);
$attrs = array_combine($attrs[2], $attrs[3]);
// replace buttononly tag with noSubmit="true" attribute
if (!empty($matches[1]))