Closed jakejohns closed 8 years ago
@harikt Are you saying you think we should use the fileinfo extension to validate the MIME/MediaType rather than use the interfaces getClientMediaType
method? Your comment is under the "extension" instead.
While I agree its a better mime validation, I wonder if it's a different scope being that it would not correspond to the output of methods provided by the interface.
Additionally, I wonder if a check on the entirety of the file name makes sense:
<?php
//...
protected function filename($value, $expr)
{
$filename = $value->getClientFilename();
return (bool) preg_match($expr, $filename);
}
@jakejohns you are correct. I was thinking about the mime/media type. It looks the psr-7 keeps the media type. But not sure whether it validates it.
Well, hell. I failed to anticipate that this would need the PSR-7 interface, and in 2.x, we don't allow for external packages. :-/ At best this would have to go into a 3.x version, or perhaps as a non-official Aura package of filters.
Thoughts?
@pmjones why do we need to worry about moving to major version. I am :+1: for pushing major versions.
/me nods
No reason not to start a 3.x branch now, I guess. I have just created one. @jakejohns if you want to rebase against that (or resubmit against that) feel free to do so!
I dont think I can just change the base of the pr, so closing here.
Here's an attempt at implementing #111. Note, I did raise some concerns about this "combined" approach on that issue.
Thoughts?