Skip to content

Commit

Permalink
Nit
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Sep 12, 2024
1 parent 6bdc035 commit ffccfbe
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/api/api_specvalidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,20 @@ static function lookup_param_type($n, &$known, $has_suffix) {
if (isset($known[$n])) {
return $known[$n];
}
if (!$has_suffix
|| (($colon = strpos($n, ":")) === false
&& ($slash = strpos($n, "/")) === false)) {
if (!$has_suffix) {
return null;
}
$colon = strpos($n, ":");
$slash = strpos($n, "/");
if ($colon === false || ($slash !== false && $colon > $slash)) {
$colon = $slash;
}
$x = substr($n, $colon);
$t = $known[$x] ?? null;
if ($t !== null && ($t & self::F_SUFFIX) !== 0) {
return $t;
if ($colon !== false) {
$x = substr($n, $colon);
$t = $known[$x] ?? null;
if ($t !== null && ($t & self::F_SUFFIX) !== 0) {
return $t;
}
}
return null;
}
Expand Down

0 comments on commit ffccfbe

Please sign in to comment.