JMailHelper/cleanBody: Difference between revisions
From Joomla! Documentation
m clean up |
m preparing for archive only |
||
| Line 4: | Line 4: | ||
===Syntax=== | ===Syntax=== | ||
| Line 38: | Line 38: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=cleanBody | category=cleanBody | ||
category=JMailHelper | category=JMailHelper | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
Latest revision as of 01:54, 25 March 2017
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