Skip to content

Commit 1d5aab5

Browse files
committed
Merge branch 'master' of github.com:chamilo/chamilo-lms
2 parents 7e577ff + 2b43465 commit 1d5aab5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

public/main/inc/lib/sessionmanager.lib.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ public static function create_session(
211211
return get_lang('Session title already exists');
212212
}
213213
} else {
214-
$rs = Database::query("SELECT 1 FROM $tbl_session WHERE title='".$name."'");
215-
if (Database::num_rows($rs)) {
214+
$sessionRepo = Database::getManager()->getRepository(Session::class);
215+
$existingSession = $sessionRepo->findOneBy(['title' => $name]);
216+
if ($existingSession !== null) {
216217
return get_lang('Session title already exists');
217218
}
218219
$ready_to_create = true;

0 commit comments

Comments
 (0)