Skip to content

Commit ac84b7b

Browse files
author
Raymond Benc
committed
fix #359
1 parent d58b012 commit ac84b7b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

PF.Base/include/library/phpfox/search/search.class.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,22 +468,31 @@ public function set($aParams)
468468
}
469469
}
470470

471+
// d($params); exit;
472+
471473
$hidden .= '<input type="hidden" name="s" value="1">';
472474
if (isset($this->_aSearchTool['search']['hidden'])) {
473-
$hidden = $this->_aSearchTool['search']['hidden'];
475+
$hidden .= $this->_aSearchTool['search']['hidden'];
474476
}
475477

478+
$cache = [];
476479
foreach ($params as $param) {
477480
$part = explode('=', $param);
478481
if (!isset($part[1])) {
479482
$part[1] = '';
480483
}
481484

485+
if (isset($cache[$part[0]]) || $part[0] == 's' || $part[0] == 'search[search]') {
486+
continue;
487+
}
488+
482489
$part[1] = htmlspecialchars($part[1]);
483490
if (substr($part[0], 0, 7) == 'http://' || substr($part[0], 0, 8) == 'https://') {
484491
continue;
485492
}
486493

494+
$cache[$part[0]] = true;
495+
487496
$hidden .= '<input type="hidden" name="' . $part[0] . '" value="' . $part[1] . '">';
488497
}
489498

PF.Base/module/pages/include/component/controller/index.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ public function process()
194194
$aPages = [];
195195
$aCategories = [];
196196
$bShowCategories = false;
197+
if ($this->search()->isSearch()) {
198+
$bIsValidCategory = true;
199+
}
200+
197201
if ($bIsValidCategory) {
198202
$this->search()->browse()->params($aBrowseParams)->execute();
199203
$aPages = $this->search()->browse()->getRows();

0 commit comments

Comments
 (0)