diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties new file mode 100644 index 0000000..2d69fd5 --- /dev/null +++ b/nbproject/private/private.properties @@ -0,0 +1,5 @@ +copy.src.files=false +copy.src.target=/home/da/public_html/CakePHP-FileUpload-Plugin +index.file= +run.as=LOCAL +url=http://localhost/CakePHP-FileUpload-Plugin/ diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 0000000..6ffde2f --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,7 @@ +include.path=${php.global.include.path} +php.version=PHP_5 +source.encoding=UTF-8 +src.dir=. +tags.asp=false +tags.short=true +web.root=. diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..243ac48 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,9 @@ + + + org.netbeans.modules.php.project + + + CakePHP-FileUpload-Plugin + + + diff --git a/vendors/uploader.php b/vendors/uploader.php index 39f7205..131adb9 100644 --- a/vendors/uploader.php +++ b/vendors/uploader.php @@ -136,7 +136,8 @@ function processFile($file = null){ //if callback returns false hault the upload if(!$fileName){ return false; - } + } + $fileName = $this->clearUTF($fileName); $target_path = $up_dir . DS . $fileName; $target_path = $this->__handleUnique($target_path); @@ -343,5 +344,18 @@ function _multiArrayKeyExists($needle, $haystack) { return false; } + function clearUTF($s){ + setlocale(LC_ALL, 'en_US.UTF8'); + $r = ''; + $s1 = iconv('UTF-8', 'ASCII//TRANSLIT', $s); + for ($i = 0; $i < strlen($s1); $i++){ + $ch1 = $s1[$i]; + $ch2 = mb_substr($s, $i, 1); + + $r .= $ch1=='?'?$ch2:$ch1; + } + return $r; + } + } ?>