File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1342,7 +1342,7 @@ function filter_extension(&$filename)
1342
1342
if ($ skip == 'true ' ) {
1343
1343
return 0 ;
1344
1344
} else {
1345
- $ new_ext = api_get_setting ( ' upload_extensions_replace_by ' );
1345
+ $ new_ext = getReplacedByExtension ( );
1346
1346
$ filename = str_replace ('. ' .$ ext , '. ' .$ new_ext , $ filename );
1347
1347
1348
1348
return 1 ;
@@ -1362,7 +1362,7 @@ function filter_extension(&$filename)
1362
1362
if ($ skip == 'true ' ) {
1363
1363
return 0 ;
1364
1364
} else {
1365
- $ new_ext = api_get_setting ( ' upload_extensions_replace_by ' );
1365
+ $ new_ext = getReplacedByExtension ( );
1366
1366
$ filename = str_replace ('. ' .$ ext , '. ' .$ new_ext , $ filename );
1367
1367
1368
1368
return 1 ;
@@ -1373,6 +1373,13 @@ function filter_extension(&$filename)
1373
1373
}
1374
1374
}
1375
1375
1376
+ function getReplacedByExtension ()
1377
+ {
1378
+ $ extension = api_get_setting ('upload_extensions_replace_by ' );
1379
+
1380
+ return 'REPLACED_ ' .api_replace_dangerous_char (str_replace ('. ' , '' , $ extension ));
1381
+ }
1382
+
1376
1383
/**
1377
1384
* Adds a new document to the database.
1378
1385
*
You can’t perform that action at this time.
0 commit comments