Last modified: 2013-09-04 10:36:29 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T31461, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29461 - Upload file: Special Pages does not allow Office 2007 or 2007 saved as 2003 files to be uploaded.
Upload file: Special Pages does not allow Office 2007 or 2007 saved as 2003 f...
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
1.17.x
PC Linux
: Normal normal with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-17 18:25 UTC by knight_rider1977
Modified: 2013-09-04 10:36 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description knight_rider1977 2011-06-17 18:25:30 UTC
Upon updating from the 1.17beta to the 1.17rc1 the allowing of office 2007 files is still not detecting the correct mime type for .doc and it does not allow .docx files to be uploaded giving the error of "application/x-opc+zip" are not allowed.  The .doc still gives the "File extension does not match MIME type" error.

I attempted to copy the black list to LocalSetting.php and comment out the ones related to office but it crashes the wiki with an internal error:
Internal error
From wikitest
Jump to: navigation, search
error storing file in '/var/tmp/phpdeguPj.docx': directorycreateerror; /var/www/html/wikitest/images/temp/8/8b

Backtrace:

#0 /var/www/html/wikitest/includes/upload/UploadBase.php(634): UploadStash->stashFile('/var/tmp/phpdeg...', Array, NULL)
#1 /var/www/html/wikitest/includes/upload/UploadBase.php(646): UploadBase->stashSessionFile(NULL)
#2 /var/www/html/wikitest/includes/specials/SpecialUpload.php(367): UploadBase->stashSession()
#3 /var/www/html/wikitest/includes/specials/SpecialUpload.php(461): SpecialUpload->showUploadWarning(Array)
#4 /var/www/html/wikitest/includes/specials/SpecialUpload.php(192): SpecialUpload->processUpload()
#5 /var/www/html/wikitest/includes/SpecialPage.php(578): SpecialUpload->execute(NULL)
#6 /var/www/html/wikitest/includes/Wiki.php(251): SpecialPage::executePath(Object(Title))
#7 /var/www/html/wikitest/includes/Wiki.php(63): MediaWiki->handleSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))
#8 /var/www/html/wikitest/index.php(114): MediaWiki->performRequestForTitle(Object(Title), NULL, Object(OutputPage), Object(User), Object(WebRequest))

I tried both a chmod 666 and 777 on the images directory with the same result based on the error storing file.
Comment 1 Mark A. Hershberger 2011-06-20 22:14:00 UTC
(In reply to comment #0)
> Upon updating from the 1.17beta to the 1.17rc1 the allowing of office 2007
> files is still not detecting the correct mime type for .doc and it does not
> allow .docx files to be uploaded giving the error of "application/x-opc+zip"
> are not allowed.

So it didn't work in 1.17betz or 1.17rc1, right?

Did it work in 1.16?

> The .doc still gives the "File extension does not match MIME
> type" error.

This is the correct behavior.
Comment 2 knight_rider1977 2011-06-21 17:36:55 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > Upon updating from the 1.17beta to the 1.17rc1 the allowing of office 2007
> > files is still not detecting the correct mime type for .doc and it does not
> > allow .docx files to be uploaded giving the error of "application/x-opc+zip"
> > are not allowed.
> So it didn't work in 1.17betz or 1.17rc1, right?
> Did it work in 1.16?
> > The .doc still gives the "File extension does not match MIME
> > type" error.
> This is the correct behavior.


Correct, I could not get the .docx to work in 1.17beta, 1.17rc1 or 1.16.

If that is the correct behavior for a .doc then I will have to disable the checking as there are 3 different versions of office being used on site .docx (2007 and 2010 format), .doc (saved from 2007 or 2010) and .doc (saved from 2003).

Thanks
Comment 3 Bawolff (Brian Wolff) 2011-06-21 17:52:17 UTC
Just to clarify, can you upload normal files fine (like a .jpg or some other format that's commonly uploaded).


>If that is the correct behavior for a .doc then I will have to disable the
>checking as there are 3 different versions of office being used on site .docx
>(2007 and 2010 format), .doc (saved from 2007 or 2010) and .doc (saved from
>2003).

Docx files being blacklisted by default is the desired behaviour (concerns over GIFAR vulnerability). However they should be upload-able if application/x-opc+zip is removed from $wgMimeTypeBlacklist, and add to the allowed mime types. The exception about directory creation is not supposed to happen unless MediaWiki really can't create the needed subdirectories, and shouldn't be related to the type of file being uploaded.
Comment 4 knight_rider1977 2011-06-22 15:27:18 UTC
(In reply to comment #3)
> Just to clarify, can you upload normal files fine (like a .jpg or some other
> format that's commonly uploaded).

Other uploads seem to work fine in the live 1.16.5  I just just tried my test 1.16.5 and 1.17rc1 on a seperate machine and .jpg is having issues uploading.  Complaining about not being able to create directory public/?/?? mode 511.  Which I must have missed a directory change.  Is the directory documents are stored in not "images"?  The error makes sense as I cannot seem to find a directory "public" directory anywhere.  It is saying the error is occuring in GlobalFunctions.php line 2179.

I'm thinking I should just make a fresh install of 1.17 now that is released.  Then migrate the settings and data from the live wiki backup to the test environment and go from there.  If that resolves it I will change the allowed list and see if that appeases the end users of the wiki.  It is very possible that trying some of the things people have done to get around the uploading issue has caused some corruption that finially decided to show its face.    


Thanks!

> >If that is the correct behavior for a .doc then I will have to disable the
> >checking as there are 3 different versions of office being used on site .docx
> >(2007 and 2010 format), .doc (saved from 2007 or 2010) and .doc (saved from
> >2003).
> Docx files being blacklisted by default is the desired behaviour (concerns over
> GIFAR vulnerability). However they should be upload-able if
> application/x-opc+zip is removed from $wgMimeTypeBlacklist, and add to the
> allowed mime types. The exception about directory creation is not supposed to
> happen unless MediaWiki really can't create the needed subdirectories, and
> shouldn't be related to the type of file being uploaded.
Comment 5 Bryan Tong Minh 2011-06-22 19:07:36 UTC
(In reply to comment #4) 
> Complaining about not being able to create directory public/?/?? mode 511. 
> Which I must have missed a directory change.  Is the directory documents are
> stored in not "images"?  The error makes sense as I cannot seem to find a
> directory "public" directory anywhere.  It is saying the error is occuring in
> GlobalFunctions.php line 2179.
> 
"public" is a placeholder which is automatically replaced by $wgUploadPath, because some people do not appreciate leaking this path to the outside world.
Comment 6 Bawolff (Brian Wolff) 2011-06-23 02:50:21 UTC
>"public" is a placeholder which is automatically replaced by $wgUploadPath,
>because some people do not appreciate leaking this path to the outside world.

Of course the jokes on them because image magick leaks that in the image metadata on any (png) thumb it makes :D
Comment 7 matanya 2012-07-19 18:51:30 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Just to clarify, can you upload normal files fine (like a .jpg or some other
> > format that's commonly uploaded).
> 
> Other uploads seem to work fine in the live 1.16.5  I just just tried my test
> 1.16.5 and 1.17rc1 on a seperate machine and .jpg is having issues uploading. 
> Complaining about not being able to create directory public/?/?? mode 511. 
> Which I must have missed a directory change.  Is the directory documents are
> stored in not "images"?  The error makes sense as I cannot seem to find a
> directory "public" directory anywhere.  It is saying the error is occuring in
> GlobalFunctions.php line 2179.
> 
> I'm thinking I should just make a fresh install of 1.17 now that is released. 
> Then migrate the settings and data from the live wiki backup to the test
> environment and go from there.  If that resolves it I will change the allowed
> list and see if that appeases the end users of the wiki.  It is very possible
> that trying some of the things people have done to get around the uploading
> issue has caused some corruption that finially decided to show its face.    
> 
> 
> Thanks!
> 
> > >If that is the correct behavior for a .doc then I will have to disable the
> > >checking as there are 3 different versions of office being used on site .docx
> > >(2007 and 2010 format), .doc (saved from 2007 or 2010) and .doc (saved from
> > >2003).
> > Docx files being blacklisted by default is the desired behaviour (concerns over
> > GIFAR vulnerability). However they should be upload-able if
> > application/x-opc+zip is removed from $wgMimeTypeBlacklist, and add to the
> > allowed mime types. The exception about directory creation is not supposed to
> > happen unless MediaWiki really can't create the needed subdirectories, and
> > shouldn't be related to the type of file being uploaded.

maybe if you set chmod 777 on images directory it will work.
Comment 8 Andre Klapper 2013-04-26 12:11:35 UTC
Is this still an issue in 1.19 or 1.20?
Comment 9 Derk-Jan Hartman 2013-04-26 12:29:46 UTC
Likely yes. The behavior changed in 1.17, you needed to explicitly enable doc and docx uploads and allow opc

In 1.19 (or there about) Tim added the detectZipType, that makes it so that you no longer need to remove 'opc' files from the mimeblacklist.

However, that leaves bug 38432 as a bug between 1.19 and trunk. This isuse is probably affected by all those changes, and I don't think any of it was ever backported.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links