Subject: | fileparse fstype not reset after change |
In _handle_file, fileparse_set_fstype is called to change the fstype for fileparse. It is not reset at the end of the sub, so the script using CGI::Upload to retrieve files will have later calls to fileparse use the HTTP::BrowserDetect-informed fstype used.
The current value should be stored and reset. Store it at assign-time with:
my $original_os = fileparse_set_fstype($client_os);
and restore it later with
fileparse_set_fstype($original_os);
Otherwise, this leads to heisenberg-like bugs.