to be rigorous, the regex should have a non-capturing pattern : `'/^form-data; *name="([^"]+)"(?:; *filename="([^"]+)")?/'`

and so, instead of `$matches[3]`, use `$matches[2]`