From 00c18e853e48b99e0d39af6aa415d1b7bd438f6a Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Wed, 9 May 2012 22:15:28 -0400 Subject: [PATCH] Check input for non-array in from_rdf. --- jsonld.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsonld.php b/jsonld.php index 17b6342..6b3081b 100644 --- a/jsonld.php +++ b/jsonld.php @@ -113,7 +113,7 @@ function jsonld_normalize($input, $options=array()) { * specified by the format option or an array of the RDF statements * to convert. * @param assoc [$options] the options to use: - * [format] the format if input is a string: + * [format] the format if input not an array: * 'application/nquads' for N-Quads (default). * [notType] true to use rdf:type, false to use @type (default). * @@ -513,7 +513,7 @@ class JsonLdProcessor { isset($options['format']) or $options['format'] = 'application/nquads'; isset($options['notType']) or $options['notType'] = false; - if(is_string($statements)) { + if(!is_array($statements)) { // supported formats (processor-specific and global) if(($this->rdfParsers !== null && !property_exists($this->rdfParsers, $options['format'])) ||