Skip to content

Commit

Permalink
Fix potential html injection in HTTP_USER_AGENT in example forms
Browse files Browse the repository at this point in the history
  • Loading branch information
dapphp committed Nov 21, 2017
1 parent 064bb36 commit 2c7ce3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example_form.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function process_si_contact_form()
. "<pre>$message</pre>"
. "<br /><br />IP Address: {$_SERVER['REMOTE_ADDR']}<br />"
. "Time: $time<br />"
. "Browser: {$_SERVER['HTTP_USER_AGENT']}<br />";
. "Browser: " . htmlspecialchars($_SERVER['HTTP_USER_AGENT']) . "<br />";

if (isset($GLOBALS['DEBUG_MODE']) && $GLOBALS['DEBUG_MODE'] == false) {
// send the message with mail()
Expand Down
2 changes: 1 addition & 1 deletion example_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function process_si_contact_form()
. "<pre>$message</pre>"
. "<br /><br /><em>IP Address:</em> {$_SERVER['REMOTE_ADDR']}<br />"
. "<em>Time:</em> $time<br />"
. "<em>Browser:</em> {$_SERVER['HTTP_USER_AGENT']}<br />";
. "<em>Browser:</em> " . htmlspecialchars($_SERVER['HTTP_USER_AGENT']) . "<br />";

$message = wordwrap($message, 70);

Expand Down

0 comments on commit 2c7ce3f

Please sign in to comment.