Fix an error when scanning WAV file via an externally opened file pointer #298
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem fixed by this PR is similar to the one reported earlier in #242. The problem was fixed for MP3 and several other file types in 276fd3e but the WAV files were missed at that time. Since then, also support for DSDIFF files has been added with the same problem.
To recap, the problem case is when the file being analyzed is passed to getID3 as a file pointer without giving a fully qualified file path. When the file type specific module then spawns a secondary instance of getID3, it has to pass it also the filesize given by the client application. If null is passed as filesize to
getID3::openfile
, then it tries to obtain the filesize from the system using the filename. But this will fail if the filename is not fully qualified.For the very least, the failing attempt to read the file size causes an error message like
Error: filesize(): stat failed for /username/path/to/song/17 Chanson d'Automne.wav at /var/www/nextcloud/apps/music/3rdparty/getID3/getid3/getid3.php#468
to be logged. But probably it may cause also more severe issues, depending on the used PHP and/or server configuration.Here is a related application issue: owncloud/music#837