Update to Drupal 8.0-dev-2015-11-17. Commits through da81cd220, Tue Nov 17 15:53:49 2015 +0000, Issue #2617224 by Wim Leers: Move around/fix some documentation.
This commit is contained in:
parent
4afb23bbd3
commit
7784f4c23d
929 changed files with 19798 additions and 5304 deletions
|
@ -18,8 +18,6 @@ use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
|||
|
||||
/**
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class UrlValidator extends ConstraintValidator
|
||||
{
|
||||
|
@ -36,7 +34,7 @@ class UrlValidator extends ConstraintValidator
|
|||
\] # a IPv6 address
|
||||
)
|
||||
(:[0-9]+)? # a port (optional)
|
||||
(/?|/\S+) # a /, nothing or a / with something
|
||||
(/?|/\S+|\?|\#) # a /, nothing, a / with something, a query or a fragment
|
||||
$~ixu';
|
||||
|
||||
/**
|
||||
|
@ -48,7 +46,7 @@ class UrlValidator extends ConstraintValidator
|
|||
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Url');
|
||||
}
|
||||
|
||||
if (null === $value || '' === $value) {
|
||||
if (null === $value) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -57,6 +55,10 @@ class UrlValidator extends ConstraintValidator
|
|||
}
|
||||
|
||||
$value = (string) $value;
|
||||
if ('' === $value) {
|
||||
return;
|
||||
}
|
||||
|
||||
$pattern = sprintf(static::PATTERN, implode('|', $constraint->protocols));
|
||||
|
||||
if (!preg_match($pattern, $value)) {
|
||||
|
|
Reference in a new issue