MDL-76362 core_file: Check prefix exists before checking length

This commit is contained in:
Andrew Nicols
2023-01-23 09:15:55 +08:00
parent 93ab932211
commit b0aa0b63e0
+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 = '';
}