  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: email.php 554 2006-04-29 16:26:53Z hpdl $ |
| |
| 3 | + | $Id: email.php 757 2006-08-23 12:22:54Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
72 | 72 | | |
| |
73 | 73 | | reset($headers); |
| |
74 | 74 | | while (list(,$value) = each($headers)) { |
  |
75 | | - | if (tep_not_null($value)) { |
| |
| 75 | + | if (!empty($value)) { |
|
76 | 76 | | $this->headers[] = $value; |
| |
77 | 77 | | } |
| |
78 | 78 | | } |
| |
|
|
 |
… |
|
128 | 128 | | } |
| |
129 | 129 | | } |
| |
130 | 130 | | |
  |
131 | | - | if (tep_not_null($html_images)) { |
| |
| 131 | + | if (!empty($html_images)) { |
|
132 | 132 | | // If duplicate images are embedded, they may show up as attachments, so remove them. |
| |
133 | 133 | | $html_images = array_unique($html_images); |
| |
134 | 134 | | sort($html_images); |
| |
|
|
 |
… |
|
148 | 148 | | */ |
| |
149 | 149 | | |
| |
150 | 150 | | function add_text($text = '') { |
  |
151 | | - | $this->text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text); |
| |
| 151 | + | $this->text = str_replace(array("\r\n", "\n", "\r"), $this->lf, $text); |
|
152 | 152 | | } |
| |
153 | 153 | | |
| |
154 | 154 | | /** |
| |
|
|
 |
… |
|
158 | 158 | | */ |
| |
159 | 159 | | |
| |
160 | 160 | | function add_html($html, $text = NULL, $images_dir = NULL) { |
  |
161 | | - | $this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br />', $html); |
| |
162 | | - | $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text); |
| |
| 161 | + | $this->html = str_replace(array("\r\n", "\n", "\r"), '<br />', $html); |
| |
| 162 | + | $this->html_text = str_replace(array("\r\n", "\n", "\r"), $this->lf, $text); |
|
163 | 163 | | |
| |
164 | 164 | | if (isset($images_dir)) $this->find_html_images($images_dir); |
| |
165 | 165 | | } |
| |
|
|
 |
… |
|
330 | 330 | | } |
| |
331 | 331 | | } |
| |
332 | 332 | | |
  |
333 | | - | if (tep_not_null($this->html_images)) { |
| |
| 333 | + | if (!empty($this->html_images)) { |
|
334 | 334 | | reset($this->html_images); |
| |
335 | 335 | | while (list(,$value) = each($this->html_images)) { |
| |
336 | 336 | | $this->html = str_replace($value['name'], 'cid:' . $value['cid'], $this->html); |
| |
337 | 337 | | } |
| |
338 | 338 | | } |
| |
339 | 339 | | |
| |
340 | 340 | | $null = NULL; |
  |
341 | | - | $attachments = ((tep_not_null($this->attachments)) ? true : false); |
| |
342 | | - | $html_images = ((tep_not_null($this->html_images)) ? true : false); |
| |
343 | | - | $html = ((tep_not_null($this->html)) ? true : false); |
| |
344 | | - | $text = ((tep_not_null($this->text)) ? true : false); |
| |
| 341 | + | $attachments = ((!empty($this->attachments)) ? true : false); |
| |
| 342 | + | $html_images = ((!empty($this->html_images)) ? true : false); |
| |
| 343 | + | $html = ((!empty($this->html)) ? true : false); |
| |
| 344 | + | $text = ((!empty($this->text)) ? true : false); |
|
345 | 345 | | |
| |
346 | 346 | | switch (true) { |
| |
347 | 347 | | case (($text == true) && ($attachments == false)): |
| |
|
|
 |
… |
|
369 | 369 | | } |
| |
370 | 370 | | break; |
| |
371 | 371 | | case (($html == true) && ($attachments == false) && ($html_images == false)): |
  |
372 | | - | if (tep_not_null($this->html_text)) { |
| |
| 372 | + | if (!empty($this->html_text)) { |
|
373 | 373 | | /* HPDL PHP3 */ |
| |
374 | 374 | | // $message =& $this->add_alternative_part($null); |
| |
375 | 375 | | $message = $this->add_alternative_part($null); |
| |
|
|
 |
… |
|
382 | 382 | | } |
| |
383 | 383 | | break; |
| |
384 | 384 | | case (($html == true) && ($attachments == false) && ($html_images == true)): |
  |
385 | | - | if (tep_not_null($this->html_text)) { |
| |
| 385 | + | if (!empty($this->html_text)) { |
|
386 | 386 | | /* HPDL PHP3 */ |
| |
387 | 387 | | // $message =& $this->add_alternative_part($null); |
| |
388 | 388 | | $message = $this->add_alternative_part($null); |
| |
|
|
 |
… |
|
407 | 407 | | /* HPDL PHP3 */ |
| |
408 | 408 | | // $message =& $this->add_mixed_part(); |
| |
409 | 409 | | $message = $this->add_mixed_part(); |
  |
410 | | - | if (tep_not_null($this->html_text)) { |
| |
| 410 | + | if (!empty($this->html_text)) { |
|
411 | 411 | | /* HPDL PHP3 */ |
| |
412 | 412 | | // $alt =& $this->add_alternative_part($message); |
| |
413 | 413 | | $alt = $this->add_alternative_part($message); |
| |
|
|
 |
… |
|
426 | 426 | | // $message =& $this->add_mixed_part(); |
| |
427 | 427 | | $message = $this->add_mixed_part(); |
| |
428 | 428 | | |
  |
429 | | - | if (tep_not_null($this->html_text)) { |
| |
| 429 | + | if (!empty($this->html_text)) { |
  |
430 | 430 | | /* HPDL PHP3 */ |
| |
431 | 431 | | // $alt =& $this->add_alternative_part($message); |
| |
432 | 432 | | $alt = $this->add_alternative_part($message); |