API16

API16:JMailHelper/cleanSubject

From Joomla! Documentation

Description

Cleans any injected headers from the subject string.



Syntax

static cleanSubject($subject)
Parameter Name Default Value Description
$subject $subject E-Mail subject string.

Returns

string Cleaned E-Mail subject string.

Defined in

libraries/joomla/mail/helper.php

Importing

jimport( 'joomla.mail.helper' );

Source Body

public static function cleanSubject($subject)
{
        return preg_replace("/((From:|To:|Cc:|Bcc:|Content-type:) ([\S]+))/", "", $subject);
}



Examples

Code Examples