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

@ -101,7 +101,7 @@ class JsonDecode implements DecoderInterface
$recursionDepth = $context['json_decode_recursion_depth'];
$options = $context['json_decode_options'];
if (PHP_VERSION_ID >= 50400) {
if (\PHP_VERSION_ID >= 50400) {
$decodedData = json_decode($data, $associative, $recursionDepth, $options);
} else {
$decodedData = json_decode($data, $associative, $recursionDepth);

View file

@ -301,11 +301,19 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec
$data = array();
foreach ($node->attributes as $attr) {
if (ctype_digit($attr->nodeValue)) {
$data['@'.$attr->nodeName] = (int) $attr->nodeValue;
} else {
if (!is_numeric($attr->nodeValue)) {
$data['@'.$attr->nodeName] = $attr->nodeValue;
continue;
}
if (false !== $val = filter_var($attr->nodeValue, FILTER_VALIDATE_INT)) {
$data['@'.$attr->nodeName] = $val;
continue;
}
$data['@'.$attr->nodeName] = (float) $attr->nodeValue;
}
return $data;
@ -460,7 +468,7 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec
*/
private function needsCdataWrapping($val)
{
return preg_match('/[<>&]/', $val);
return 0 < preg_match('/[<>&]/', $val);
}
/**