@@ -61,7 +61,8 @@ private function proceedSingleUpload($file)
6161 ->save ($ new_file_path , 90 );
6262
6363 $ this ->makeThumb ($ new_filename );
64- } else {
64+ }
65+ {
6566 chmod ($ file ->getRealPath (), 0644 ); // TODO configurable
6667 File::move ($ file ->getRealPath (), $ new_file_path );
6768 }
@@ -122,7 +123,7 @@ private function uploadValidator($file)
122123
123124 private function getNewName ($ file )
124125 {
125- $ new_filename = parent ::translateFromUtf8 (trim (pathinfo ($ file ->getClientOriginalName (), PATHINFO_FILENAME )));
126+ $ new_filename = parent ::translateFromUtf8 (trim ($ this -> _pathinfo ($ file ->getClientOriginalName (), PATHINFO_FILENAME )));
126127
127128 if (config ('lfm.rename_file ' ) === true ) {
128129 $ new_filename = uniqid ();
@@ -166,4 +167,19 @@ function getUrlParam(paramName) {
166167 if (o !== false) o.CKEDITOR.tools.callFunction(funcNum, ' $ file');
167168 </script> " ;
168169 }
170+
171+ private function _pathinfo ($ path , $ options = null )
172+ {
173+ $ path = urlencode ($ path );
174+ $ parts = is_null ($ options ) ? pathinfo ($ path ) : pathinfo ($ path , $ options );
175+ if (is_array ($ parts )) {
176+ foreach ($ parts as $ field => $ value ) {
177+ $ parts [$ field ] = urldecode ($ value );
178+ }
179+ } else {
180+ $ parts = urldecode ($ parts );
181+ }
182+
183+ return $ parts ;
184+ }
169185}
0 commit comments