pionl / laravel-chunk-upload

The basic implementation for chunk upload with multiple providers support like jQuery-file-upload, pupload, DropZone and resumable.js
MIT License
617 stars 167 forks source link

Address preg_match deprecation notice when sending null to second argument. #167

Closed RTippin closed 8 months ago

RTippin commented 8 months ago

When using HandlerFactory::classFromRequest($request), this causes all handlers to check canBeUsedForRequest, thus newing up each handler. When we get to ContentRangeUploadHandler, the $contentRange would be null if we were not intending to use that handler for any case. Passing null as the subject to preg_match is deprecated.

Simple fix is to utilize the second argument for header and pass empty string as default.

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Tests pass? ✔️
Fixed issues https://github.com/pionl/laravel-chunk-upload/issues/156
pionl commented 8 months ago

All green, thank you!

Snímek obrazovky 2024-03-25 v 16 49 43