PKP Bugzilla – Bug 6689
Cover image upload does not check file type
Last modified: 2012-06-06 15:27:10 PDT
Cover image upload does not check file type. It should ensure file types in the usual set (.jpg, .gif, .png).
Created attachment 3565 [details]
Patch against OJS 2.3.0, 2.3.1, 2.3.2
Created attachment 3566 [details]
Patch against OJS 2.3.3, 2.3.4, 2.3.5
Created attachment 3567 [details]
Patch against OJS 2.2.1, 2.2.2, 2.2.3, 2.2.4
Could you also allow .pdf files as cover images? We're planning on using pdf files for cover images for our journal. Thanks.
jayfitzsimmons -- probably not something we'd integrate into the codebase, but you can allow PDFs by modifying lib/pkp/classes/file/FileManager.inc.php in the getImageExtension function and adding a PDF entry. You'd also have to modify the template that displays these (templates/issue/issue.tpl) as the usual <img ...> tag won't work with PDFs.
Ok - thank you Alec.
I patched our OJS 2.3.4 installation with the appropriate patch (that fixes MetadataForm.inc.php file), but the form at /ojs/<journal-name>/editor/issueData/ still accepts other file types. I could upload for example a file named "setup.exe", the image however was not showing, but I can see the file in the "public" directory, renamed as "cover... .exe"
Ales, we're currently reviewing our file upload code to ensure that there aren't additional problems. Watch for an additional Bugzilla entry on our recommended patches page at http://pkp.sfu.ca/wiki/index.php/OJS_2.3.5_Recommended_Patches (we may or may not back-port fixes to prior versions, depending on severity).
We are running Open Journal Systems 188.8.131.52. Is there a patch provided for this version, or is it not affected?
Thanks a lot for your help.
Tom, OJS 2.2.0 and prior are not affected.