X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fvalidator%2FConstraints%2FUuidValidator.php;fp=vendor%2Fsymfony%2Fvalidator%2FConstraints%2FUuidValidator.php;h=be177e2255ffba8a37013bc5fff555b41fc9f54f;hp=b0b4e8a7d8ec028161d68f2f6933e5091f940d5f;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/symfony/validator/Constraints/UuidValidator.php b/vendor/symfony/validator/Constraints/UuidValidator.php index b0b4e8a7d..be177e225 100644 --- a/vendor/symfony/validator/Constraints/UuidValidator.php +++ b/vendor/symfony/validator/Constraints/UuidValidator.php @@ -16,13 +16,19 @@ use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** - * Validates whether the value is a valid UUID per RFC 4122. + * Validates whether the value is a valid UUID (also known as GUID). + * + * Strict validation will allow a UUID as specified per RFC 4122. + * Loose validation will allow any type of UUID. + * + * For better compatibility, both loose and strict, you should consider using a specialized UUID library like "ramsey/uuid" instead. * * @author Colin O'Dell * @author Bernhard Schussek * * @see http://tools.ietf.org/html/rfc4122 * @see https://en.wikipedia.org/wiki/Universally_unique_identifier + * @see https://github.com/ramsey/uuid */ class UuidValidator extends ConstraintValidator { @@ -240,7 +246,7 @@ class UuidValidator extends ConstraintValidator // 0b10xx // & 0b1100 (12) // = 0b1000 (8) - if ((hexdec($value[self::STRICT_VARIANT_POSITION]) & 12) !== 8) { + if (8 !== (hexdec($value[self::STRICT_VARIANT_POSITION]) & 12)) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode(Uuid::INVALID_VARIANT_ERROR)