From 080dec516e1cca51d142708f88682344dd845c32 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Tue, 1 May 2012 16:33:41 -0400 Subject: [PATCH] Fix whitespace regex. --- jsonld.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/jsonld.php b/jsonld.php index f02f057..9be185d 100644 --- a/jsonld.php +++ b/jsonld.php @@ -1563,14 +1563,6 @@ class JsonLdProcessor { */ protected function _toRDF( $element, $namer, $subject, $property, $graph, &$statements) { - // recurse into arrays - if(is_array($element)) { - foreach($element as $e) { - $this->_toRDF($e, $namer, $subject, $property, $graph, $statements); - } - return; - } - if(is_object($element)) { // convert @value to object if(self::_isValue($element)) { @@ -1671,6 +1663,14 @@ class JsonLdProcessor { return; } + if(is_array($element)) { + // recurse into arrays + foreach($element as $e) { + $this->_toRDF($e, $namer, $subject, $property, $graph, $statements); + } + return; + } + if(is_string($element)) { // property can be null for string subject references in @graph if($property === null) { @@ -3725,7 +3725,7 @@ class JsonLdProcessor { $datatype = "(?:\\^\\^$iri)"; $language = '(?:@([a-z]+(?:-[a-z0-9]+)*))'; $literal = "(?:$plain(?:$datatype|$language)?)"; - $ws = '[ \t]'; + $ws = '[ \\t]'; $eoln = '/(?:\r\n)|(?:\n)|(?:\r)/'; $empty = "/^$ws*$/";