|
|
@ -336,16 +336,16 @@ class Manticore |
|
|
|
case is_object($value): |
|
|
|
case is_object($value): |
|
|
|
return self::TYPE_OBJECT; |
|
|
|
return self::TYPE_OBJECT; |
|
|
|
|
|
|
|
|
|
|
|
case is_string($value) && false === mb_detect_encoding((string) $value, null, true): |
|
|
|
case is_string($value) && false === mb_detect_encoding($value, null, true): |
|
|
|
return self::TYPE_BIN; |
|
|
|
return self::TYPE_BIN; |
|
|
|
|
|
|
|
|
|
|
|
case is_string($value) && false === preg_match('/\s/', $value) && base64_encode((string) base64_decode((string) $value, true)) === $value: |
|
|
|
case is_string($value) && false === preg_match('/\s/', $value) && base64_encode((string) base64_decode($value, true)) === $value: |
|
|
|
return self::TYPE_BASE_64; |
|
|
|
return self::TYPE_BASE_64; |
|
|
|
|
|
|
|
|
|
|
|
case is_string($value) && json_encode((string) json_decode((string) $value)) === $value: |
|
|
|
case is_string($value) && json_encode(json_decode($value)) === $value: |
|
|
|
return self::TYPE_JSON; |
|
|
|
return self::TYPE_JSON; |
|
|
|
|
|
|
|
|
|
|
|
case is_string($value) && false !== @simplexml_load_string((string) $value): |
|
|
|
case is_string($value) && false !== preg_match('/<\/[^>]+>/', $value): |
|
|
|
return self::TYPE_XML; |
|
|
|
return self::TYPE_XML; |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|