Core and composer updates

This commit is contained in:
Rob Davies 2017-07-03 16:47:07 +01:00
parent a82634bb98
commit 62cac30480
1118 changed files with 21770 additions and 6306 deletions

View file

@ -3,7 +3,9 @@
namespace Drupal\Component\Plugin\Context;
/**
* Interface for context definitions.
* Interface used to define definition objects found in ContextInterface.
*
* @see \Drupal\Component\Plugin\Context\ContextInterface
*
* @todo WARNING: This interface is going to receive some additions as part of
* https://www.drupal.org/node/2346999.

View file

@ -3,7 +3,14 @@
namespace Drupal\Component\Plugin\Context;
/**
* A generic context interface for wrapping data a plugin needs to operate.
* Provides data and definitions for plugins during runtime and administration.
*
* Plugin contexts are satisfied by ContextInterface implementing objects.
* These objects always contain a definition of what data they will provide
* during runtime. During run time, ContextInterface implementing objects must
* also provide the corresponding data value.
*
* @see \Drupal\Component\Plugin\Context\ContextDefinitionInterface
*/
interface ContextInterface {

View file

@ -27,6 +27,12 @@ class YamlPecl implements SerializationInterface {
* {@inheritdoc}
*/
public static function decode($raw) {
static $init;
if (!isset($init)) {
// We never want to unserialize !php/object.
ini_set('yaml.decode_php', 0);
$init = TRUE;
}
// yaml_parse() will error with an empty value.
if (!trim($raw)) {
return NULL;

View file

@ -61,13 +61,15 @@ class Html {
* Do not pass one string containing multiple classes as they will be
* incorrectly concatenated with dashes, i.e. "one two" will become "one-two".
*
* @param string $class
* The class name to clean.
* @param mixed $class
* The class name to clean. It can be a string or anything that can be cast
* to string.
*
* @return string
* The cleaned class name.
*/
public static function getClass($class) {
$class = (string) $class;
if (!isset(static::$classes[$class])) {
static::$classes[$class] = static::cleanCssIdentifier(Unicode::strtolower($class));
}

View file

@ -46,7 +46,7 @@ class UrlHelper {
$params = [];
foreach ($query as $key => $value) {
$key = ($parent ? $parent . '[' . rawurlencode($key) . ']' : rawurlencode($key));
$key = ($parent ? $parent . rawurlencode('[' . $key . ']') : rawurlencode($key));
// Recurse into children.
if (is_array($value)) {
@ -142,7 +142,12 @@ class UrlHelper {
// External URLs: not using parse_url() here, so we do not have to rebuild
// the scheme, host, and path without having any use for it.
if (strpos($url, '://') !== FALSE) {
// The URL is considered external if it contains the '://' delimiter. Since
// a URL can also be passed as a query argument, we check if this delimiter
// appears in front of the '?' query argument delimiter.
$scheme_delimiter_position = strpos($url, '://');
$query_delimiter_position = strpos($url, '?');
if ($scheme_delimiter_position !== FALSE && ($query_delimiter_position === FALSE || $scheme_delimiter_position < $query_delimiter_position)) {
// Split off everything before the query string into 'path'.
$parts = explode('?', $url);