Fixed Fix detection of Opus audio files with .opus instead of .ogg extension

Steffen

Well-known member
Affected version
2.2.7
Opus audio files can be uploaded (and rendered as an audio player) when they have a ".ogg" extension. XenForo doesn't recognize them when they have the recommended ".opus" extension (https://en.wikipedia.org/wiki/Opus_(audio_format)). This is easy to fix. :)

Diff:
diff --git a/src/XF/App.php b/src/XF/App.php
index 51395a939..7cf644589 100644
--- a/src/XF/App.php
+++ b/src/XF/App.php
@@ -349,6 +349,7 @@ class App implements \ArrayAccess
             return [
                 'mp3' => 'audio/mpeg',
                 'ogg' => 'audio/ogg',
+                'opus' => 'audio/ogg',
                 'wav' => 'audio/wav',
             ];
         };

Opus has universal browser support: https://caniuse.com/opus
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.8).

Change log:
Add .opus as a supported audio file extension
There may be a delay before changes are rolled out to the XenForo Community.
 
Has this been implemented? When I attach a file with the .opus extension to a post, the extension gets changed to .ogg during the process. If I then download the .ogg file, it still plays back as Opus. So it seems that XF automatically encapsulates Opus files in the Ogg container. Why does this happen, and can it be avoided? We use Opus files as digital products, and changing their extensions is very misleading.

Does it have to do with the missing 'audio/opus' for 'opus' in the @Steffen’s snippet above?
 
Last edited:
Has this been implemented? When I attach a file with the .opus extension to a post, the extension gets changed to .ogg during the process. If I then download the .ogg file, it still plays back as Opus. So it seems that XF automatically encapsulates Opus files in the Ogg container. Why does this happen, and can it be avoided? We use Opus files as digital products, and changing their extensions is very misleading.

Does it have to do with the missing 'audio/opus' for 'opus' in the @Steffen’s snippet above?
It says it was implemented in 2.2.8 which was quite a while ago. If you're on a current release (2.3), best to open a new bug report since this one is closed. If you're on a version of 2.2 prior to 2.2.8, then you need to upgrade to get the fix.
 
It says it was implemented in 2.2.8 which was quite a while ago. If you're on a current release (2.3), best to open a new bug report since this one is closed. If you're on a version of 2.2 prior to 2.2.8, then you need to upgrade to get the fix.
The issue is present on this forum.
 
Back
Top Bottom