Remove file format restrictions for Logos

Remove file format restrictions for Logos

by stefan weber -
Number of replies: 3
Picture of Plugin developers

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

Average of ratings: -
In reply to stefan weber

Re: Remove file format restrictions for Logos

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of 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.

In reply to Richard Oelmann

Re: Remove file format restrictions for Logos

by stefan weber -
Picture of Plugin developers

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.

In reply to stefan weber

Re: Remove file format restrictions for Logos

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of 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.