MDL-76362 core_file: Check prefix exists before checking length

This commit is contained in:
Andrew Nicols
2023-01-23 09:16:07 +08:00
parent a1f4f7bac5
commit 788d86d7a3
+2 -2
View File
@@ -100,8 +100,8 @@ abstract class file_info {
*/
protected function build_search_files_sql($extensions, $prefix = null) {
global $DB;
if (strlen($prefix ?? '')) {
$prefix = $prefix.'.';
if ($prefix && strlen($prefix)) {
$prefix = $prefix . '.';
} else {
$prefix = '';
}