Back to MailHelper class

Method cleanSubject

public static string
cleanSubject
(mixed $subject)
Cleans any injected headers from the subject string.
Parameters
  • string $subject email subject string.
Returns
  • string Cleaned email subject string.
Since
  • 1.7.0
Class: MailHelper
Project: Joomla

Method cleanSubject - Source code

/**
 * Cleans any injected headers from the subject string.
 *
 * @param   string  $subject  email subject string.
 *
 * @return  string  Cleaned email subject string.
 *
 * @since   1.7.0
 */
public static function cleanSubject($subject)
{
    return preg_replace("/((From:|To:|Cc:|Bcc:|Content-type:) ([\\S]+))/", '', $subject);
}