dachcom-digital / pimcore-formbuilder

Pimcore Formbuilder - create forms easily!
Other
92 stars 47 forks source link

fix: Use less greedy placeholder regex to not match with pimcore native placeholders. #386

Closed das-peter closed 1 year ago

das-peter commented 1 year ago
Q A
Branch? 3.x for bug fixes
Bug fix? yes
New feature? no
BC breaks? unlikely
Deprecations? no
Fixed tickets

Fix for placeholder matching leading to unexpected replacements. E.g. %field_2052% %DataObject(user,{"method" : "getName"}); %DataObject(user,{"method" : "getFirstName"}); would be processed to: MyFieldValue DataObject(user,{"method" : "getFirstName"});

Because the regexp currently matches:

Disallowing ; in the placeholder match should fix that while being more likely fully backward compatible than disallowing spaces or other chars. I consider it unlikely that someone has a ; in a field name or in a somehow manually injected data entry.

solverat commented 1 year ago

Nice one @das-peter, thanks!