Skip to content

Commit

Permalink
Fix compatibility issue with Contao 4.11.7
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Aug 11, 2021
1 parent 189836e commit 6609546
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/FrontendHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -914,10 +914,10 @@ protected static function insertData($content, $data)
$matches[0] = preg_replace('(\\sdata-frontend-helper="([^"]*)")is', '', $matches[0]);
}

return $matches[0] . ' data-frontend-helper="' . htmlspecialchars(json_encode($data)) . '"' . $content;
return $matches[0] . ' data-frontend-helper="' . str_replace(['{', '}'], ['{', '}'], htmlspecialchars(json_encode($data))) . '"' . $content;
}

return '<span class="rsfh-dummy" data-frontend-helper="' . htmlspecialchars(json_encode($data)) . '"></span>' . $content;
return '<span class="rsfh-dummy" data-frontend-helper="' . str_replace(['{', '}'], ['&#123;', '&#125;'], htmlspecialchars(json_encode($data))) . '"></span>' . $content;
}

/**
Expand Down

0 comments on commit 6609546

Please sign in to comment.