class MailHelper

Email helper class, provides static methods to perform various tasks relevant to the Joomla email routines.

TODO: Test these methods as the regex work is first run and not tested thoroughly

Methods

static  string
cleanLine( string $value)

Cleans single line inputs.

static  string
cleanText( string $value)

Cleans multi-line inputs.

static  string
cleanBody( string $body)

Cleans any injected headers from the email body.

static  string
cleanSubject( string $subject)

Cleans any injected headers from the subject string.

static  mixed
cleanAddress( string $address)

Verifies that an email address does not have any extra headers injected into it.

static  boolean
isEmailAddress( string $email)

Verifies that the string is in a proper email address format.

Details

static string cleanLine( string $value)

Cleans single line inputs.

Parameters

string $value String to be cleaned.

Return Value

string Cleaned string.

static string cleanText( string $value)

Cleans multi-line inputs.

Parameters

string $value Multi-line string to be cleaned.

Return Value

string Cleaned multi-line string.

static string cleanBody( string $body)

Cleans any injected headers from the email body.

Parameters

string $body email body string.

Return Value

string Cleaned email body string.

static string cleanSubject( string $subject)

Cleans any injected headers from the subject string.

Parameters

string $subject email subject string.

Return Value

string Cleaned email subject string.

static mixed cleanAddress( string $address)

Verifies that an email address does not have any extra headers injected into it.

Parameters

string $address email address.

Return Value

mixed email address string or boolean false if injected headers are present.

static boolean isEmailAddress( string $email)

Verifies that the string is in a proper email address format.

Parameters

string $email String to be verified.

Return Value

boolean True if string has the correct format; false otherwise.