File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ private function uploadValidator($file)
122122
123123 private function getNewName ($ file )
124124 {
125- $ new_filename = parent ::translateFromUtf8 (trim (pathinfo ($ file ->getClientOriginalName (), PATHINFO_FILENAME )));
125+ $ new_filename = parent ::translateFromUtf8 (trim ($ this -> _pathinfo ($ file ->getClientOriginalName (), PATHINFO_FILENAME )));
126126
127127 if (config ('lfm.rename_file ' ) === true ) {
128128 $ new_filename = uniqid ();
@@ -166,4 +166,17 @@ function getUrlParam(paramName) {
166166 if (o !== false) o.CKEDITOR.tools.callFunction(funcNum, ' $ file');
167167 </script> " ;
168168 }
169+
170+ private function _pathinfo ($ path , $ options = null ) {
171+ $ path = urlencode ($ path );
172+ $ parts = is_null ($ options ) ? pathinfo ($ path ) : pathinfo ($ path , $ options );
173+ if (is_array ($ parts )) {
174+ foreach ($ parts as $ field => $ value )
175+ $ parts [$ field ] = urldecode ($ value );
176+ }
177+ else
178+ $ parts = urldecode ($ parts );
179+ return $ parts ;
180+ }
181+
169182}
You can’t perform that action at this time.
0 commit comments