Skip to content

Commit

Permalink
MDL-26119 fixing regression caused by previous merge in PULL-294
Browse files Browse the repository at this point in the history
We can not use empty() on function directly, the PHP docs were incorrect.
  • Loading branch information
skodak committed Feb 15, 2011
1 parent da622b4 commit d83bad4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mod/quiz/locallib.php
Expand Up @@ -1002,7 +1002,7 @@ function quiz_get_combined_reviewoptions($quiz, $attempts, $context) {
*
* @param stdClass $a associative array of replaceable fields for the templates
*
* @return bool|string result of events_triger
* @return bool
*/
function quiz_send_confirmation($a) {

Expand Down Expand Up @@ -1034,7 +1034,7 @@ function quiz_send_confirmation($a) {
$eventdata->contexturl = $a->quizurl;
$eventdata->contexturlname = $a->quizname;

return message_send($eventdata);
return (bool)message_send($eventdata); // returns message id or false
}

/**
Expand All @@ -1043,7 +1043,7 @@ function quiz_send_confirmation($a) {
* @param object $recipient user object of the intended recipient
* @param stdClass $a associative array of replaceable fields for the templates
*
* @return bool|string result of events_triger()
* @return bool
*/
function quiz_send_notification($recipient, $a) {

Expand Down Expand Up @@ -1075,7 +1075,7 @@ function quiz_send_notification($recipient, $a) {
$eventdata->contexturl = $a->quizreviewurl;
$eventdata->contexturlname = $a->quizname;

return message_send($eventdata);
return (bool)message_send($eventdata);
}

/**
Expand Down Expand Up @@ -1154,7 +1154,7 @@ function quiz_send_notification_emails($course, $quiz, $attempt, $context, $cm)
// send confirmation if required
if ($sendconfirm) {
// send the email and update stats
switch (!empty(quiz_send_confirmation($a))) {
switch (quiz_send_confirmation($a)) {
case true:
$emailresult['good']++;
break;
Expand Down

0 comments on commit d83bad4

Please sign in to comment.