Skip to content

Commit

Permalink
Use PHP-5.3 compliant syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
erayd committed Feb 22, 2017
1 parent 139df4b commit 3b62e8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/JsonSchema/Constraints/FormatConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3b62e8b

Please sign in to comment.