|
From: <du...@us...> - 2013-01-03 00:17:22
|
Revision: 10635
http://sourceforge.net/p/xoops/svn/10635
Author: dugris
Date: 2013-01-03 00:17:15 +0000 (Thu, 03 Jan 2013)
Log Message:
-----------
use Xoops_Request class
Modified Paths:
--------------
XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/index.php
Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/index.php
===================================================================
--- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/index.php 2013-01-03 00:15:23 UTC (rev 10634)
+++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/index.php 2013-01-03 00:17:15 UTC (rev 10635)
@@ -23,62 +23,24 @@
include dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'mainfile.php';
-$xoops = Xoops::getInstance();
$search = Search::getInstance();
-
if (!$search->getConfig('enable_search')) {
header('Location: ' . XOOPS_URL . '/index.php');
exit();
}
-$action = "search";
-if (!empty($_GET['action'])) {
- $action = trim(strip_tags($_GET['action']));
-} else {
- if (!empty($_POST['action'])) {
- $action = trim(strip_tags($_POST['action']));
- }
-}
-$query = "";
-if (!empty($_GET['query'])) {
- $query = trim(strip_tags($_GET['query']));
-} else {
- if (!empty($_POST['query'])) {
- $query = trim(strip_tags($_POST['query']));
- }
-}
-$andor = "AND";
-if (!empty($_GET['andor'])) {
- $andor = trim(strip_tags($_GET['andor']));
-} else {
- if (!empty($_POST['andor'])) {
- $andor = trim(strip_tags($_POST['andor']));
- }
-}
-$mid = $uid = $start = 0;
-if (!empty($_GET['mid'])) {
- $mid = intval($_GET['mid']);
-} else {
- if (!empty($_POST['mid'])) {
- $mid = intval($_POST['mid']);
- }
-}
-if (!empty($_GET['uid'])) {
- $uid = intval($_GET['uid']);
-} else {
- if (!empty($_POST['uid'])) {
- $uid = intval($_POST['uid']);
- }
-}
-if (!empty($_GET['start'])) {
- $start = intval($_GET['start']);
-} else {
- if (!empty($_POST['start'])) {
- $start = intval($_POST['start']);
- }
-}
+$xoops = Xoops::getInstance();
+
+$request = Xoops_Request::getInstance();
+$action = $request->asStr('action', 'search');
+$query = $request->asStr('query', '');
+$andor = $request->asStr('query', 'AND');
+$mid = $request->asInt('mid', 0);
+$uid = $request->asInt('uid', 0);
+$start = $request->asInt('start', 0);
+$mids = $request->asArray('mids', array());
+
$queries = array();
-$mids = array();
if ($action == "results") {
if ($query == "") {
@@ -150,7 +112,6 @@
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('dirname', "('" . implode("','", array_keys($available_plugins)) . "')", 'IN'));
$modules = $module_handler->getObjectsArray($criteria, true);
- $mids = isset($_REQUEST['mids']) ? $_REQUEST['mids'] : array();
if (empty($mids) || !is_array($mids)) {
unset($mids);
$mids = array_keys($modules);
|