Skip to content

Commit

Permalink
fix: support multi-line form tags
Browse files Browse the repository at this point in the history
  • Loading branch information
David Vandemaele committed Sep 22, 2021
1 parent 888e1df commit c7e7844
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Skeleton/Core/Web/Security/Csrf.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function inject(string $html): string {
$html = $application->call_event('security', 'csrf_inject', [$html]);
} else {
$html = preg_replace_callback(
'/<form\s.*>/iU',
'/<form\s.*>/siU',
function ($matches) {
return sprintf("%s\n<input name=\"%s\" type=\"hidden\" value=\"%s\" />\n", $matches[0], $this->post_token_name, $this->session_token);
},
Expand Down

0 comments on commit c7e7844

Please sign in to comment.