From 3b62e8bfe90c0e6924e0e1c3970493dd0ef74b32 Mon Sep 17 00:00:00 2001 From: Erayd Date: Thu, 23 Feb 2017 11:40:25 +1300 Subject: [PATCH] Use PHP-5.3 compliant syntax --- src/JsonSchema/Constraints/FormatConstraint.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/JsonSchema/Constraints/FormatConstraint.php b/src/JsonSchema/Constraints/FormatConstraint.php index d2b853fe..839debcc 100644 --- a/src/JsonSchema/Constraints/FormatConstraint.php +++ b/src/JsonSchema/Constraints/FormatConstraint.php @@ -89,8 +89,8 @@ public function check(&$element, $schema = null, JsonPointer $path = null, $i = } elseif (substr($element, 0, 1) === '/') { // absolute-path reference $validURL = filter_var('scheme://host' . $element, FILTER_VALIDATE_URL, FILTER_NULL_ON_FAILURE); } elseif (strlen($element)) { // relative-path reference - $pathParts = explode('/', $element, 2)[0]; - if ($pathParts[0] !== '.' && strpos($pathParts, ':') !== false) { + $pathParts = explode('/', $element, 2); + if ($pathParts[0][0] !== '.' && strpos($pathParts[0], ':') !== false) { $validURL = null; } else { $validURL = filter_var('scheme://host/' . $element, FILTER_VALIDATE_URL, FILTER_NULL_ON_FAILURE);