mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
- bugfix wordwrap modifier could fail if used in nocache code.
converted plugin file shared.mb_wordwrap.php into modifier.mb_wordwrap.php
This commit is contained in:
@@ -1,4 +1,8 @@
|
|||||||
===== 3.1.32 - dev ===
|
===== 3.1.32 - dev ===
|
||||||
|
05.8.2017
|
||||||
|
- bugfix wordwrap modifier could fail if used in nocache code.
|
||||||
|
converted plugin file shared.mb_wordwrap.php into modifier.mb_wordwrap.php
|
||||||
|
|
||||||
31.7.2017
|
31.7.2017
|
||||||
- Call clearstatcache() after mkdir() failure https://github.com/smarty-php/smarty/pull/379
|
- Call clearstatcache() after mkdir() failure https://github.com/smarty-php/smarty/pull/379
|
||||||
|
|
||||||
|
@@ -108,7 +108,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* smarty version
|
* smarty version
|
||||||
*/
|
*/
|
||||||
const SMARTY_VERSION = '3.1.32-dev-16';
|
const SMARTY_VERSION = '3.1.32-dev-17';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* define variable scopes
|
* define variable scopes
|
||||||
|
@@ -35,12 +35,15 @@
|
|||||||
*/
|
*/
|
||||||
function smarty_block_textformat($params, $content, $template, &$repeat)
|
function smarty_block_textformat($params, $content, $template, &$repeat)
|
||||||
{
|
{
|
||||||
|
static $mb_wordwrap_loaded = false;
|
||||||
if (is_null($content)) {
|
if (is_null($content)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!isset($template->smarty->_cache[ '_required_smw' ])) {
|
if (Smarty::$_MBSTRING && !$mb_wordwrap_loaded) {
|
||||||
require_once(SMARTY_PLUGINS_DIR . 'shared.mb_wordwrap.php');
|
if (!is_callable('smarty_modifier_mb_wordwrap')) {
|
||||||
$template->smarty->_cache[ '_required_smw' ] = true;
|
require_once(SMARTY_PLUGINS_DIR . 'modifier.mb_wordwrap.php');
|
||||||
|
}
|
||||||
|
$mb_wordwrap_loaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$style = null;
|
$style = null;
|
||||||
@@ -98,7 +101,7 @@ function smarty_block_textformat($params, $content, $template, &$repeat)
|
|||||||
}
|
}
|
||||||
// wordwrap sentences
|
// wordwrap sentences
|
||||||
if (Smarty::$_MBSTRING) {
|
if (Smarty::$_MBSTRING) {
|
||||||
$_paragraph = smarty_mb_wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut);
|
$_paragraph = smarty_modifier_mb_wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut);
|
||||||
} else {
|
} else {
|
||||||
$_paragraph = wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut);
|
$_paragraph = wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut);
|
||||||
}
|
}
|
||||||
|
75
libs/plugins/modifier.mb_wordwrap.php
Normal file
75
libs/plugins/modifier.mb_wordwrap.php
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Smarty plugin
|
||||||
|
*
|
||||||
|
* @package Smarty
|
||||||
|
* @subpackage PluginsModifier
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Smarty wordwrap modifier plugin
|
||||||
|
* Type: modifier<br>
|
||||||
|
* Name: mb_wordwrap<br>
|
||||||
|
* Purpose: Wrap a string to a given number of characters
|
||||||
|
*
|
||||||
|
|
||||||
|
* @link http://php.net/manual/en/function.wordwrap.php for similarity
|
||||||
|
*
|
||||||
|
* @param string $str the string to wrap
|
||||||
|
* @param int $width the width of the output
|
||||||
|
* @param string $break the character used to break the line
|
||||||
|
* @param boolean $cut ignored parameter, just for the sake of
|
||||||
|
*
|
||||||
|
* @return string wrapped string
|
||||||
|
* @author Rodney Rehm
|
||||||
|
*/
|
||||||
|
function smarty_modifier_mb_wordwrap($str, $width = 75, $break = "\n", $cut = false)
|
||||||
|
{
|
||||||
|
// break words into tokens using white space as a delimiter
|
||||||
|
$tokens = preg_split('!(\s)!S' . Smarty::$_UTF8_MODIFIER, $str, -1, PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE);
|
||||||
|
$length = 0;
|
||||||
|
$t = '';
|
||||||
|
$_previous = false;
|
||||||
|
$_space = false;
|
||||||
|
|
||||||
|
foreach ($tokens as $_token) {
|
||||||
|
$token_length = mb_strlen($_token, Smarty::$_CHARSET);
|
||||||
|
$_tokens = array($_token);
|
||||||
|
if ($token_length > $width) {
|
||||||
|
if ($cut) {
|
||||||
|
$_tokens = preg_split('!(.{' . $width . '})!S' . Smarty::$_UTF8_MODIFIER,
|
||||||
|
$_token,
|
||||||
|
-1,
|
||||||
|
PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($_tokens as $token) {
|
||||||
|
$_space = !!preg_match('!^\s$!S' . Smarty::$_UTF8_MODIFIER, $token);
|
||||||
|
$token_length = mb_strlen($token, Smarty::$_CHARSET);
|
||||||
|
$length += $token_length;
|
||||||
|
|
||||||
|
if ($length > $width) {
|
||||||
|
// remove space before inserted break
|
||||||
|
if ($_previous) {
|
||||||
|
$t = mb_substr($t, 0, -1, Smarty::$_CHARSET);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$_space) {
|
||||||
|
// add the break before the token
|
||||||
|
if (!empty($t)) {
|
||||||
|
$t .= $break;
|
||||||
|
}
|
||||||
|
$length = $token_length;
|
||||||
|
}
|
||||||
|
} else if ($token === "\n") {
|
||||||
|
// hard break must reset counters
|
||||||
|
$length = 0;
|
||||||
|
}
|
||||||
|
$_previous = $_space;
|
||||||
|
// add the token
|
||||||
|
$t .= $token;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $t;
|
||||||
|
}
|
@@ -20,7 +20,7 @@
|
|||||||
*
|
*
|
||||||
* @return string with compiled code
|
* @return string with compiled code
|
||||||
*/
|
*/
|
||||||
function smarty_modifiercompiler_wordwrap($params, $compiler)
|
function smarty_modifiercompiler_wordwrap($params, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
if (!isset($params[ 1 ])) {
|
if (!isset($params[ 1 ])) {
|
||||||
$params[ 1 ] = 80;
|
$params[ 1 ] = 80;
|
||||||
@@ -33,19 +33,7 @@ function smarty_modifiercompiler_wordwrap($params, $compiler)
|
|||||||
}
|
}
|
||||||
$function = 'wordwrap';
|
$function = 'wordwrap';
|
||||||
if (Smarty::$_MBSTRING) {
|
if (Smarty::$_MBSTRING) {
|
||||||
if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) {
|
$function = $compiler->getPlugin('mb_wordwrap','modifier');
|
||||||
$compiler->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ 'wordwrap' ][ 'modifier' ][ 'file' ] =
|
|
||||||
SMARTY_PLUGINS_DIR . 'shared.mb_wordwrap.php';
|
|
||||||
$compiler->template->required_plugins[ 'nocache' ][ 'wordwrap' ][ 'modifier' ][ 'function' ] =
|
|
||||||
'smarty_mb_wordwrap';
|
|
||||||
} else {
|
|
||||||
$compiler->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ 'wordwrap' ][ 'modifier' ][ 'file' ] =
|
|
||||||
SMARTY_PLUGINS_DIR . 'shared.mb_wordwrap.php';
|
|
||||||
$compiler->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ 'wordwrap' ][ 'modifier' ][ 'function' ] =
|
|
||||||
'smarty_mb_wordwrap';
|
|
||||||
}
|
|
||||||
$function = 'smarty_mb_wordwrap';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $function . '(' . $params[ 0 ] . ',' . $params[ 1 ] . ',' . $params[ 2 ] . ',' . $params[ 3 ] . ')';
|
return $function . '(' . $params[ 0 ] . ',' . $params[ 1 ] . ',' . $params[ 2 ] . ',' . $params[ 3 ] . ')';
|
||||||
}
|
}
|
||||||
|
@@ -1,75 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Smarty shared plugin
|
|
||||||
*
|
|
||||||
* @package Smarty
|
|
||||||
* @subpackage PluginsShared
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!function_exists('smarty_mb_wordwrap')) {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wrap a string to a given number of characters
|
|
||||||
*
|
|
||||||
* @link http://php.net/manual/en/function.wordwrap.php for similarity
|
|
||||||
*
|
|
||||||
* @param string $str the string to wrap
|
|
||||||
* @param int $width the width of the output
|
|
||||||
* @param string $break the character used to break the line
|
|
||||||
* @param boolean $cut ignored parameter, just for the sake of
|
|
||||||
*
|
|
||||||
* @return string wrapped string
|
|
||||||
* @author Rodney Rehm
|
|
||||||
*/
|
|
||||||
function smarty_mb_wordwrap($str, $width = 75, $break = "\n", $cut = false)
|
|
||||||
{
|
|
||||||
// break words into tokens using white space as a delimiter
|
|
||||||
$tokens =
|
|
||||||
preg_split('!(\s)!S' . Smarty::$_UTF8_MODIFIER, $str, - 1, PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE);
|
|
||||||
$length = 0;
|
|
||||||
$t = '';
|
|
||||||
$_previous = false;
|
|
||||||
$_space = false;
|
|
||||||
|
|
||||||
foreach ($tokens as $_token) {
|
|
||||||
$token_length = mb_strlen($_token, Smarty::$_CHARSET);
|
|
||||||
$_tokens = array($_token);
|
|
||||||
if ($token_length > $width) {
|
|
||||||
if ($cut) {
|
|
||||||
$_tokens = preg_split('!(.{' . $width . '})!S' . Smarty::$_UTF8_MODIFIER, $_token, - 1,
|
|
||||||
PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($_tokens as $token) {
|
|
||||||
$_space = !!preg_match('!^\s$!S' . Smarty::$_UTF8_MODIFIER, $token);
|
|
||||||
$token_length = mb_strlen($token, Smarty::$_CHARSET);
|
|
||||||
$length += $token_length;
|
|
||||||
|
|
||||||
if ($length > $width) {
|
|
||||||
// remove space before inserted break
|
|
||||||
if ($_previous) {
|
|
||||||
$t = mb_substr($t, 0, - 1, Smarty::$_CHARSET);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$_space) {
|
|
||||||
// add the break before the token
|
|
||||||
if (!empty($t)) {
|
|
||||||
$t .= $break;
|
|
||||||
}
|
|
||||||
$length = $token_length;
|
|
||||||
}
|
|
||||||
} elseif ($token == "\n") {
|
|
||||||
// hard break must reset counters
|
|
||||||
$_previous = 0;
|
|
||||||
$length = 0;
|
|
||||||
}
|
|
||||||
$_previous = $_space;
|
|
||||||
// add the token
|
|
||||||
$t .= $token;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $t;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -64,7 +64,7 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'template_dir' ] = $message;
|
$errors['template_dir'] = $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@@ -75,7 +75,7 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'template_dir' ] = $message;
|
$errors['template_dir'] = $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@@ -88,15 +88,15 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'template_dir' ] = $message;
|
$errors['template_dir'] = $message;
|
||||||
}
|
}
|
||||||
} elseif (!is_readable($template_dir)) {
|
} else if (!is_readable($template_dir)) {
|
||||||
$status = false;
|
$status = false;
|
||||||
$message = "FAILED: $template_dir is not readable";
|
$message = "FAILED: $template_dir is not readable";
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'template_dir' ] = $message;
|
$errors['template_dir'] = $message;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
@@ -118,31 +118,31 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'compile_dir' ] = $message;
|
$errors['compile_dir'] = $message;
|
||||||
}
|
}
|
||||||
} elseif (!is_dir($_compile_dir)) {
|
} else if (!is_dir($_compile_dir)) {
|
||||||
$status = false;
|
$status = false;
|
||||||
$message = "FAILED: {$_compile_dir} is not a directory";
|
$message = "FAILED: {$_compile_dir} is not a directory";
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'compile_dir' ] = $message;
|
$errors['compile_dir'] = $message;
|
||||||
}
|
}
|
||||||
} elseif (!is_readable($_compile_dir)) {
|
} else if (!is_readable($_compile_dir)) {
|
||||||
$status = false;
|
$status = false;
|
||||||
$message = "FAILED: {$_compile_dir} is not readable";
|
$message = "FAILED: {$_compile_dir} is not readable";
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'compile_dir' ] = $message;
|
$errors['compile_dir'] = $message;
|
||||||
}
|
}
|
||||||
} elseif (!is_writable($_compile_dir)) {
|
} else if (!is_writable($_compile_dir)) {
|
||||||
$status = false;
|
$status = false;
|
||||||
$message = "FAILED: {$_compile_dir} is not writable";
|
$message = "FAILED: {$_compile_dir} is not writable";
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'compile_dir' ] = $message;
|
$errors['compile_dir'] = $message;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
@@ -183,7 +183,7 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'plugins_dir' ] = $message;
|
$errors['plugins_dir'] = $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@@ -194,7 +194,7 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'plugins_dir' ] = $message;
|
$errors['plugins_dir'] = $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@@ -207,17 +207,17 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'plugins_dir' ] = $message;
|
$errors['plugins_dir'] = $message;
|
||||||
}
|
}
|
||||||
} elseif (!is_readable($plugin_dir)) {
|
} else if (!is_readable($plugin_dir)) {
|
||||||
$status = false;
|
$status = false;
|
||||||
$message = "FAILED: $plugin_dir is not readable";
|
$message = "FAILED: $plugin_dir is not readable";
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'plugins_dir' ] = $message;
|
$errors['plugins_dir'] = $message;
|
||||||
}
|
}
|
||||||
} elseif ($_core_plugins_dir && $_core_plugins_dir == realpath($plugin_dir)) {
|
} else if ($_core_plugins_dir && $_core_plugins_dir == realpath($plugin_dir)) {
|
||||||
$_core_plugins_available = true;
|
$_core_plugins_available = true;
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo "$plugin_dir is OK.\n";
|
echo "$plugin_dir is OK.\n";
|
||||||
@@ -233,8 +233,8 @@ class Smarty_Internal_TestInstall
|
|||||||
$message = "WARNING: Smarty's own libs/plugins is not available";
|
$message = "WARNING: Smarty's own libs/plugins is not available";
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} elseif (!isset($errors[ 'plugins_dir' ])) {
|
} else if (!isset($errors['plugins_dir'])) {
|
||||||
$errors[ 'plugins_dir' ] = $message;
|
$errors['plugins_dir'] = $message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,31 +251,31 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'cache_dir' ] = $message;
|
$errors['cache_dir'] = $message;
|
||||||
}
|
}
|
||||||
} elseif (!is_dir($_cache_dir)) {
|
} else if (!is_dir($_cache_dir)) {
|
||||||
$status = false;
|
$status = false;
|
||||||
$message = "FAILED: {$_cache_dir} is not a directory";
|
$message = "FAILED: {$_cache_dir} is not a directory";
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'cache_dir' ] = $message;
|
$errors['cache_dir'] = $message;
|
||||||
}
|
}
|
||||||
} elseif (!is_readable($_cache_dir)) {
|
} else if (!is_readable($_cache_dir)) {
|
||||||
$status = false;
|
$status = false;
|
||||||
$message = "FAILED: {$_cache_dir} is not readable";
|
$message = "FAILED: {$_cache_dir} is not readable";
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'cache_dir' ] = $message;
|
$errors['cache_dir'] = $message;
|
||||||
}
|
}
|
||||||
} elseif (!is_writable($_cache_dir)) {
|
} else if (!is_writable($_cache_dir)) {
|
||||||
$status = false;
|
$status = false;
|
||||||
$message = "FAILED: {$_cache_dir} is not writable";
|
$message = "FAILED: {$_cache_dir} is not writable";
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'cache_dir' ] = $message;
|
$errors['cache_dir'] = $message;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
@@ -312,7 +312,7 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'config_dir' ] = $message;
|
$errors['config_dir'] = $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@@ -323,7 +323,7 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'config_dir' ] = $message;
|
$errors['config_dir'] = $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@@ -336,15 +336,15 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'config_dir' ] = $message;
|
$errors['config_dir'] = $message;
|
||||||
}
|
}
|
||||||
} elseif (!is_readable($config_dir)) {
|
} else if (!is_readable($config_dir)) {
|
||||||
$status = false;
|
$status = false;
|
||||||
$message = "FAILED: $config_dir is not readable";
|
$message = "FAILED: $config_dir is not readable";
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'config_dir' ] = $message;
|
$errors['config_dir'] = $message;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
@@ -514,9 +514,9 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'sysplugins' ] = $message;
|
$errors['sysplugins'] = $message;
|
||||||
}
|
}
|
||||||
} elseif ($errors === null) {
|
} else if ($errors === null) {
|
||||||
echo "... OK\n";
|
echo "... OK\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -525,7 +525,7 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'sysplugins_dir_constant' ] = $message;
|
$errors['sysplugins_dir_constant'] = $message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -543,8 +543,9 @@ class Smarty_Internal_TestInstall
|
|||||||
'function.html_select_time.php' => true, 'function.html_table.php' => true,
|
'function.html_select_time.php' => true, 'function.html_table.php' => true,
|
||||||
'function.mailto.php' => true, 'function.math.php' => true, 'modifier.capitalize.php' => true,
|
'function.mailto.php' => true, 'function.math.php' => true, 'modifier.capitalize.php' => true,
|
||||||
'modifier.date_format.php' => true, 'modifier.debug_print_var.php' => true,
|
'modifier.date_format.php' => true, 'modifier.debug_print_var.php' => true,
|
||||||
'modifier.escape.php' => true, 'modifier.regex_replace.php' => true,
|
'modifier.escape.php' => true, 'modifier.mb_wordwrap.php' => true,
|
||||||
'modifier.replace.php' => true, 'modifier.spacify.php' => true, 'modifier.truncate.php' => true,
|
'modifier.regex_replace.php' => true, 'modifier.replace.php' => true,
|
||||||
|
'modifier.spacify.php' => true, 'modifier.truncate.php' => true,
|
||||||
'modifiercompiler.cat.php' => true, 'modifiercompiler.count_characters.php' => true,
|
'modifiercompiler.cat.php' => true, 'modifiercompiler.count_characters.php' => true,
|
||||||
'modifiercompiler.count_paragraphs.php' => true, 'modifiercompiler.count_sentences.php' => true,
|
'modifiercompiler.count_paragraphs.php' => true, 'modifiercompiler.count_sentences.php' => true,
|
||||||
'modifiercompiler.count_words.php' => true, 'modifiercompiler.default.php' => true,
|
'modifiercompiler.count_words.php' => true, 'modifiercompiler.default.php' => true,
|
||||||
@@ -557,7 +558,7 @@ class Smarty_Internal_TestInstall
|
|||||||
'outputfilter.trimwhitespace.php' => true, 'shared.escape_special_chars.php' => true,
|
'outputfilter.trimwhitespace.php' => true, 'shared.escape_special_chars.php' => true,
|
||||||
'shared.literal_compiler_param.php' => true, 'shared.make_timestamp.php' => true,
|
'shared.literal_compiler_param.php' => true, 'shared.make_timestamp.php' => true,
|
||||||
'shared.mb_str_replace.php' => true, 'shared.mb_unicode.php' => true,
|
'shared.mb_str_replace.php' => true, 'shared.mb_unicode.php' => true,
|
||||||
'shared.mb_wordwrap.php' => true, 'variablefilter.htmlspecialchars.php' => true,);
|
'variablefilter.htmlspecialchars.php' => true,);
|
||||||
$iterator = new DirectoryIterator($source);
|
$iterator = new DirectoryIterator($source);
|
||||||
foreach ($iterator as $file) {
|
foreach ($iterator as $file) {
|
||||||
if (!$file->isDot()) {
|
if (!$file->isDot()) {
|
||||||
@@ -573,9 +574,9 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'plugins' ] = $message;
|
$errors['plugins'] = $message;
|
||||||
}
|
}
|
||||||
} elseif ($errors === null) {
|
} else if ($errors === null) {
|
||||||
echo "... OK\n";
|
echo "... OK\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -584,7 +585,7 @@ class Smarty_Internal_TestInstall
|
|||||||
if ($errors === null) {
|
if ($errors === null) {
|
||||||
echo $message . ".\n";
|
echo $message . ".\n";
|
||||||
} else {
|
} else {
|
||||||
$errors[ 'plugins_dir_constant' ] = $message;
|
$errors['plugins_dir_constant'] = $message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user