mirror of
https://github.com/kvazar-network/index-php.git
synced 2025-01-22 04:45:13 +00:00
fix preg_match validation
This commit is contained in:
parent
8cddb99691
commit
bd29ff626d
@ -339,13 +339,13 @@ class Manticore
|
||||
case is_string($value) && false === mb_detect_encoding($value, null, true):
|
||||
return self::TYPE_BIN;
|
||||
|
||||
case is_string($value) && false === preg_match('/\s/', $value) && base64_encode((string) base64_decode($value, true)) === $value:
|
||||
case is_string($value) && !preg_match('/\s/', $value) && base64_encode((string) base64_decode($value, true)) === $value:
|
||||
return self::TYPE_BASE_64;
|
||||
|
||||
case is_string($value) && json_encode(json_decode($value)) === $value:
|
||||
return self::TYPE_JSON;
|
||||
|
||||
case is_string($value) && false !== preg_match('/<\/[^>]+>/', $value):
|
||||
case is_string($value) && 1 === preg_match('/<\/[^>]+>/', $value):
|
||||
return self::TYPE_XML;
|
||||
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user