mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 08:34:29 +00:00
Merge branch 'feature-25562/PV21_Vertraege_Encryption_Merge'
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
trait JSONData {
|
||||
protected function getJSONData(&$target, &$decoded, $attributeName)
|
||||
{
|
||||
if (isset($decoded[$attributeName]))
|
||||
{
|
||||
$target = $decoded[$attributeName];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getJSONDataString(&$target, &$decoded, $attributeName)
|
||||
{
|
||||
if (isset($decoded[$attributeName]))
|
||||
{
|
||||
$target = filter_var($decoded[$attributeName], FILTER_SANITIZE_STRING);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getJSONDataInt(&$target, &$decoded, $attributeName)
|
||||
{
|
||||
if (isset($decoded[$attributeName]) && filter_var($decoded[$attributeName], FILTER_VALIDATE_INT))
|
||||
{
|
||||
$target = filter_var($decoded[$attributeName], FILTER_VALIDATE_INT);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getJSONDataFloat(&$target, &$decoded, $attributeName)
|
||||
{
|
||||
if (isset($decoded[$attributeName]) && filter_var($decoded[$attributeName], FILTER_VALIDATE_FLOAT))
|
||||
{
|
||||
$target = filter_var($decoded[$attributeName], FILTER_VALIDATE_FLOAT);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getJSONDataBool(&$target, &$decoded, $attributeName)
|
||||
{
|
||||
if (isset($decoded[$attributeName]) && filter_var($decoded[$attributeName], FILTER_VALIDATE_BOOL))
|
||||
{
|
||||
$target = filter_var($decoded[$attributeName], FILTER_VALIDATE_BOOL);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user