Skip to content
Extraits de code Groupes Projets
Valider 5a08487b rédigé par mattab's avatar mattab
Parcourir les fichiers

Removed static method

parent 619ac550
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -129,13 +129,13 @@ class Mail extends Zend_Mail ...@@ -129,13 +129,13 @@ class Mail extends Zend_Mail
public function createAttachment($body, $mimeType = null, $disposition = null, $encoding = null, $filename = null) public function createAttachment($body, $mimeType = null, $disposition = null, $encoding = null, $filename = null)
{ {
$filename = self::sanitiseString($filename); $filename = $this->sanitiseString($filename);
return parent::createAttachment($body, $mimeType, $disposition, $encoding, $filename); return parent::createAttachment($body, $mimeType, $disposition, $encoding, $filename);
} }
public function setSubject($subject) public function setSubject($subject)
{ {
$subject = self::sanitiseString($subject); $subject = $this->sanitiseString($subject);
return parent::setSubject($subject); return parent::setSubject($subject);
} }
...@@ -173,7 +173,7 @@ class Mail extends Zend_Mail ...@@ -173,7 +173,7 @@ class Mail extends Zend_Mail
* @param $string * @param $string
* @return mixed * @return mixed
*/ */
static public function sanitiseString($string) function sanitiseString($string)
{ {
$search = array('–', '’'); $search = array('–', '’');
$replace = array('-', '\''); $replace = array('-', '\'');
......
...@@ -26,6 +26,7 @@ class MailTest extends \PHPUnit_Framework_TestCase ...@@ -26,6 +26,7 @@ class MailTest extends \PHPUnit_Framework_TestCase
*/ */
public function test_EmailFilenamesAreSanitised($raw, $expected) public function test_EmailFilenamesAreSanitised($raw, $expected)
{ {
$this->assertEquals($expected, Mail::sanitiseString($raw)); $mail = new Mail;
$this->assertEquals($expected, $mail->sanitiseString($raw));
} }
} }
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter