diff options
author | robocoder <anthon.pang@gmail.com> | 2010-03-17 07:43:37 +0300 |
---|---|---|
committer | robocoder <anthon.pang@gmail.com> | 2010-03-17 07:43:37 +0300 |
commit | 6dad219f14061660a53aae4f86faf1ec24c5187c (patch) | |
tree | c80013e0638d222091da3649d38cc3729ec0ae36 /core | |
parent | 37c5c0749bba33f3452d16fd41bdea6bd4c0c0cc (diff) |
refs #1091 - Smarty function to convert to native end-of-line characters-- used by Feedback plugin to process message body for external email app
git-svn-id: http://dev.piwik.org/svn/trunk@1928 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core')
-rw-r--r-- | core/SmartyPlugins/modifier.stripeol.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/core/SmartyPlugins/modifier.stripeol.php b/core/SmartyPlugins/modifier.stripeol.php new file mode 100644 index 0000000000..d9e70f810d --- /dev/null +++ b/core/SmartyPlugins/modifier.stripeol.php @@ -0,0 +1,32 @@ +<?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later + * @version $Id$ + * + * @category Piwik + * @package SmartyPlugins + */ + +/** + * Smarty stripeol modifier plugin + * + * Type: modifier<br> + * Name: stripeol<br> + * Purpose: Replace all end-of-line characters with platform specific string.<br> + * Example: {$var|stripeol} + * Date: March 10th, 2010 + * @author anthon (at) piwik.org + * @version 1.0 + * @param string + * @param string + * @return string + */ +function smarty_modifier_stripeol($text) +{ + return preg_replace('!(\r\n|\r|\n)!', PHP_EOL, $text); +} + +/* vim: set expandtab: */ |