API16

API16:JMailHelper/cleanBody

From Joomla! Documentation

Revision as of 01:54, 25 March 2017 by JoomlaWikiBot (talk | contribs) (preparing for archive only)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Cleans any injected headers from the E-Mail body.



Syntax

static cleanBody($body)
Parameter Name Default Value Description
$body $body E-Mail body string.

Returns

string Cleaned E-Mail body string.

Defined in

libraries/joomla/mail/helper.php

Importing

jimport( 'joomla.mail.helper' );

Source Body

public static function cleanBody($body)
{
        // Strip all E-Mail headers from a string
        return preg_replace("/((From:|To:|Cc:|Bcc:|Subject:|Content-type:) ([\S]+))/", "", $body);
}



Examples

Code Examples