mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-08-18 20:30:09 +02:00
wp-fdroid: Properly escape fdfilter
Resolves an XSS issue identified by Cure53 (https://cure53.de)
This commit is contained in:
parent
7fdddb729e
commit
43ccdce0ac
@ -171,7 +171,7 @@ class FDroid
|
||||
$out.=$this->get_app($query_vars);
|
||||
} else {
|
||||
$out.='<form name="searchform" action="" method="get">';
|
||||
$out.='<p><input name="fdfilter" type="text" value="'.$query_vars['fdfilter'].'" size="30"> ';
|
||||
$out.='<p><input name="fdfilter" type="text" value="'.esc_attr($query_vars['fdfilter']).'" size="30"> ';
|
||||
$out.='<input type="hidden" name="fdpage" value="1">';
|
||||
$out.='<input type="submit" value="Search"></p>';
|
||||
$out.=$this->makeformdata($query_vars);
|
||||
@ -690,7 +690,7 @@ class FDroid
|
||||
$out.='</form>'."\n";
|
||||
}
|
||||
else {
|
||||
$out.='Applications matching "'.$query_vars['fdfilter'].'"';
|
||||
$out.='Applications matching "'.esc_attr($query_vars['fdfilter']).'"';
|
||||
}
|
||||
$out.="</div>";
|
||||
|
||||
@ -749,7 +749,7 @@ class FDroid
|
||||
$out.='<input type="hidden" name="page_id" value="'.(int)get_query_var('page_id').'">';
|
||||
foreach($query_vars as $name => $value) {
|
||||
if($value !== null && $name != 'fdfilter' && $name != 'fdpage')
|
||||
$out.='<input type="hidden" name="'.$name.'" value="'.sanitize_text_field($value).'">';
|
||||
$out.='<input type="hidden" name="'.esc_attr($name).'" value="'.esc_attr($value).'">';
|
||||
}
|
||||
|
||||
return $out;
|
||||
|
Loading…
Reference in New Issue
Block a user