forked from friendica/php-json-ld
Fixed built-in json number/bool check.
This commit is contained in:
parent
fd37e95a19
commit
1e79de1c41
|
@ -912,13 +912,14 @@ function _expand($ctx, $property, $value, $expandSubjects)
|
||||||
$coerce = _getCoerceType($ctx, $property, null);
|
$coerce = _getCoerceType($ctx, $property, null);
|
||||||
|
|
||||||
// automatic coercion for basic JSON types
|
// automatic coercion for basic JSON types
|
||||||
if($coerce === null and (is_numeric($value) or is_bool($value)))
|
if($coerce === null and !is_string($value) &&
|
||||||
|
(is_numeric($value) or is_bool($value)))
|
||||||
{
|
{
|
||||||
if(is_bool($value))
|
if(is_bool($value))
|
||||||
{
|
{
|
||||||
$coerce = JSONLD_XSD_BOOLEAN;
|
$coerce = JSONLD_XSD_BOOLEAN;
|
||||||
}
|
}
|
||||||
else if(strpos('' . $value, '.') === false)
|
else if(is_int($value))
|
||||||
{
|
{
|
||||||
$coerce = JSONLD_XSD_INTEGER;
|
$coerce = JSONLD_XSD_INTEGER;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue