$res = XDB::query("SELECT * FROM axletter WHERE FIND_IN_SET('new', bits)");
if ($res->numRows()) {
extract($res->fetchOneAssoc(), EXTR_OVERWRITE);
- $subset_to = explode("\n", $subset);
+ $subset_to = ($subset ? explode("\n", $subset) : null);
$subset = (count($subset_to) > 0);
$saved = true;
} else {
XDB::execute("REPLACE INTO axletter
SET id = {?}, short_name = {?}, subject = {?}, title = {?}, body = {?},
signature = {?}, promo_min = {?}, promo_max = {?}, echeance = {?}, subset = {?}",
- $id, $short_name, $subject, $title, $body, $signature, $promo_min, $promo_max, $echeance, $subset ? implode("\n", $subset_to): null);
+ $id, $short_name, $subject, $title, $body, $signature, $promo_min, $promo_max, $echeance, $subset ? implode("\n", $subset_to) : null);
if (!$saved) {
global $globals;
$mailer = new PlMailer();
if ($this->_date == '0000-00-00') {
$this->_date = 0;
}
- $this->_subset_to = explode("\n", $this->_subset_to);
+ $this->_subset_to = ($this->_subset_to ? explode("\n", $this->_subset_to) : null);
$this->_subset = (count($this->_subset_to) > 0);
}
require_once("emails.inc.php");
$ids = ids_from_mails($this->_subset_to);
$ids_list = implode(',', $ids);
- if(count($ids_list) > 0) {
+ if(count($ids) > 0) {
$where[] = "ni.user_id IN ($ids_list)";
} else {
// No valid email