mirror of
https://github.com/justinrainbow/json-schema.git
synced 2025-07-16 04:36:38 +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;
|
protected static $depth = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* maximum references depth
|
||||||
|
* @var integer
|
||||||
|
*/
|
||||||
|
public static $maxDepth = 7;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var UriRetrieverInterface
|
* @var UriRetrieverInterface
|
||||||
*/
|
*/
|
||||||
@ -89,7 +95,7 @@ class RefResolver
|
|||||||
*/
|
*/
|
||||||
public function resolve($schema, $sourceUri = null)
|
public function resolve($schema, $sourceUri = null)
|
||||||
{
|
{
|
||||||
if (self::$depth > 7) {
|
if (self::$depth > self::$maxDepth) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
++self::$depth;
|
++self::$depth;
|
||||||
|
Reference in New Issue
Block a user