Escape request and database values in forms and links.
Add form_value() in html.lib.php.
This commit is contained in:
+9
-9
@@ -32,10 +32,10 @@ function sort_options($link) {
|
||||
array_push($options, $display);
|
||||
} else {
|
||||
$href = '<a href="'.$link.'?sort='.$sort_key.'&order='.$order_key;
|
||||
if (isset($_GET['queue'])) $href .= '&queue='.$_GET['queue'];
|
||||
if (isset($_GET['queue'])) $href .= '&queue='.($queue ? 1 : 0);
|
||||
if (isset($_GET['search'])) $href .= '&search='.urlencode((string)$search);
|
||||
if (isset($_GET['start'])) $href .= '&start='.$start;
|
||||
if (isset($_GET['show'])) $href .= '&show='.$show;
|
||||
if (isset($_GET['start'])) $href .= '&start='.(int)$start;
|
||||
if (isset($_GET['show'])) $href .= '&show='.(int)$show;
|
||||
$href .= '">'.$display.'</a>';
|
||||
|
||||
array_push($options, $href);
|
||||
@@ -69,13 +69,13 @@ function get_pager() {
|
||||
// Are there later stories? Go backwards to them
|
||||
$string .= '<span class="next">';
|
||||
if ($start > 0) {
|
||||
$string .= "\n".'<a href="'.$link.'?start='.$next;
|
||||
$string .= "\n".'<a href="'.$link.'?start='.(int)$next;
|
||||
if (isset($_GET['queue'])) $string .= '&queue='.$queue_url;
|
||||
if (isset($_GET['search'])) $string .= '&search='.urlencode((string)$search);
|
||||
if (isset($_GET['show'])) $string .= '&show='.$show;
|
||||
if (isset($_GET['show'])) $string .= '&show='.(int)$show;
|
||||
if (isset($_GET['sort'])) $string .= '&sort='.$sort;
|
||||
if (isset($_GET['order'])) $string .= '&order='.$order;
|
||||
$articles = ($show == 1) ? "article" : ($nw ? $nw->toWords($show) : $show)." articles";
|
||||
$articles = ($show == 1) ? "article" : ($nw ? $nw->toWords((int)$show) : (int)$show)." articles";
|
||||
$string .= '">« Next '.$articles.'</a>';
|
||||
}
|
||||
$string .= "</span>\n";
|
||||
@@ -83,13 +83,13 @@ function get_pager() {
|
||||
// Are there earlier stories? Go forwards to them
|
||||
$string .= "\n".'<span class="prev">';
|
||||
if ($prev < get_count()) {
|
||||
$string .= "\n".'<a href="'.$link.'?start='.$prev;
|
||||
$string .= "\n".'<a href="'.$link.'?start='.(int)$prev;
|
||||
if (isset($_GET['queue'])) $string .= '&queue='.$queue_url;
|
||||
if (isset($_GET['search'])) $string .= '&search='.urlencode((string)$search);
|
||||
if (isset($_GET['show'])) $string .= '&show='.$show;
|
||||
if (isset($_GET['show'])) $string .= '&show='.(int)$show;
|
||||
if (isset($_GET['sort'])) $string .= '&sort='.$sort;
|
||||
if (isset($_GET['order'])) $string .= '&order='.$order;
|
||||
$articles = ($show == 1) ? "article" : ($nw ? $nw->toWords($show) : $show)." articles";
|
||||
$articles = ($show == 1) ? "article" : ($nw ? $nw->toWords((int)$show) : (int)$show)." articles";
|
||||
$string .= '">Previous '.$articles.' »</a>';
|
||||
}
|
||||
$string .= "</span>\n";
|
||||
|
||||
Reference in New Issue
Block a user