Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Medien-Modul: Fehler bei bestimmten Dateinamen #423

Open
blackcoder87 opened this issue Feb 9, 2020 · 1 comment
Open

Medien-Modul: Fehler bei bestimmten Dateinamen #423

blackcoder87 opened this issue Feb 9, 2020 · 1 comment
Labels
Priority: Medium Type: Bug The issue documents broken, incorrect, or confusing behavior.

Comments

@blackcoder87
Copy link
Member

URL ist in diesem Fall falsch und es wird kein Thumbnail erstellt.

https://github.com/IlchCMS/Ilch-2.0/blob/master/application/libraries/Ilch/Upload.php#L146
https://github.com/IlchCMS/Ilch-2.0/blob/master/application/libraries/Ilch/Upload.php#L320

@blackcoder87 blackcoder87 added Type: Bug The issue documents broken, incorrect, or confusing behavior. Priority: Medium labels Feb 9, 2020
@blackcoder87
Copy link
Member Author

blackcoder87 commented Feb 9, 2020

"きつね.jpg" oder "2 (2).jpg". Das Problem ist in der getName(). Wenn ich die replace()-Geschichte entferne funktionieren Namen wie "2 (2).jpg", aber japanische Schriftzeichen im Dateinamen kriegt hier PHP an sich nicht hin. In dem Fall gibt es hier schon einen Fehler:
https://github.com/IlchCMS/Ilch-2.0/blob/master/application/libraries/Ilch/Upload.php#L280

https://stackoverflow.com/questions/9659600/glob-cant-find-file-names-with-multibyte-characters-on-windows
https://stackoverflow.com/questions/977635/how-to-open-file-in-php-that-has-unicode-characters-in-its-name
https://stackoverflow.com/questions/10008341/list-directories-containing-unicode-characters-on-windows

Wenn im upload-Ordner eine Datei liegt mit z.B. folgenden Namen "avatar-69x80 (1).png" und man diese dann im Admincenter unter Medien und dort "Import neue Datei(en)" importieren will, wird folgender Fehler angezeigt:

Warning: filesize(): stat failed for application/modules/media/static/upload/avatar-69x80(1).png in application\libraries\Ilch\Upload.php on line 280

Hier wurden ein paar Änderungen vorgenommen:
2c8c0a6

Mit PHP 7 und neuer sieht die Situation auch schon besser aus.
Siehe auch hier: https://stackoverflow.com/a/28220640

Lokal habe ich das hier unter Windows mit XAMPP (PHP 7.3.0) getestet und in dieser Version kann PHP schon ab Werk mit Umlauten usw. umgehen. Probleme gibt es allerdings z.B. noch mit japanischen Schriftzeichen.

PHP 5.6 und 7.0 werden übrigens offiziell schon nicht mehr unterstützt:
http://php.net/supported-versions.php

Einige offiziell Unterstützten Versionen von Linux-Distributionen nutzen allerdings noch diese älteren Versionen.
Debian 8 = PHP 5.6
Debian 9 = PHP 7.0
Ubuntu 16.04 LTS = PHP 7.0
openSUSE Tumbleweed = PHP 7.0

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Priority: Medium Type: Bug The issue documents broken, incorrect, or confusing behavior.
Projects
None yet
Development

No branches or pull requests

1 participant