Repository navigation
fix: tambah signature ekstensi RFM lama (mpeg, mpg, wma, flv, mpga, m4a, ac3, aiff, mid, iso, dmg) - #4
Merged
Conversation
…4a, ac3, aiff, mid, iso, dmg)
andifahruddinakas
force-pushed
the
fix/signature-ekstensi-rfm-lama
branch
from
October 6, 2026 04:58
ddb414a to
e64b4dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Deskripsi
Terkait
OpenSID/OpenSID#12025(tidak bisa upload mp4 ke file manager). Di OpenSID,config/filemanager.phpakan dikembalikan ke daftar ekstensi RFM lama (ext_file,ext_video,ext_music,ext_misc). Masalahnya, sebagian ekstensi itu belum punya signature diFileContentValidator::KNOWN_SIGNATURES. Akibatnya unggahannya selalu ditolak sebagai "unverifiable", walaupun ekstensinya sudah diizinkan.Perubahan
FileContentValidator::KNOWN_SIGNATURES: tambah signature berikut.00 00 01 BA(MPEG-PS pack) /00 00 01 B3(sequence header)30 26 B2 75 8E 66 CF 11FLVID3/ frame sync)ftypdi offset 4 (ISO-BMFF)0B 77FORM+AIFF/AIFCdi offset 8MThdCD001(ISO 9660) /BEA01(UDF) di offset 32769kolydi 512 byte terakhirmatchesKnownSignature(): sebelumnya hanya membaca 512 byte pertama. Sekarang setiap pasangan[offset, bytes]dibaca lewatfseek, sehingga offset jauh (iso) dan offset negatif dari akhir berkas (dmg) bisa dicek. File yang terlalu pendek untuk memuat signature tetap ditolak.<?php,<script, dll.) tetap berjalan untuk semua ekstensi baru.filemanager.extensions.Test
FileContentValidatorTest:vendor/bin/phpunit: 93 tests, 212 assertions, OK.vendor/bin/pint --test: passed.vendor/bin/phpstan analyse: No errors.Checklist