Bugfix: Page switching had a problem with the search. And automatic reloading hadn't worked with some search terms

This commit is contained in:
Michael Vogel 2013-12-08 20:10:28 +01:00
parent bae844e367
commit d20d2f74ae
3 changed files with 16 additions and 10 deletions

View file

@ -278,6 +278,12 @@ function paginate_data(&$a, $count=null) {
$stripped = str_replace('q=','',$stripped); $stripped = str_replace('q=','',$stripped);
$stripped = trim($stripped,'/'); $stripped = trim($stripped,'/');
$pagenum = $a->pager['page']; $pagenum = $a->pager['page'];
if (!strstr($stripped, "?")) {
$pos = strpos($stripped, "&");
$stripped = substr($stripped, 0, $pos)."?".substr($stripped, $pos + 1);
}
$url = $a->get_baseurl() . '/' . $stripped; $url = $a->get_baseurl() . '/' . $stripped;

View file

@ -471,7 +471,7 @@ if ($_GET["mode"] == "raw") {
foreach ($_GET AS $param => $value) foreach ($_GET AS $param => $value)
if (($param != "page") AND ($param != "q")) if (($param != "page") AND ($param != "q"))
$reload_uri .= "&".$param."=".$value; $reload_uri .= "&".$param."=".urlencode($value);
$a->page['htmlhead'] .= <<< EOT $a->page['htmlhead'] .= <<< EOT
<script type="text/javascript"> <script type="text/javascript">