I'm currently using plupload module version 7.x-1.0, and I'm using it in multilingual website (english, arabic) when I'm on the English interface everything is normal and working fine, but in the arabic interface, when I upload an image with arabic name (multibyte language) I got error about the file extension, and after tracing I found :

...
$value = rtrim(basename($value), '.');
...

in line 152, plupload.module, basename() is locale aware that mean that we have to tell it which language it should use before we call it, but here I tried the best solution for me here as I'm using translitration module, I just patched the module and moved transliteration_clean_filename() function to be before basename() call, the attached patch do this, please if there is better way to do this please inform me about it.

Thanks,
Ma'moun othman

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

slashrsm’s picture

Hm.. the same code is currently located ~40 lines below. Would it make sense to move it up before basename()?

What error exactly do you get?

artofeclipse’s picture

Sorry my is not clean I just moved the transliteration_clean_filename() function before the basename() function, the file I tried to upload is named in arabic and because of that the name get removed on execution of basename() on it, All what I did in my patch is I moved the code before the basename() function execution.

slashrsm’s picture

Status: Active » Needs review
FileSize
1.1 KB

Would this work?

slashrsm’s picture

Issue summary: View changes

remove the arabic image text, cause the image can't be uploaded.