browse.php, search.php, includes/corefunctions.php: further security patches...
--- a/browse.php
+++ b/browse.php
@@ -211,7 +211,7 @@
$termsList = array();
foreach($termArray as $term => $value) {
if($term == "submit" || $term == "go" || $term == "offset" || $term == "type" || ($term != "complete" && empty($value))) continue;
- $termsList[$term] = "$term=".(is_array($value) ? implode(",", array_map('htmlspecialchars', $value)) : htmlspecialchars($value, ENT_QUOTES));
+ $termsList[$term] = "$term=".(is_array($value) ? implode(",", array_map(function($v) { return htmlspecialchars($v, ENT_QUOTES); }, $value)) : htmlspecialchars($value, ENT_QUOTES));
}
$terms = "type=$type".(count($termsList) ? "&" : "").implode("&", $termsList);
// End query strings
--- a/includes/corefunctions.php
+++ b/includes/corefunctions.php
@@ -97,7 +97,7 @@
// remove any attribute starting with "on" or xmlns
- $text = preg_replace('#(<[^>]+[\\"\'\s])(on[a-z]+|xmlns)[^>]*>#iU', ">", $text);
+ $text = preg_replace('#(<[^>]+[\\"\'\s])(on[a-z]+\s*=|xmlns)[^>]*>#iU', ">", $text);
// remove javascript: and vbscript: protocol
@@ -575,7 +575,7 @@
$terms = array();
foreach($termArray as $term => $value) {
if($term == "submit" || $term == "go" || $term == "offset" || ($term != "complete" && empty($value))) continue;
- $terms[] = "$term=".(is_array($value) ? implode(",", array_map('htmlspecialchars', $value)) : htmlspecialchars($value, ENT_QUOTES));
+ $terms[] = "$term=".(is_array($value) ? implode(",", array_map(function($v) { return htmlspecialchars($v, ENT_QUOTES); }, $value)) : htmlspecialchars($value, ENT_QUOTES));
}
$terms = implode("&", $terms);
$terms .= "&";
--- a/search.php
+++ b/search.php
@@ -236,7 +236,7 @@
$termsList = array();
foreach($termArray as $term => $value) {
if($term == "submit" || $term == "wordhigh" || $term == "wordlow" || empty($value) || $term == "formname" || $term == "searchtype") continue;
- $termsList[$term] = "$term=".(is_array($value) ? implode(",", array_map('htmlspecialchars', $value)) : htmlspecialchars($value, ENT_QUOTES));
+ $termsList[$term] = "$term=".(is_array($value) ? implode(",", array_map(function($v) { return htmlspecialchars($v, ENT_QUOTES); }, $value)) : htmlspecialchars($value, ENT_QUOTES));
}
$terms = implode("&", $termsList);
if(!empty($scountquery)) {