03-09-2012, 02:36 PM
Before submitting a JS based drag and drop implementation, I wanted to address an issue i run to.
Issue: Error when adding document
Steps to reproduce:
1. Navigate to out.AddDocument.php
2. Add a single file with Unicode characters in its name, something like "Πληρωμή 2012-02-10 ΕΥΑΘ ΓΚ.pdf"
3. The document is added and shown in out.ViewFolder.php
4. The document is accessible in out.ViewDocument.php as it should, but in version file details it displays 'Document deleted'. The actual file in directory exists under name '1 ΕΥΑΘ ΓΚ.pdf'.
Alternative steps:
1. Navigate to out.AddDocument.php
2. Add two or more files with Unicode characters in its name
3. An error occured message is displayed.
4. A document is added and shown in out.ViewFolder.php with the first file name.
5. The document is accessible in out.ViewDocument.php as it should, but in version file details it displays 'Document deleted'. The actual file in directory exists. The remaining documents are not added but there is a directory with the id of the next file.
Version affecting: v3.3.0
PHP version: v5.3.2
MySQL version: 5.1.41
Server OS: Ubuntu Server 10.04.4
Client OS: Ubuntu Desktop 11.10
As far as I traced the program, I believe that the issue begins in
op.AddDocument.php, line 148
My understanding is that there is some issue with basename php function. Basename is locale aware, but unfortunately setlocale() as suggested in php.net does not seem to solve the issue.
At this point, I am not entirely sure if this is a problem with the setup of PHP on my server, or a PHP bug in basename for greek locale as some people seem to suggest. Other vhosts seem to run successfuly other sites like Drupal and Joomla with success, but then again I don't know if these packages use basename somewhere and how they deal with locale.
My temporary solution was to remove the call to basename from lines 148 and 164 as it seems that the PHP $_FILES[]["name"][] contains the base filename anyway without path.
I hope the above details are satisfactory. Apologies in advance if my speculations are off limit in an attempt to help as much as I can. Of course any suggestions are welcome.
Kind Regards,
Wtower
Issue: Error when adding document
Steps to reproduce:
1. Navigate to out.AddDocument.php
2. Add a single file with Unicode characters in its name, something like "Πληρωμή 2012-02-10 ΕΥΑΘ ΓΚ.pdf"
3. The document is added and shown in out.ViewFolder.php
4. The document is accessible in out.ViewDocument.php as it should, but in version file details it displays 'Document deleted'. The actual file in directory exists under name '1 ΕΥΑΘ ΓΚ.pdf'.
Alternative steps:
1. Navigate to out.AddDocument.php
2. Add two or more files with Unicode characters in its name
3. An error occured message is displayed.
4. A document is added and shown in out.ViewFolder.php with the first file name.
5. The document is accessible in out.ViewDocument.php as it should, but in version file details it displays 'Document deleted'. The actual file in directory exists. The remaining documents are not added but there is a directory with the id of the next file.
Version affecting: v3.3.0
PHP version: v5.3.2
MySQL version: 5.1.41
Server OS: Ubuntu Server 10.04.4
Client OS: Ubuntu Desktop 11.10
As far as I traced the program, I believe that the issue begins in
PHP Code:
$lastDotIndex = strrpos(basename($userfilename), ".");
My understanding is that there is some issue with basename php function. Basename is locale aware, but unfortunately setlocale() as suggested in php.net does not seem to solve the issue.
At this point, I am not entirely sure if this is a problem with the setup of PHP on my server, or a PHP bug in basename for greek locale as some people seem to suggest. Other vhosts seem to run successfuly other sites like Drupal and Joomla with success, but then again I don't know if these packages use basename somewhere and how they deal with locale.
My temporary solution was to remove the call to basename from lines 148 and 164 as it seems that the PHP $_FILES[]["name"][] contains the base filename anyway without path.
I hope the above details are satisfactory. Apologies in advance if my speculations are off limit in an attempt to help as much as I can. Of course any suggestions are welcome.
Kind Regards,
Wtower