update dependencies and add voku\AntiXSS
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -46,7 +46,8 @@
|
|||||||
"phpmailer/phpmailer": "~6.0",
|
"phpmailer/phpmailer": "~6.0",
|
||||||
"monolog/monolog": "^1.24",
|
"monolog/monolog": "^1.24",
|
||||||
"robthree/twofactorauth": "^1.6",
|
"robthree/twofactorauth": "^1.6",
|
||||||
"froxlor/idna-convert-legacy": "^2.1"
|
"froxlor/idna-convert-legacy": "^2.1",
|
||||||
|
"voku/anti-xss": "^4.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "8.4.1",
|
"phpunit/phpunit": "8.4.1",
|
||||||
|
|||||||
1676
composer.lock
generated
1676
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -223,9 +223,17 @@ class PhpHelper
|
|||||||
*/
|
*/
|
||||||
public static function gethostbynamel6($host, $try_a = true)
|
public static function gethostbynamel6($host, $try_a = true)
|
||||||
{
|
{
|
||||||
$dns6 = dns_get_record($host, DNS_AAAA);
|
$dns6 = @dns_get_record($host, DNS_AAAA);
|
||||||
|
if (!is_array($dns6)) {
|
||||||
|
// no record or failed to check
|
||||||
|
$dns6 = [];
|
||||||
|
}
|
||||||
if ($try_a == true) {
|
if ($try_a == true) {
|
||||||
$dns4 = dns_get_record($host, DNS_A);
|
$dns4 = @dns_get_record($host, DNS_A);
|
||||||
|
if (!is_array($dns4)) {
|
||||||
|
// no record or failed to check
|
||||||
|
$dns4 = [];
|
||||||
|
}
|
||||||
$dns = array_merge($dns4, $dns6);
|
$dns = array_merge($dns4, $dns6);
|
||||||
} else {
|
} else {
|
||||||
$dns = $dns6;
|
$dns = $dns6;
|
||||||
@@ -382,4 +390,21 @@ class PhpHelper
|
|||||||
}
|
}
|
||||||
return $returnval;
|
return $returnval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* function to check a super-global passed by reference
|
||||||
|
* so it gets automatically updated
|
||||||
|
*
|
||||||
|
* @param array $global
|
||||||
|
* @param \voku\helper\AntiXSS $antiXss
|
||||||
|
*/
|
||||||
|
public static function cleanGlobal(&$global = [], &$antiXss)
|
||||||
|
{
|
||||||
|
if (isset($global) && ! empty($global)) {
|
||||||
|
$tmp = $global;
|
||||||
|
foreach ($tmp as $index => $value) {
|
||||||
|
$global[$index] = $antiXss->xss_clean($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user