mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 15:34:12 +01:00
N°8017 - Security - dependabot - Symfony's VarDumper vulnerable to un… (#731)
Upgrade all Symfony components to last security fix (~6.4.0)
This commit is contained in:
@@ -135,15 +135,21 @@ abstract class AbstractUnicodeString extends AbstractString
|
||||
} elseif (!\function_exists('iconv')) {
|
||||
$s = preg_replace('/[^\x00-\x7F]/u', '?', $s);
|
||||
} else {
|
||||
$s = @preg_replace_callback('/[^\x00-\x7F]/u', static function ($c) {
|
||||
$c = (string) iconv('UTF-8', 'ASCII//TRANSLIT', $c[0]);
|
||||
$previousLocale = setlocale(\LC_CTYPE, 0);
|
||||
try {
|
||||
setlocale(\LC_CTYPE, 'C');
|
||||
$s = @preg_replace_callback('/[^\x00-\x7F]/u', static function ($c) {
|
||||
$c = (string) iconv('UTF-8', 'ASCII//TRANSLIT', $c[0]);
|
||||
|
||||
if ('' === $c && '' === iconv('UTF-8', 'ASCII//TRANSLIT', '²')) {
|
||||
throw new \LogicException(sprintf('"%s" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you\'re using Alpine Linux.', static::class));
|
||||
}
|
||||
if ('' === $c && '' === iconv('UTF-8', 'ASCII//TRANSLIT', '²')) {
|
||||
throw new \LogicException(sprintf('"%s" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you\'re using Alpine Linux.', static::class));
|
||||
}
|
||||
|
||||
return 1 < \strlen($c) ? ltrim($c, '\'`"^~') : ('' !== $c ? $c : '?');
|
||||
}, $s);
|
||||
return 1 < \strlen($c) ? ltrim($c, '\'`"^~') : ('' !== $c ? $c : '?');
|
||||
}, $s);
|
||||
} finally {
|
||||
setlocale(\LC_CTYPE, $previousLocale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +161,7 @@ abstract class AbstractUnicodeString extends AbstractString
|
||||
public function camel(): static
|
||||
{
|
||||
$str = clone $this;
|
||||
$str->string = str_replace(' ', '', preg_replace_callback('/\b.(?![A-Z]{2,})/u', static function ($m) {
|
||||
$str->string = str_replace(' ', '', preg_replace_callback('/\b.(?!\p{Lu})/u', static function ($m) {
|
||||
static $i = 0;
|
||||
|
||||
return 1 === ++$i ? ('İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8')) : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8');
|
||||
@@ -190,7 +196,7 @@ abstract class AbstractUnicodeString extends AbstractString
|
||||
|
||||
if (!$compat || !\defined('Normalizer::NFKC_CF')) {
|
||||
$str->string = normalizer_normalize($str->string, $compat ? \Normalizer::NFKC : \Normalizer::NFC);
|
||||
$str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $this->string), 'UTF-8');
|
||||
$str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $str->string), 'UTF-8');
|
||||
} else {
|
||||
$str->string = normalizer_normalize($str->string, \Normalizer::NFKC_CF);
|
||||
}
|
||||
@@ -198,7 +204,7 @@ abstract class AbstractUnicodeString extends AbstractString
|
||||
return $str;
|
||||
}
|
||||
|
||||
public function join(array $strings, string $lastGlue = null): static
|
||||
public function join(array $strings, ?string $lastGlue = null): static
|
||||
{
|
||||
$str = clone $this;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user