From 43e6b776c761b6960ec27661765de9774188125a Mon Sep 17 00:00:00 2001 From: Vladimir Silantyev Date: Wed, 12 Feb 2014 14:19:08 +0600 Subject: [PATCH 1/2] added configurable maximum recursion depth --- src/JsonSchema/RefResolver.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/JsonSchema/RefResolver.php b/src/JsonSchema/RefResolver.php index 17b2c141..fcce496b 100644 --- a/src/JsonSchema/RefResolver.php +++ b/src/JsonSchema/RefResolver.php @@ -27,6 +27,11 @@ class RefResolver * @var integer */ protected static $depth = 0; + /** + * maximum references depth + * @var integer + */ + public static $maxDepth = 7; /** * @var UriRetrieverInterface @@ -88,7 +93,7 @@ public function getUriRetriever() */ public function resolve($schema, $sourceUri = null) { - if (self::$depth > 7) { + if (self::$depth > self::$maxDepth) { return; } ++self::$depth; From ac1316687c816ee11d0c764e5ab51018007b56b4 Mon Sep 17 00:00:00 2001 From: Vladimir Silantyev Date: Wed, 5 Mar 2014 15:00:30 +0600 Subject: [PATCH 2/2] https://github.com/justinrainbow/json-schema/pull/92 --- src/JsonSchema/RefResolver.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/JsonSchema/RefResolver.php b/src/JsonSchema/RefResolver.php index fcce496b..691314cf 100644 --- a/src/JsonSchema/RefResolver.php +++ b/src/JsonSchema/RefResolver.php @@ -27,11 +27,12 @@ class RefResolver * @var integer */ protected static $depth = 0; - /** - * maximum references depth - * @var integer - */ - public static $maxDepth = 7; + + /** + * maximum references depth + * @var integer + */ + public static $maxDepth = 7; /** * @var UriRetrieverInterface