@@ -61,7 +61,8 @@ private function proceedSingleUpload($file)
61
61
->save ($ new_file_path , 90 );
62
62
63
63
$ this ->makeThumb ($ new_filename );
64
- } else {
64
+ }
65
+ {
65
66
chmod ($ file ->getRealPath (), 0644 ); // TODO configurable
66
67
File::move ($ file ->getRealPath (), $ new_file_path );
67
68
}
@@ -122,7 +123,7 @@ private function uploadValidator($file)
122
123
123
124
private function getNewName ($ file )
124
125
{
125
- $ new_filename = parent ::translateFromUtf8 (trim (pathinfo ($ file ->getClientOriginalName (), PATHINFO_FILENAME )));
126
+ $ new_filename = parent ::translateFromUtf8 (trim ($ this -> _pathinfo ($ file ->getClientOriginalName (), PATHINFO_FILENAME )));
126
127
127
128
if (config ('lfm.rename_file ' ) === true ) {
128
129
$ new_filename = uniqid ();
@@ -166,4 +167,19 @@ function getUrlParam(paramName) {
166
167
if (o !== false) o.CKEDITOR.tools.callFunction(funcNum, ' $ file');
167
168
</script> " ;
168
169
}
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
+ }
169
185
}
0 commit comments