Skip to content
Snippets Groups Projects
Commit 00e4c386 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch '7470-disalow-get-for-valuestore-update' into 'master'

valuestore: disallow GET for action=update

See merge request !70
parents 9d95789b a954f43c
Branches
No related tags found
1 merge request!70valuestore: disallow GET for action=update
Pipeline #4515 passed
...@@ -87,6 +87,12 @@ function getParam(string $sKey, string $sRegex4Cleanup = ''): bool|int|string ...@@ -87,6 +87,12 @@ function getParam(string $sKey, string $sRegex4Cleanup = ''): bool|int|string
*/ */
function disallowGet(string $sVar, string $sValue): void function disallowGet(string $sVar, string $sValue): void
{ {
if (isset($_POST[$sVar]) && $_POST[$sVar] == $sValue) {
// the value was found in the POST scope
// then we don't need to check the GET scope
return;
}
if (isset($_GET[$sVar]) && $_GET[$sVar] == $sValue) { if (isset($_GET[$sVar]) && $_GET[$sVar] == $sValue) {
quit("ERROR: $sVar = $sValue is not allowed with GET."); quit("ERROR: $sVar = $sValue is not allowed with GET.");
} }
...@@ -108,9 +114,7 @@ if ( ...@@ -108,9 +114,7 @@ if (
} }
disallowGet('action', 'cleanup'); disallowGet('action', 'cleanup');
disallowGet('action', 'delete'); disallowGet('action', 'delete');
disallowGet('action', 'update');
// used by Anasible to update the value ... I disable it for now to fix it in the near future
// disallowGet('action', 'update');
$sProject = getParam('project', '/[^a-z\-\_0-9]/'); $sProject = getParam('project', '/[^a-z\-\_0-9]/');
$sPackage = getParam('package', '/[^a-z\-\_0-9]/'); $sPackage = getParam('package', '/[^a-z\-\_0-9]/');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment