mirror of
https://github.com/justinrainbow/json-schema.git
synced 2025-05-02 20:42:13 +02:00
Merge pull request #92 from AwardWallet/master
added configurable maximum recursion depth
This commit is contained in:
commit
d97cf3ce89
@ -29,6 +29,12 @@ class RefResolver
|
||||
*/
|
||||
protected static $depth = 0;
|
||||
|
||||
/**
|
||||
* maximum references depth
|
||||
* @var integer
|
||||
*/
|
||||
public static $maxDepth = 7;
|
||||
|
||||
/**
|
||||
* @var UriRetrieverInterface
|
||||
*/
|
||||
@ -89,7 +95,7 @@ class RefResolver
|
||||
*/
|
||||
public function resolve($schema, $sourceUri = null)
|
||||
{
|
||||
if (self::$depth > 7) {
|
||||
if (self::$depth > self::$maxDepth) {
|
||||
return;
|
||||
}
|
||||
++self::$depth;
|
||||
|
Loading…
x
Reference in New Issue
Block a user