From daed05a54b77adef489516f077d3064eb6bfc321 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Wed, 3 Dec 2014 14:56:23 -0500 Subject: [PATCH] Fix off-by-one in context merging. --- jsonld.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsonld.php b/jsonld.php index 1863eab..3e35f61 100644 --- a/jsonld.php +++ b/jsonld.php @@ -5094,8 +5094,8 @@ class JsonLdProcessor { if(is_array($ctx)) { // add flattened context array_splice($v, $i, 1, $ctx); - $i += count($ctx); - $length += count($ctx); + $i += count($ctx) - 1; + $length = count($v); } else { $v[$i] = $ctx; }