summaryrefslogtreecommitdiff
path: root/includes/pages/admin_questions.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-08-29 23:06:46 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2017-08-29 23:16:41 +0200
commitd0074cf0069322fe175fb385b91c974fc2771547 (patch)
tree713fcb1f426c8a693938e3c8bbfc685e57f79e69 /includes/pages/admin_questions.php
parent50da458d8907cc7c05938565faa80b271bbf9b3d (diff)
parent581b81f1b25dc6b6f0a3b34810c293738fd40217 (diff)
Merge remote-tracking branch 'engelsystem/feature-igel-rewrite'
# Conflicts: # includes/controller/angeltypes_controller.php # includes/pages/admin_groups.php # includes/pages/user_settings.php # includes/sys_page.php # src/Exceptions/Handler.php # src/Http/Request.php
Diffstat (limited to 'includes/pages/admin_questions.php')
-rw-r--r--includes/pages/admin_questions.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/includes/pages/admin_questions.php b/includes/pages/admin_questions.php
index 938e63a9..5f2e3a2b 100644
--- a/includes/pages/admin_questions.php
+++ b/includes/pages/admin_questions.php
@@ -105,11 +105,11 @@ function admin_questions()
return error('Incomplete call, missing Question ID.', true);
}
- $question = DB::select(
+ $question = DB::selectOne(
'SELECT * FROM `Questions` WHERE `QID`=? LIMIT 1',
[$question_id]
);
- if (count($question) > 0 && $question[0]['AID'] == null) {
+ if (!empty($question) && $question['AID'] == null) {
$answer = trim(
preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui",
'',
@@ -129,7 +129,7 @@ function admin_questions()
$question_id,
]
);
- engelsystem_log('Question ' . $question[0]['Question'] . ' answered: ' . $answer);
+ engelsystem_log('Question ' . $question['Question'] . ' answered: ' . $answer);
redirect(page_link_to('admin_questions'));
} else {
return error('Enter an answer!', true);
@@ -145,13 +145,13 @@ function admin_questions()
return error('Incomplete call, missing Question ID.', true);
}
- $question = DB::select(
+ $question = DB::selectOne(
'SELECT * FROM `Questions` WHERE `QID`=? LIMIT 1',
[$question_id]
);
- if (count($question) > 0) {
+ if (!empty($question)) {
DB::delete('DELETE FROM `Questions` WHERE `QID`=? LIMIT 1', [$question_id]);
- engelsystem_log('Question deleted: ' . $question[0]['Question']);
+ engelsystem_log('Question deleted: ' . $question['Question']);
redirect(page_link_to('admin_questions'));
} else {
return error('No question found.', true);