View Issue Details

IDProjectCategoryView StatusLast Update
0016784phplist applicationAll Otherpublic02-05-13 22:10
Reporterduncanc 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.11.9 
Target Version2.11.10Fixed in Version2.11.10 
Summary0016784: sendAdminCopy() function tries to send to an empty email address
DescriptionThe function sendAdminCopy() tries to send to an empty email address when the configuration item admin_addresses is empty, i.e. there are no other admins to copy on the email. This error gets caught and logged in the event log.

The cause is the php explode() function which, for an empty string, returns an array of one element, not an empty array.

See file admin/lib.php line 433

    if (!sizeof($mails)) {
      $admin_mail = getConfig("admin_address");
      $mails = explode(",",getConfig("admin_addresses"));
      array_push($mails,$admin_mail);
    }

Can be changed to

    if (!sizeof($mails)) {
      $admin_mail = getConfig("admin_address");

      if ($c = getConfig("admin_addresses")) {
        $mails = explode(",", $c);
      }
      array_push($mails,$admin_mail);
    }
TagsNo tags attached.

Activities

michiel

02-05-13 22:10

manager   ~0052025

changed as suggested