blob: 74437165579ca895be9d71c867f136ff0c56f53d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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: */
|