Skip to content

Commit 480b8b5

Browse files
committed
I-9 Check not empty openapi field before use it in preg_match
1 parent 72b4826 commit 480b8b5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/spec/OpenApi.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ public function performValidation()
107107
*/
108108
public function getMajorVersion()
109109
{
110+
if (empty($this->openapi)) {
111+
return self::VERSION_UNSUPPORTED;
112+
}
110113
if (preg_match(static::PATTERN_VERSION, $this->openapi, $matches)) {
111114
switch ($matches[1]) {
112115
case '3.0':

0 commit comments

Comments
 (0)