Add expiration_date validation see BT#10259

1.10.x
Julio Montoya 9 years ago
parent 1d3a85120a
commit 22dc909a38
  1. 4
      main/inc/lib/system_announcements.lib.php

@ -655,6 +655,7 @@ class SystemAnnouncementManager
$title = api_html_entity_decode(stripslashes($title), ENT_QUOTES, $charset);
$content = api_html_entity_decode(stripslashes(str_replace(array('\r\n', '\n', '\r'),'', $content)), ENT_QUOTES, $charset);
$now = api_get_utc_datetime();
if ($sendEmailTest) {
MessageManager::send_message_simple(api_get_user_id(), $title, $content);
@ -691,6 +692,9 @@ class SystemAnnouncementManager
// Sent to active users.
$sql .= " AND email <>'' AND active = 1 ";
// Expiration date
$sql .= " AND (expiration_date = '' OR expiration_date IS NULL OR expiration_date > '$now') ";
if ((empty($teacher) or $teacher == '0') AND (empty($student) or $student == '0')) {
return true;
}

Loading…
Cancel
Save