@@ -33,9 +33,9 @@ class UriRetriever implements BaseUriRetrieverInterface
33
33
);
34
34
35
35
/**
36
- * @var array A blacklist for media type check exclusion
36
+ * @var array A list of endpoints for media type check exclusion
37
37
*/
38
- protected $ mediaTypeBlacklist = array (
38
+ protected $ allowedInvalidContentTypeEndpoints = array (
39
39
'http://json-schema.org/ ' ,
40
40
'https://json-schema.org/ '
41
41
);
@@ -53,13 +53,13 @@ class UriRetriever implements BaseUriRetrieverInterface
53
53
private $ schemaCache = array ();
54
54
55
55
/**
56
- * Adds an endpoint to the media type validation blacklist
56
+ * Adds an endpoint to the media type validation exclusion list
57
57
*
58
58
* @param string $endpoint
59
59
*/
60
- public function addBlacklistedEndpoint ($ endpoint )
60
+ public function addInvalidContentTypeEndpoint ($ endpoint )
61
61
{
62
- $ this ->mediaTypeBlacklist [] = $ endpoint ;
62
+ $ this ->allowedInvalidContentTypeEndpoints [] = $ endpoint ;
63
63
}
64
64
65
65
/**
@@ -83,8 +83,8 @@ public function confirmMediaType($uriRetriever, $uri)
83
83
return ;
84
84
}
85
85
86
- for ($ i = 0 , $ iMax = count ( $ this ->mediaTypeBlacklist ); $ i < $ iMax ; $ i ++ ) {
87
- if (stripos ($ uri , $ this -> mediaTypeBlacklist [ $ i ] ) === 0 ) {
86
+ foreach ($ this ->allowedInvalidContentTypeEndpoints as $ endpoint ) {
87
+ if (strpos ($ uri , $ endpoint ) === 0 ) {
88
88
return true ;
89
89
}
90
90
}
0 commit comments