From 3b9d09ef7b33ec8afe26effe27c72e1d99570f47 Mon Sep 17 00:00:00 2001 From: Floorb <132411956+Neetpone@users.noreply.github.com> Date: Sat, 17 Jul 2021 18:29:36 -0400 Subject: [PATCH] Small bit of code cleanup. --- admin/ajax_pastes.php | 1 - admin/ajax_reports.php | 5 +- admin/ajax_users.php | 2 +- admin/interface.php | 11 +-- admin/ipbans.php | 14 ++-- .../ckeditor/samples/sample_posteddata.php | 2 +- admin/pages.php | 11 ++- admin/ssp.pastes.php | 1 - admin/ssp.reports.php | 1 - admin/ssp.users.php | 1 - admin/tasksqqq.php | 4 +- api/ajax_pastes.php | 1 - api/public.pastes.php | 4 +- api/ssp.pastes.php | 5 +- archive.php | 1 - event.php | 1 - includes/captcha.php | 10 ++- includes/common.php | 5 +- includes/functions.php | 57 +++++----------- includes/geshi.php | 68 ++++++++----------- index.php | 1 - langs/bg.php | 2 +- langs/br.php | 2 +- langs/de.php | 2 +- langs/en.php | 2 +- langs/es.php | 2 +- langs/fr.php | 1 - langs/pl.php | 2 +- langs/ru.php | 1 - theme/bulma/archive.php | 3 +- theme/bulma/event.php | 8 +-- theme/bulma/user_profile.php | 30 ++++---- 32 files changed, 98 insertions(+), 163 deletions(-) diff --git a/admin/ajax_pastes.php b/admin/ajax_pastes.php index 4dfe9a3..04e9522 100644 --- a/admin/ajax_pastes.php +++ b/admin/ajax_pastes.php @@ -65,4 +65,3 @@ require('ssp.pastes.php'); echo json_encode( SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns, $columns2) ); -?> \ No newline at end of file diff --git a/admin/ajax_reports.php b/admin/ajax_reports.php index 89a4acd..0f4765e 100644 --- a/admin/ajax_reports.php +++ b/admin/ajax_reports.php @@ -1,9 +1,7 @@ \ No newline at end of file diff --git a/admin/ajax_users.php b/admin/ajax_users.php index 0ebb9eb..6b7e2c8 100644 --- a/admin/ajax_users.php +++ b/admin/ajax_users.php @@ -54,4 +54,4 @@ if ($_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest") { header("Location: http://ponepaste.org/SVOtaKqJZh4nT9Z"); die(); } -?> + diff --git a/admin/interface.php b/admin/interface.php index 9c1176f..d2a4cee 100644 --- a/admin/interface.php +++ b/admin/interface.php @@ -14,9 +14,7 @@ */ session_start(); -if (isset($_SESSION['login'])) { -// Do nothing -} else { +if (!isset($_SESSION['login'])) { header("Location: ."); exit(); } @@ -57,9 +55,7 @@ while ($row = mysqli_fetch_array($result)) { } if ($last_ip == $ip) { - if ($last_date == $date) { - - } else { + if ($last_date != $date) { $query = "INSERT INTO admin_history (last_date,ip) VALUES ('$date','$ip')"; mysqli_query($con, $query); } @@ -192,8 +188,7 @@ if ($last_ip == $ip) { $fname = explode('.php', $files1[$loop]); $fname = $fname[0]; $ffname = $files1[$loop]; - if ($ffname == "index.php") {/* we don't want index.php showing */ - } else { + if ($ffname != "index.php") { echo ''; } } diff --git a/admin/ipbans.php b/admin/ipbans.php index 4a079e8..d207d19 100644 --- a/admin/ipbans.php +++ b/admin/ipbans.php @@ -14,9 +14,7 @@ */ session_start(); -if (isset($_SESSION['login'])) { -// Do nothing -} else { +if (!isset($_SESSION['login'])) { header("Location: ."); exit(); } @@ -57,9 +55,7 @@ while ($row = mysqli_fetch_array($result)) { } if ($last_ip == $ip) { - if ($last_date == $date) { - - } else { + if ($last_date != $date) { $query = "INSERT INTO admin_history (last_date,ip) VALUES ('$date','$ip')"; mysqli_query($con, $query); } @@ -97,7 +93,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' || isset($_GET['banip'])) { } } -if (isset($_GET{'delete'})) { +if (isset($_GET['delete'])) { $delete = htmlentities(Trim($_GET['delete'])); $query = "DELETE FROM ban_user WHERE id=$delete"; $result = mysqli_query($con, $query); @@ -237,8 +233,8 @@ if (isset($_GET{'delete'})) { $rec_count = Trim($row[0]); - if (isset($_GET{'page'})) { // Current page - $page = $_GET{'page'} + 1; + if (isset($_GET['page'])) { // Current page + $page = $_GET['page'] + 1; $offset = $rec_limit * $page; } else { // Show first set of results diff --git a/admin/js/plugins/ckeditor/samples/sample_posteddata.php b/admin/js/plugins/ckeditor/samples/sample_posteddata.php index 0657699..e076223 100644 --- a/admin/js/plugins/ckeditor/samples/sample_posteddata.php +++ b/admin/js/plugins/ckeditor/samples/sample_posteddata.php @@ -14,4 +14,4 @@ -------------------------------------------------------------------------------------------