1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-08-07 17:42:53 +03:00

add a lib directory; move smarty into it; add random_compat phar (for random_bytes() on PHP < 7)

This commit is contained in:
David Goodwin
2018-04-29 09:35:57 +01:00
parent a4760ef53c
commit b97decb7c2
212 changed files with 15 additions and 5 deletions

View File

@@ -0,0 +1,33 @@
<?php
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifierCompiler
*/
/**
* Smarty strip modifier plugin
* Type: modifier
* Name: strip
* Purpose: Replace all repeated spaces, newlines, tabs
* with a single space or supplied replacement string.
* Example: {$var|strip} {$var|strip:"&nbsp;"}
* Date: September 25th, 2002
*
* @link http://www.smarty.net/manual/en/language.modifier.strip.php strip (Smarty online manual)
* @author Uwe Tews
*
* @param array $params parameters
*
* @return string with compiled code
*/
function smarty_modifiercompiler_strip($params)
{
if (!isset($params[ 1 ])) {
$params[ 1 ] = "' '";
}
return "preg_replace('!\s+!" . Smarty::$_UTF8_MODIFIER . "', {$params[1]},{$params[0]})";
}