Image Upload Suddenly Stopped Working

Please report bugs here!

Moderator: Thorsten

Post Reply
openeye
Posts: 11
Joined: Thu Mar 28, 2013 6:39 pm

Image Upload Suddenly Stopped Working

Post by openeye »

The Problem
We've recently started getting an error when trying to upload images in the WYSIWYG editor. Unfortunately the errors on our development and production servers are different.

The error on the production server (and the one that clued us in that there was a problem) is: SyntaxError: Unexpected end of input

The error on the development server is: SyntaxError: invalid property id

What I've Tried
I downloaded the latest version from the website, and tried both updating and doing a clean install on our development server. That didn't fix anything.

Note: Before the error showed up, I hadn't made any changes to the software, and our server admin said he hadn't made any changes to the server.

Any help in figuring out what's going on is very much appreciated. We upload a lot of images, so this has put a real kink in our workflow.

Thanks!
Thorsten
Posts: 15562
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Image Upload Suddenly Stopped Working

Post by Thorsten »

Hi,

which browser do you use? Can I check it on your FAQ?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
openeye
Posts: 11
Joined: Thu Mar 28, 2013 6:39 pm

Re: Image Upload Suddenly Stopped Working

Post by openeye »

Now that you've asked about browsers...

In Chrome, the error I get is: SyntaxError: Unexpected end of input

In Firefox, the error I get is: SyntaxError: invalid property id

In IE 11, the error I get is: TypeError: Permission denied

Unfortunately, I don't think there's a way I can have you check it on our installation. We use the API for our client-side stuff, so the site is configured to specifically prevent people outside our IP from viewing it.
Thorsten
Posts: 15562
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Image Upload Suddenly Stopped Working

Post by Thorsten »

Hi,

okay, I'll try to reproduce it.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15562
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Image Upload Suddenly Stopped Working

Post by Thorsten »

Hi,

is it possible to get access to your FAQ? Sadly I cannot reproduce your issue on my test systems with latest Chrome, latest Firefox and IE11.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
openeye
Posts: 11
Joined: Thu Mar 28, 2013 6:39 pm

Re: Image Upload Suddenly Stopped Working

Post by openeye »

is it possible to get access to your FAQ?
Unfortunately, I don't think so because of how we have things set up.

However!

I have managed to whittle things down considerably. The file upload works if I comment out the following:

Code: Select all

        // Check on MIME type to avoid upload of malicious PHP files
        $phpMimeTypes = array(
            'text/php',
            'text/x-php',
            'application/php',
            'application/x-php',
            'application/x-httpd-php',
            'application/x-httpd-php-source'
        );
        $finfo = finfo_open(FILEINFO_MIME_TYPE);
        if (in_array(finfo_file($finfo, $this->_value['tmp_name']), $phpMimeTypes)) {
            return false;
        }
From this file: \admin\editor\plugins\ajaxfilemanager\inc\class.upload.php

Hopefully that sheds some light on things for you.
Thorsten
Posts: 15562
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Image Upload Suddenly Stopped Working

Post by Thorsten »

Hi,

this code prevents uploading PHP files. Please enable the debug mode in inc/Bootstrap.php, re-add the code you removed and try it again to see some errors.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
openeye
Posts: 11
Joined: Thu Mar 28, 2013 6:39 pm

Re: Image Upload Suddenly Stopped Working

Post by openeye »

When I click on the "browse" button next to the URL field, I get this twice at the top of the new window:

Code: Select all

[8]: getimagesize(): Read error! in [faq root directory]\admin\editor\plugins\ajaxfilemanager\inc\class.file.php on line 45
If I attempt to upload an image, I get the JavaScript error I reported previously, but no new errors.
Thorsten
Posts: 15562
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Image Upload Suddenly Stopped Working

Post by Thorsten »

Hi,

okay, I do a deeper investigation.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply