mirror of
https://github.com/justinrainbow/json-schema.git
synced 2025-07-15 20:26:36 +02:00
Merge pull request #92 from AwardWallet/master
added configurable maximum recursion depth
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user