From 31181efa264bb04a141a33fc7e93e513d77ee249 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Sat, 17 Dec 2011 21:01:13 -0500 Subject: [PATCH] Remove unnecessary @type check. --- jsonld.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jsonld.php b/jsonld.php index d16d064..c71ae15 100644 --- a/jsonld.php +++ b/jsonld.php @@ -2735,8 +2735,8 @@ function _subframe( $vars = get_object_vars($value); foreach($vars as $key => $v) { - // skip keywords and type - if(strpos($key, '@') !== 0 and $key !== '@type') + // skip keywords + if(strpos($key, '@') !== 0) { // get the subframe if available if(property_exists($frame, $key)) @@ -2773,8 +2773,8 @@ function _subframe( // iterate over frame keys to add any missing values foreach($frame as $key => $f) { - // skip keywords, type query, and non-null keys in value - if(strpos($key, '@') !== 0 and $key !== '@type' and + // skip keywords and non-null keys in value + if(strpos($key, '@') !== 0 and (!property_exists($value, $key) || $value->{$key} === null)) { // add empty array to value