From 3a1e4602492cec1c8f3d2aabab2c866022f43bf1 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 18 Jul 2017 21:38:53 +0200 Subject: Changed $_GET, $_POST and $_REQUEST to use the Request object --- includes/pages/admin_questions.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'includes/pages/admin_questions.php') diff --git a/includes/pages/admin_questions.php b/includes/pages/admin_questions.php index 098701e3..d05bace6 100644 --- a/includes/pages/admin_questions.php +++ b/includes/pages/admin_questions.php @@ -38,8 +38,9 @@ function admin_new_questions() function admin_questions() { global $user; + $request = request(); - if (!isset($_REQUEST['action'])) { + if (!$request->has('action')) { $unanswered_questions_table = []; $questions = DB::select('SELECT * FROM `Questions` WHERE `AID` IS NULL'); foreach ($questions as $question) { @@ -96,10 +97,10 @@ function admin_questions() ], $answered_questions_table) ]); } else { - switch ($_REQUEST['action']) { + switch ($request->input('action')) { case 'answer': - if (isset($_REQUEST['id']) && preg_match('/^\d{1,11}$/', $_REQUEST['id'])) { - $question_id = $_REQUEST['id']; + if ($request->has('id') && preg_match('/^\d{1,11}$/', $request->input('id'))) { + $question_id = $request->input('id'); } else { return error('Incomplete call, missing Question ID.', true); } @@ -112,7 +113,7 @@ function admin_questions() $answer = trim( preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', - strip_tags($_REQUEST['answer']) + strip_tags($request->input('answer')) )); if ($answer != '') { @@ -138,8 +139,8 @@ function admin_questions() } break; case 'delete': - if (isset($_REQUEST['id']) && preg_match('/^\d{1,11}$/', $_REQUEST['id'])) { - $question_id = $_REQUEST['id']; + if ($request->has('id') && preg_match('/^\d{1,11}$/', $request->input('id'))) { + $question_id = $request->input('id'); } else { return error('Incomplete call, missing Question ID.', true); } -- cgit v1.2.3-54-g00ecf