Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
@ -143,6 +143,20 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt
|
|||
*/
|
||||
protected function doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $referenceType, $hostTokens, array $requiredSchemes = array())
|
||||
{
|
||||
if (is_bool($referenceType) || is_string($referenceType)) {
|
||||
@trigger_error('The hardcoded value you are using for the $referenceType argument of the '.__CLASS__.'::generate method is deprecated since version 2.8 and will not be supported anymore in 3.0. Use the constants defined in the UrlGeneratorInterface instead.', E_USER_DEPRECATED);
|
||||
|
||||
if (true === $referenceType) {
|
||||
$referenceType = self::ABSOLUTE_URL;
|
||||
} elseif (false === $referenceType) {
|
||||
$referenceType = self::ABSOLUTE_PATH;
|
||||
} elseif ('relative' === $referenceType) {
|
||||
$referenceType = self::RELATIVE_PATH;
|
||||
} elseif ('network' === $referenceType) {
|
||||
$referenceType = self::NETWORK_PATH;
|
||||
}
|
||||
}
|
||||
|
||||
$variables = array_flip($variables);
|
||||
$mergedParams = array_replace($defaults, $this->context->getParameters(), $parameters);
|
||||
|
||||
|
@ -202,16 +216,7 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt
|
|||
$scheme = $this->context->getScheme();
|
||||
|
||||
if ($requiredSchemes) {
|
||||
$schemeMatched = false;
|
||||
foreach ($requiredSchemes as $requiredScheme) {
|
||||
if ($scheme === $requiredScheme) {
|
||||
$schemeMatched = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$schemeMatched) {
|
||||
if (!in_array($scheme, $requiredSchemes, true)) {
|
||||
$referenceType = self::ABSOLUTE_URL;
|
||||
$scheme = current($requiredSchemes);
|
||||
}
|
||||
|
|
Reference in a new issue