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
|
@ -108,7 +108,7 @@ class JsonDecode implements DecoderInterface
|
|||
}
|
||||
|
||||
if (JSON_ERROR_NONE !== $this->lastError = json_last_error()) {
|
||||
throw new UnexpectedValueException(JsonEncoder::getLastErrorMessage());
|
||||
throw new UnexpectedValueException(json_last_error_msg());
|
||||
}
|
||||
|
||||
return $decodedData;
|
||||
|
|
|
@ -56,7 +56,7 @@ class JsonEncode implements EncoderInterface
|
|||
$encodedJson = json_encode($data, $context['json_encode_options']);
|
||||
|
||||
if (JSON_ERROR_NONE !== $this->lastError = json_last_error()) {
|
||||
throw new UnexpectedValueException(JsonEncoder::getLastErrorMessage());
|
||||
throw new UnexpectedValueException(json_last_error_msg());
|
||||
}
|
||||
|
||||
return $encodedJson;
|
||||
|
|
|
@ -100,26 +100,13 @@ class JsonEncoder implements EncoderInterface, DecoderInterface
|
|||
* Resolves json_last_error message.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @deprecated since 2.8, to be removed in 3.0. Use json_last_error_msg() instead.
|
||||
*/
|
||||
public static function getLastErrorMessage()
|
||||
{
|
||||
if (function_exists('json_last_error_msg')) {
|
||||
return json_last_error_msg();
|
||||
}
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use json_last_error_msg() instead.', E_USER_DEPRECATED);
|
||||
|
||||
switch (json_last_error()) {
|
||||
case JSON_ERROR_DEPTH:
|
||||
return 'Maximum stack depth exceeded';
|
||||
case JSON_ERROR_STATE_MISMATCH:
|
||||
return 'Underflow or the modes mismatch';
|
||||
case JSON_ERROR_CTRL_CHAR:
|
||||
return 'Unexpected control character found';
|
||||
case JSON_ERROR_SYNTAX:
|
||||
return 'Syntax error, malformed JSON';
|
||||
case JSON_ERROR_UTF8:
|
||||
return 'Malformed UTF-8 characters, possibly incorrectly encoded';
|
||||
default:
|
||||
return 'Unknown error';
|
||||
}
|
||||
return json_last_error_msg();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -366,7 +366,7 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec
|
|||
{
|
||||
$append = true;
|
||||
|
||||
if (is_array($data) || $data instanceof \Traversable) {
|
||||
if (is_array($data) || ($data instanceof \Traversable && !$this->serializer->supportsNormalization($data, $this->format))) {
|
||||
foreach ($data as $key => $data) {
|
||||
//Ah this is the magic @ attribute types.
|
||||
if (0 === strpos($key, '@') && is_scalar($data) && $this->isElementNameValid($attributeName = substr($key, 1))) {
|
||||
|
|
Reference in a new issue