Skip to content

Instantly share code, notes, and snippets.

@piouPiouM
Created October 1, 2009 09:46
Show Gist options
  • Save piouPiouM/198866 to your computer and use it in GitHub Desktop.
Save piouPiouM/198866 to your computer and use it in GitHub Desktop.
Pourquoi faire simple quand on peut faire compliqué ?
--- class.phpmailer.php
+++ (clipboard)
@@ -323,9 +323,7 @@
* @return void
*/
public function AddAddress($address, $name = '') {
- $cur = count($this->to);
- $this->to[$cur][0] = trim($address);
- $this->to[$cur][1] = $name;
+ $this->to[] = array(trim($address), $name);
}
/**
@@ -337,9 +335,7 @@
* @return void
*/
public function AddCC($address, $name = '') {
- $cur = count($this->cc);
- $this->cc[$cur][0] = trim($address);
- $this->cc[$cur][1] = $name;
+ $this->cc[] = array(trim($address), $name);
}
/**
@@ -351,9 +347,7 @@
* @return void
*/
public function AddBCC($address, $name = '') {
- $cur = count($this->bcc);
- $this->bcc[$cur][0] = trim($address);
- $this->bcc[$cur][1] = $name;
+ $this->bcc[] = array(trim($address), $name);
}
/**
@@ -363,9 +357,7 @@
* @return void
*/
public function AddReplyTo($address, $name = '') {
- $cur = count($this->ReplyTo);
- $this->ReplyTo[$cur][0] = trim($address);
- $this->ReplyTo[$cur][1] = $name;
+ $this->ReplyTo[] = array(trim($address), $name);
}
/////////////////////////////////////////////////
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment