We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db06d33 commit 779afadCopy full SHA for 779afad
src/Log/Webhook.php
@@ -122,7 +122,14 @@ public function setup(array $options)
122
throw new Exception('no uri given');
123
}
124
125
- if (!filter_var($options['uri'], FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED)) {
+ // PHP >7.2 deprecated the filter options and enabled them by default
126
+ if (version_compare(PHP_VERSION, '7.2.0', '<')) {
127
+ $filterOptions = FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED;
128
+ } else {
129
+ $filterOptions = null;
130
+ }
131
+
132
+ if (!filter_var($options['uri'], FILTER_VALIDATE_URL, $filterOptions)) {
133
throw new Exception('webhook URI is invalid');
134
135
0 commit comments