Skip to content

Commit

Permalink
use $INPUT instead of $_REQUEST
Browse files Browse the repository at this point in the history
  • Loading branch information
ssahara committed Nov 14, 2020
1 parent afb157b commit 874317c
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,34 +56,35 @@ protected function reloadBar() {
* Execute the requested action
*/
public function handle() {
global $INPUT;

if (isset($_REQUEST['add'])) {
if ($INPUT->has('add')) {
if (!checkSecurityToken()) return;

$conf = $this->loadCBData();
if(!$conf) {
if (!$conf) {
$conf = array();
}
$type = 0;
if ($_REQUEST["pretag"] != "" && $_REQUEST["posttag"] != "") {
if ($INPUT->str('pretag') != '' && $INPUT->str('posttag') != '') {
$type = 1;
}
array_push($conf, array(
'label' => $_REQUEST["label"],
'code' => $_REQUEST["code"],
'label' => $INPUT->str('label'),
'code' => $INPUT->str('code'),
'type' => $type,
'pretag' => $_REQUEST["pretag"],
'posttag' => $_REQUEST["posttag"],
'icon' => $_REQUEST["icon"],
'pretag' => $INPUT->str('pretag'),
'posttag' => $INPUT->str('posttag'),
'icon' => $INPUT->str('icon'),
));

$this->saveCBData($conf);
$this->reloadBar();
} elseif (isset($_REQUEST['delete'])) {
} elseif ($INPUT->has('delete')) {
if (!checkSecurityToken()) return;

$conf = $this->loadCBData();
unset($conf[$_REQUEST["delete"]]);
unset($conf[$INPUT->int('delete')]);
$this->saveCBData($conf);
$this->reloadBar();
}
Expand Down

0 comments on commit 874317c

Please sign in to comment.