From 7c2aceed28ef8363b0d3ff32eee43a9f14916047 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Fri, 8 Feb 2013 15:51:19 -0500 Subject: [PATCH] Set some defaults for parsed url. --- jsonld.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jsonld.php b/jsonld.php index 112391b..cbab03c 100644 --- a/jsonld.php +++ b/jsonld.php @@ -267,8 +267,14 @@ function jsonld_parse_url($url) { $rval['path'] = '/'; } } - else if(!isset($rval['path'])) { - $rval['path'] = ''; + else { + $rval['host'] = ''; + if(!isset($rval['path'])) { + $rval['path'] = ''; + } + } + if(!isset($rval['scheme'])) { + $rval['scheme'] = ''; } return $rval; }