Skip to content

Commit

Permalink
Merge pull request #92 from AwardWallet/master
Browse files Browse the repository at this point in the history
added configurable maximum recursion depth
  • Loading branch information
justinrainbow committed Mar 5, 2014
2 parents cb428b3 + ac13166 commit d97cf3c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/JsonSchema/RefResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ class RefResolver
*/
protected static $depth = 0;

/**
* maximum references depth
* @var integer
*/
public static $maxDepth = 7;

/**
* @var UriRetrieverInterface
*/
Expand Down Expand Up @@ -89,7 +95,7 @@ public function getUriRetriever()
*/
public function resolve($schema, $sourceUri = null)
{
if (self::$depth > 7) {
if (self::$depth > self::$maxDepth) {
return;
}
++self::$depth;
Expand Down

0 comments on commit d97cf3c

Please sign in to comment.