Last modified: 2014-05-23 00:38:54 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 T33752, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31752 - wfShellExec destroys unicode characters if no utf-8 locale available on the system
wfShellExec destroys unicode characters if no utf-8 locale available on the s...
Status: NEW
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.20.x
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-16 14:17 UTC by DaSch
Modified: 2014-05-23 00:38 UTC (History)
3 users (show)

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


Attachments

Description DaSch 2011-10-16 14:17:44 UTC
When switching from PHPs Image converting to ImageMagick it does not work an I get the following error

Fehler beim Erstellen des Vorschaubildes: convert: unable to open image `/var/www/vhosts/wecowi.de/httpdocs/images/1/16/TBBT_5-06_Sheldons_Mutter_zu_Besuch_-_groe_Runde.jpg': No such file or directory @ blob.c/OpenBlob/2480.
convert: missing an image filename `/var/www/vhosts/wecowi.de/httpdocs/images/thumb/1/16/TBBT_5-06_Sheldons_Mutter_zu_Besuch_-_groe_Runde.jpg/300px-TBBT_5-06_Sheldons_Mutter_zu_Besuch_-_groe_Runde.jpg' @ convert.c/ConvertImageCommand/2838.

The name of the File is TBBT 5-06 Sheldons Mutter zu Besuch - große Runde.jpg
convert seams to ignore the ß in the filename

Permissions are okay, because when turning imagemagick off it works
So it seams that the commands generated for imagemagick are not UTF-8 safe
Comment 1 DaSch 2011-10-16 14:21:42 UTC
And at the same time the converting of images with only ASCII characters works with ImageMagick
Comment 2 DaSch 2011-10-16 15:26:26 UTC
Well the problem appears when locals on the server are not in UTF-8
I added a HowTo to mediawiki
http://www.mediawiki.org/wiki/Manual:Errors_and_symptoms#Image_Thumbnails_not_working_and.2For_appearing

But maybe this should be checked somehow
Comment 3 DaSch 2011-10-16 17:26:36 UTC
Maybe something like a diagnosis special page would be helpful?
Comment 4 Bryan Tong Minh 2011-10-16 17:54:43 UTC
Is there something left that we can do to fix this error on the MediaWiki side? It's more like a server config problem.

Perhaps that the installer can trigger a warning if the locale is set wrong.
Comment 5 DaSch 2011-10-16 18:10:11 UTC
Yes that would be a good idea
I also started this extension
http://www.mediawiki.org/w/index.php?title=Special:Code/MediaWiki&path=%2Ftrunk%2Fextensions%2FDiagnosis
Which could help to find possible problems
Comment 6 Brion Vibber 2011-10-16 18:24:37 UTC
Looks like wfInitShellLocale() tries to force a UTF-8 locale to work around http://bugs.php.net/bug.php?id=45132 where escapeshellarg() destroys the non-ASCII chars if your locale isn't properly set to UTF-8. (r41379)

I presume that's not working on a system that has missing or broken UTF-8 locales? (ick!)

IMHO any non-UTF8 locale should be quietly laid to rest in this day and age, but it's nicer to just not have to run into the problem. ;)

If this is only a bug in escapeshellarg(), maybe we should just give up and implement it ourselves -- wfEscapeShellArg() already does that for Windows, where the stock escapeshellarg() is wildly incorrect.
Comment 7 DaSch 2011-10-16 20:06:17 UTC
I think the best way would be to check if UTF-8 is in locales under Linux and go the "windows way" if it's not available
The point is, that on many minimal installation of linux UTF-8 is not set up

For regonition of such problems still a SpecialPage like the suggested in my extension would be helpful

Something that other PHP-Software like Joomla or Piwik already have
Comment 8 Brion Vibber 2011-10-19 18:59:27 UTC
Why bother messing with the locale stuff is the only thing we need it for is to work around a broken escapeshellarg()?

(Offhand I'm not sure where these non-UTF8 Linux systems are coming from, I guess I'm just spoiled by using mainstream distros for the last decade, which seem to all default to UTF-8. ;)
Comment 9 DaSch 2011-10-19 19:24:10 UTC
I got this non-UTF-8 Linux with my V-Server, it's just a minimalistic installation of Ubuntu. That's not about the distro, but about the typ of installation.

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


Navigation
Links