Skip to content

Commit

Permalink
fix: patch up _method check
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Jan 17, 2025
1 parent 9234617 commit b757da8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public static function methodOverride()
return strtoupper($method);
}

if (static::getOriginalMethod() === 'POST') {
return strtoupper(static::get(static::METHOD_OVERRIDE));
if (static::getOriginalMethod() === 'POST' && $method = static::get(static::METHOD_OVERRIDE)) {
return strtoupper($method);
}

return null;
Expand Down Expand Up @@ -499,7 +499,7 @@ public static function uploadAs(string $key, string $destination, string $name,
$fileExtension = pathinfo($_FILES[$key]['name'], PATHINFO_EXTENSION);

$config['rename'] = true;
$config['name'] = "$name.$fileExtension";
$config['name'] = $name . '.' . $fileExtension;

return static::upload($key, $destination, $config);
}
Expand Down

0 comments on commit b757da8

Please sign in to comment.