docs: Properly quote self uri in search.php

This removes the classical XSS vulnerability of using unquoted
PHP_SELF.

Reported-by: John Lightsey <john@nixnuts.net>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2017-07-10 11:47:49 +02:00
parent ccac446545
commit f27dd53402

View File

@ -12,7 +12,7 @@
$querystr = htmlspecialchars($query, ENT_QUOTES, 'UTF-8');
?>
<form action="<?php echo $_SERVER['PHP_SELF'], "?query=", rawurlencode($query) ?>"
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), "?query=", rawurlencode($query) ?>"
enctype="application/x-www-form-urlencoded" method="get">
<input name="query" type="text" size="50" value="<?php echo $querystr ?>"/>
<select name="scope">