Conversation
|
|
||
| return false; | ||
| } | ||
| } |
|
|
||
| return false; | ||
| } | ||
| } |
| // If we have any kind of error here => false; | ||
| return false; | ||
| } | ||
|
|
libraries/cms/helper/media.php
Outdated
| // If tmp_name is empty, then the file was bigger than the PHP limit | ||
| if (!empty($file['tmp_name'])) | ||
| { | ||
| $result = $this->checkMimeType($file['tmp_name'], $component, true); |
There was a problem hiding this comment.
Change a to an. Add ; after type.
|
Should be fixed now thanks @Quy ! |
This comment was marked as abuse.
This comment was marked as abuse.
|
Uploaded a PDF file and got the error |
| // We have fileinfo | ||
| $finfo = finfo_open(FILEINFO_MIME_TYPE); | ||
| $mime = finfo_file($finfo, $file); | ||
| finfo_close($finfo); |
There was a problem hiding this comment.
Looks like from the test we have cases where none of these things exist!? Probably having a final else statement here with return false to reject everything if we can't detect things is going to be important
|
following |
| } | ||
| elseif ($isImage && function_exists('getimagesize')) | ||
| { | ||
| $imagesize = getimagesize($file); |
There was a problem hiding this comment.
c/s remove outside () since not required.
libraries/cms/helper/media.php
Outdated
|
|
||
| finfo_close($finfo); | ||
| $imagesize = getimagesize($file); | ||
| $mime = (isset($imagesize['mime'])) ? $imagesize['mime'] : false; |
There was a problem hiding this comment.
c/s remove outside () since not required.
|
Except for the cs #16091 (comment) this works for me |
|
I have tested this item ✅ successfully on efc334f This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16091. |
|
set RTC, @infograf768? |
|
Waiting for |
|
Quy's php notices need to be investigated before this can go RTC - clearly in some cases this isn't working fully |
|
@EndeavorC ok i have finaly found something that could be the issue. Please run the following SQL select * from `#__extensions` where `element` = `com_media`;And post the result here. |
|
Hello, When I run the above SQL query in myPHPAdmin I get the following: Error select * from MySQL said: Documentation #1146 - Table '.#__extensions' doesn't exist Sorry this is not much help This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16091. |
|
Yes you need to replace #__ with your database prefix |
|
Error select * from #1054 - Unknown column 'com_media' in 'where clause' This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16091. |
|
If I view the com_media table I have the following, not sure if this is what you are looking for: name: com_media type: component element: com_media manifest_cache: {"name":"com_media","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2017 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_MEDIA_XML_DESCRIPTION","group":"","filename":"media"} params: {"upload_extensions":"bmp,csv,doc,gif,ico,jpg,jpeg,odg,odp,ods,odt,pdf,png,ppt,swf,txt,xcf,xls,BMP,CSV,DOC,GIF,ICO,JPG,JPEG,ODG,ODP,ODS,ODT,PDF,PNG,PPT,SWF,TXT,XCF,XLS","upload_maxsize":"10","file_path":"images","image_path":"images","restrict_uploads":"1","check_mime":"1","image_extensions":"bmp,gif,jpg,png","ignore_extensions":"","upload_mime":"image/jpeg,image/gif,image/png,image/bmp,application/x-shockwave-flash,application/msword,application/excel,application/pdf,application/powerpoint,text/plain,application/x-zip","upload_mime_illegal":"text/html"} This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16091. |
|
This is what I was looking for thanks. Can you please go to the com_media options and save them again. And than try uploading a image from the frontend again? If this still don't work please send me a backup + the file you try to upload to tobias.zulauf[at]community.joomla.org as i'm running out of ideas what the issue could be. And I can not reproduce the problems. |
|
Saving the options did not solve the issue, what type of backup are you asking for? |
|
file and database you can clear the content table if needed. So I can debug the issue. |
|
If I understand all properly I can mention that I have tested this item ✅ successfully on 672e183 |
|
What permissions are you testing with for the user account? I am using an account with publisher. If I replace the media.php file with the one from 3.7.0 it works but not the updated one here or the one that was installed with 3.7.1. I have tried with included editor (TinyMCE) and Ark Editor |
|
I updated to 3.7.2 but still cannot upload PDFs. I cleared the cache, etc. and tried to upload with Super Admin permissions. I still get this error (so clients are still very unhappy). Error |
this means that |
|
I cannot replicate this on our servers https://gws-host.com/systems-technology Imho this is a server issue/settings and not related to Joomla |
Maybe include in the error message that |
|
@Quy which would mean that for every specific hosting config with disabled functions we would have to create exemptions/messages? Does that make sense? |
|
I am having the same problem. Site is hosted with Rochen, PHP 7.0.19. Site is upgraded to 3.7.2, and I am uploading a PDF (131K) as a super user. JPG and PNG files upload without issue, so it's just PDF that's a problem. |
|
Yes please check that one or both php functions are enabled. |
|
I confirm this patch is not working on 3.7.1 and 3.7.2, due to mime_content_type PHP Fatal error: Call to undefined function mime_content_type() in - on line 1 OpenSuse 12.3 has php5-fileinfo extension module that is not installed on the server... fileinfo was not a pre-requisite when installing or updating. |
|
I hope The mime type fatal error is not shown to the user? But yes if both methods are not there there is no upload allowed as we cant check the mime types which is required for Security reasons. |
|
I understand, and I really don't know Joomla developers guidelines and, believe me, I don't want to be rude, but after a hot phone call with one user... PS: I found a similar problem with gzdecode... in this case package php5-zlib is installed but this function is not present.. |
|
@fperillo fileinfo - This extension is enabled by default as of PHP 5.3.0. (http://php.net/manual/en/fileinfo.installation.php) Joomla cannot be expected to tell you every php extension that needs to be enabled especially if it is enabled by default. |
|
My hosting company verified that both are installed but I am still unable to upload image files with 3.7.1 or the updated files. If I use the 3.7.0 files I am able to upload image files. I have not tried PDF files as we use another option for document.
This is becoming very frustrating, the past 2 updates have had serious bugs and/or changes that have greatly impacted the volunteers that use the site.
…________________________________
From: Brian Teeman <notifications@github.com>
Sent: Tuesday, May 23, 2017 5:29:29 PM
To: joomla/joomla-cms
Cc: EndeavorC; Mention
Subject: Re: [joomla/joomla-cms] fix mime checkes (#16091)
@fperillo<https://github.com/fperillo> fileinfo - This extension is enabled by default as of PHP 5.3.0. (http://php.net/manual/en/fileinfo.installation.php)
Joomla cannot be expected to tell you every php extension that needs to be enabled especially if it is enabled by default.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#16091 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/Abe3gQPnxRazydiNkaTC8Mep2XP0VRTFks5r80-5gaJpZM4NeUZi>.
|
|
We are all volunteers as well I see from the system info report that you posted before that you are using the ark editor on your site. If I understand your reports correctly you are able to upload images through the administrator but your editors can not at the front end. Are the editors using the ARK editor or the default tinymce editor? If they are using ARK can you try with the TinyMCe editor. I am not passing any blame here i am just trying to gather all the facts so that we can try to help you |
|
I have tried TinyMCE and ArkEditor from the front end with the same result, for some reason it does not work on the front end. I am not laying any blame but trying to provide what little troubleshooting or helpful information I may be able to provide.
…________________________________
From: Brian Teeman <notifications@github.com>
Sent: Tuesday, May 23, 2017 5:47:16 PM
To: joomla/joomla-cms
Cc: EndeavorC; Mention
Subject: Re: [joomla/joomla-cms] fix mime checkes (#16091)
We are all volunteers as well
I see from the system info report that you posted before that you are using the ark editor on your site. If I understand your reports correctly you are able to upload images through the administrator but your editors can not at the front end. Are the editors using the ARK editor or the default tinymce editor? If they are using ARK can you try with the TinyMCe editor. I am not passing any blame here i am just trying to gather all the facts so that we can try to help you
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#16091 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/Abe3gWawQeYSkGp9nPJpl3LrcjYkmO1xks5r81PkgaJpZM4NeUZi>.
|
|
I have been uploading files through the Media Manager. JPG and PNG work, while PDF does not. I reported this to Rochen, who confirmed that finfo_open and mime_content_type were installed, available, and working correctly. Their response was this: "Well there seems to be compatibility issue with mime_content_type on Joomla version and PHP v7.0, If I switch the PHP version to v5.6 it is working fine. It appears the patch provided isn't working on 3.7.1 and 3.7.2, due to mime_content_type. Thanks!" Previously I was running PHP 7.0.19. |
|
Thanks for the info about php 7.0 - that will hopefully help track it down But as this issue is closed it wont be seen by most people so can I please ask you to open a new issue with this information |
|
I am sorry but I cannot replicate this on our servers (PHP 7.1.14). Neither in default media manager nor in /TinyMCEJCE. I can upload pdf's either from frontend or admin without problems and if pdf's disabled (in media options) I do get the proper message (extension not supported) However: The pdf's show in the file system with FTP (after upload in the media manager but they do not show after upload in the media manager itself in the administrator (they are uploaded as stated since they show in the file manager with ftp) That only happens when uploaded in this case with Tiny/JCE but they show when uploaded with/in the admin panel in the media manager so by using the media manager upload they show but when upload with any editor they don't show despite being listed in the file system (FTP) |
|
Thanks. The PDFs are not supported in the frontend image form. (different issue). As stated above and here #16238 it looks like a server / hosting issue. Here you can find a PR with a better message incase your hosting did disable both checkers: I'm going to lock this issue now. If there are still issues please see #16238 or open a new issue. Thanks. |
Pull Request for Issue #16086
Summary of Changes
If you have installed 3.7.1 and try to upload using com_media a file which is not a image you got an error that you can't upload it.
I have now:
Testing Instructions
Now go to the options and don't allow uploading jpg images and PDF files (by removing the jpg & PDF mime from the allowed mime types
Expected result
If allowed the upload should work if not it should show the mime we detected to the user.
Actual result
non image files can't be uploaded using the media manger
Documentation Changes Required
none.