Remove file format restrictions for Logos

Remove file format restrictions for Logos

par stefan weber,
Nombre de réponses : 3

Right now, the only accepted formats to upload logos in the appearance menu are  .PNG and .JPG.

This seems unnecessarily restricted, since nowadays browsers can display many other formats just fine, including vector-based ones like .svg that look much better when scaling, and are already used in other places in Moodle.

I started a tracker item to request that change, which should be trivial, since only the check for correct file extensions has to be removed:

https://tracker.moodle.org/browse/MDL-61963

Moyenne des évaluations: -
En réponse à stefan weber

Re: Remove file format restrictions for Logos

par Richard Oelmann,
Avatar Core developers Avatar Plugin developers Avatar Testers

Surely its not as simple as removing the file extension check - you'd still need to ensure someone doesn't upload a zip/pdf/exe/doc/ whatever. Isn't the requirement to add the alternative file formats such as svg to the permitted list.

En réponse à Richard Oelmann

Re: Remove file format restrictions for Logos

par stefan weber,

yes, obviously you could just add other file formats to the extension check

the obvious aside, whats the point in preventing admins from being stupid? i would trust a moodle admin not to upload a non-working logo, and if he does, no harm, it just wont be displayed.

En réponse à stefan weber

Re: Remove file format restrictions for Logos

par Richard Oelmann,
Avatar Core developers Avatar Plugin developers Avatar Testers

There's a lot in Moodle (and other websites) that is aimed at stopping admins and other users from doing something stupid - all kinds of input gets cleaned, or prevented in the first place.

I (personally) don't see any benefit in removing such conditions and then dealing in the forums with the 'my logo wont display - its a RAW/Base64/pdf/ico file' or any other kind of file that the software just isn't intended to handle, or displays slightly differently.

Of course you are always free to comment out that line yourself anyway, but my personal feeling would be to add the alternative acceptable formats in to the existing control rather than remove it altogether.