Skip to content

Commit 6113d30

Browse files
committed
SW-17487 - Improve Form Input Filtering
This issue has been identified by Markus Seegmüller on behalf of Internetmenschen UG (https://www.internetmenschen.de).
1 parent 9276814 commit 6113d30

File tree

1 file changed

+4
-2
lines changed
  • engine/Shopware/Controllers/Frontend

1 file changed

+4
-2
lines changed

engine/Shopware/Controllers/Frontend/Forms.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,11 @@ protected function _createInputElement($element, $post = null)
498498
*/
499499
protected function _filterInput($input)
500500
{
501-
$pattern = '#{\s*/literal\s*}#i';
501+
// remove all control characters, unassigned, private use, formatting and surrogate code points
502+
$input = preg_replace('#[^\PC\s]#u', '', $input);
502503

503-
if (preg_match($pattern, $input) > 0) {
504+
$temp = str_replace('"', '', $input);
505+
if (preg_match('#{\s*/*literal\s*}#i', $temp) > 0) {
504506
return '';
505507
}
506508

0 commit comments

Comments
 (0)