From e192d3fd04777eacfc8088008e773f7ff6fd30f2 Mon Sep 17 00:00:00 2001 From: Anonymous Contributor Date: Wed, 23 Aug 2023 18:16:35 +0200 Subject: [PATCH] Fix POST request handling in dashboard forms --- pages/friends.php | 4 ++-- pages/groups.php | 4 ++-- pages/identities.php | 4 ++-- pages/password.php | 4 ++-- pages/users.php | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pages/friends.php b/pages/friends.php index a4e9cfa..a8f91c9 100644 --- a/pages/friends.php +++ b/pages/friends.php @@ -1,8 +1,8 @@ array('required' => true, 'regex' => '/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/') )); diff --git a/pages/groups.php b/pages/groups.php index aba164d..92789f6 100644 --- a/pages/groups.php +++ b/pages/groups.php @@ -1,8 +1,8 @@ array('required' => true, 'regex' => '/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/') )); diff --git a/pages/identities.php b/pages/identities.php index 82c27ce..6c6fe88 100644 --- a/pages/identities.php +++ b/pages/identities.php @@ -2,8 +2,8 @@ $statementCreateTable = $RUNTIME['PDO']->prepare("CREATE TABLE IF NOT EXISTS `UserIdentitys` (`PrincipalID` VARCHAR(38) NOT NULL, `IdentityID` VARCHAR(38) NOT NULL, PRIMARY KEY (`IdentityID`))"); $statementCreateTable->execute(); - if($_SERVER['REQUEST_TYPE'] == 'POST') { - include '../app/FormValidator.php'; + if($_SERVER['REQUEST_METHOD'] == 'POST') { + include 'app/FormValidator.php'; if(isset($_POST['enableIdent'])) { $validator = new FormValidator(array( 'newuuid' => array('required' => true, 'regex' => '/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/') diff --git a/pages/password.php b/pages/password.php index d5bff06..914ba50 100644 --- a/pages/password.php +++ b/pages/password.php @@ -1,11 +1,11 @@ array('required' => true, 'regex' => '.{1,1000}'), 'newPassword' => array('required' => true, 'regex' => '.{1,1000}'), diff --git a/pages/users.php b/pages/users.php index 333eb3a..c2208a9 100644 --- a/pages/users.php +++ b/pages/users.php @@ -11,8 +11,8 @@ die(); } - if($_SERVER['REQUEST_TYPE'] == 'POST') { - include '../app/FormValidator.php'; + if($_SERVER['REQUEST_METHOD'] == 'POST') { + include 'app/FormValidator.php'; if(isset($_POST['genpw'])) { $validator = new FormValidator(array( 'userid' => array('required' => true, 'regex' => '/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/')