Update to Drupal 8.2.6. For more information, see https://www.drupal.org/project/drupal/releases/8.2.6

This commit is contained in:
Pantheon Automation 2017-02-02 16:28:38 -08:00 committed by Greg Anderson
parent db56c09587
commit f1e72395cb
588 changed files with 26857 additions and 2777 deletions

View file

@ -81,6 +81,10 @@ class UuidValidator extends ConstraintValidator
return;
}
if (!$constraint instanceof Uuid) {
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Uuid');
}
if (!is_scalar($value) && !(is_object($value) && method_exists($value, '__toString'))) {
throw new UnexpectedTypeException($value, 'string');
}
@ -114,7 +118,7 @@ class UuidValidator extends ConstraintValidator
for ($i = 0; $i < $l; ++$i) {
// Check length
if (!isset($trimmed{$i})) {
if (!isset($trimmed[$i])) {
if ($this->context instanceof ExecutionContextInterface) {
$this->context->buildViolation($constraint->message)
->setParameter('{{ value }}', $this->formatValue($value))
@ -133,7 +137,7 @@ class UuidValidator extends ConstraintValidator
// Hyphens must occur every fifth position
// xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx
// ^ ^ ^ ^ ^ ^ ^
if ('-' === $trimmed{$i}) {
if ('-' === $trimmed[$i]) {
if ($i !== $h) {
if ($this->context instanceof ExecutionContextInterface) {
$this->context->buildViolation($constraint->message)
@ -162,7 +166,7 @@ class UuidValidator extends ConstraintValidator
}
// Check characters
if (!ctype_xdigit($trimmed{$i})) {
if (!ctype_xdigit($trimmed[$i])) {
if ($this->context instanceof ExecutionContextInterface) {
$this->context->buildViolation($constraint->message)
->setParameter('{{ value }}', $this->formatValue($value))
@ -180,7 +184,7 @@ class UuidValidator extends ConstraintValidator
}
// Check length again
if (isset($trimmed{$i})) {
if (isset($trimmed[$i])) {
if ($this->context instanceof ExecutionContextInterface) {
$this->context->buildViolation($constraint->message)
->setParameter('{{ value }}', $this->formatValue($value))
@ -209,7 +213,7 @@ class UuidValidator extends ConstraintValidator
for ($i = 0; $i < self::STRICT_LENGTH; ++$i) {
// Check length
if (!isset($value{$i})) {
if (!isset($value[$i])) {
if ($this->context instanceof ExecutionContextInterface) {
$this->context->buildViolation($constraint->message)
->setParameter('{{ value }}', $this->formatValue($value))
@ -228,24 +232,18 @@ class UuidValidator extends ConstraintValidator
// Check hyphen placement
// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
// ^ ^ ^ ^
if ('-' === $value{$i}) {
if ('-' === $value[$i]) {
if ($i !== $h) {
if ($this->context instanceof ExecutionContextInterface) {
$this->context->buildViolation($constraint->message)
->setParameter(
'{{ value }}',
$this->formatValue($value)
)
->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR)
->addViolation();
->setParameter('{{ value }}', $this->formatValue($value))
->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR)
->addViolation();
} else {
$this->buildViolation($constraint->message)
->setParameter(
'{{ value }}',
$this->formatValue($value)
)
->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR)
->addViolation();
->setParameter('{{ value }}', $this->formatValue($value))
->setCode(Uuid::INVALID_HYPHEN_PLACEMENT_ERROR)
->addViolation();
}
return;
@ -261,7 +259,7 @@ class UuidValidator extends ConstraintValidator
}
// Check characters
if (!ctype_xdigit($value{$i})) {
if (!ctype_xdigit($value[$i])) {
if ($this->context instanceof ExecutionContextInterface) {
$this->context->buildViolation($constraint->message)
->setParameter('{{ value }}', $this->formatValue($value))
@ -296,7 +294,7 @@ class UuidValidator extends ConstraintValidator
}
// Check length again
if (isset($value{$i})) {
if (isset($value[$i])) {
if ($this->context instanceof ExecutionContextInterface) {
$this->context->buildViolation($constraint->message)
->setParameter('{{ value }}', $this->formatValue($value))
@ -311,7 +309,7 @@ class UuidValidator extends ConstraintValidator
}
// Check version
if (!in_array($value{self::STRICT_VERSION_POSITION}, $constraint->versions)) {
if (!in_array($value[self::STRICT_VERSION_POSITION], $constraint->versions)) {
if ($this->context instanceof ExecutionContextInterface) {
$this->context->buildViolation($constraint->message)
->setParameter('{{ value }}', $this->formatValue($value))
@ -329,7 +327,7 @@ class UuidValidator extends ConstraintValidator
// 0b10xx
// & 0b1100 (12)
// = 0b1000 (8)
if ((hexdec($value{self::STRICT_VARIANT_POSITION}) & 12) !== 8) {
if ((hexdec($value[self::STRICT_VARIANT_POSITION]) & 12) !== 8) {
if ($this->context instanceof ExecutionContextInterface) {
$this->context->buildViolation($constraint->message)
->setParameter('{{ value }}', $this->formatValue($value))