From f8c531599c2bcc75d20eabea61c874e077839818 Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Mon, 7 Dec 2015 16:32:15 +0100 Subject: [PATCH] Web: more restrictive get_current_uotd() This will prevent the rare case where a project has not yet chosen a UOTD but there are profiles in the DB (a random profile would be shown). --- html/inc/uotd.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/inc/uotd.inc b/html/inc/uotd.inc index 7002455693..73b05eeabc 100644 --- a/html/inc/uotd.inc +++ b/html/inc/uotd.inc @@ -47,7 +47,7 @@ function show_uotd($profile) { // return the last UOTD profile, or null // function get_current_uotd() { - $profiles = BoincProfile::enum(null, "ORDER BY uotd_time DESC LIMIT 1"); + $profiles = BoincProfile::enum("uotd_time is not NULL", "ORDER BY uotd_time DESC LIMIT 1"); if (sizeof($profiles)) { return $profiles[0]; }