Skip to content

v1.1.0

Latest

Choose a tag to compare

@Thomas-Emad Thomas-Emad released this 24 Jul 12:36
· 8 commits to main since this release

💠 Laravel Google Drive Storage - v1.1.0

🔧 Bug Fixes

  • Fixed a critical issue where calling $file->extension() would throw an error if the provided input was not an instance of UploadedFile.
    The package now properly validates the input type before proceeding, ensuring more robust and secure file handling.

✅ What’s Improved

  • Added type-checking for uploaded files to prevent invalid input (e.g., strings or malformed data) from causing crashes.
  • Improved internal logging for better debugging when invalid files are detected.

📌 Recommendation

If you're accepting user-uploaded files (especially via API), it's strongly recommended to upgrade to this version for better validation and error safety.

✨ Example Code Change

Before:

$fileMetadataArray = [
    'name' => Str::random(10) . '.' . $file->extension(),
];

After:

if (!$file instanceof UploadedFile || !$file->isValid()) {
    Log::error('Expected UploadedFile, got: ' . gettype($file));
    throw new RuntimeException('Invalid or malformed uploaded file.');
}

$fileMetadataArray = [
    'name' => Str::random(10) . '.' . $file->extension(),
];