Commit 19cb7d3e authored by Côme Chilliet's avatar Côme Chilliet

Merge branch '6064-using-d-macro-returns-array' into '1.4-dev'

Resolve "Using %d macro returns "Array""

See merge request fusiondirectory/fd!735
parents 890c1f97 56d10e19
......@@ -411,7 +411,7 @@ class templateHandling
}
}
return $res;
return [$res];
}
private static function modifierDate (array $args)
......@@ -561,11 +561,11 @@ class templateHandling
break;
case 'r':
// random string
$result = [static::modifierRandomString($args)];
$result = static::modifierRandomString($args);
break;
case 'd':
// date
$result = [static::modifierDate($args)];
$result = static::modifierDate($args);
break;
case 'n':
// number
......
......@@ -1968,18 +1968,18 @@ function fopenWithErrorHandling (...$args)
// Check to see if it exists in case PHP has this function later
if (!function_exists('mb_substr_replace')) {
// Same parameters as substr_replace with the extra encoding parameter
function mb_substr_replace ($string, $replacement, $start, $length = NULL, $encoding = NULL)
function mb_substr_replace (string $string, string $replacement, $start, $length = NULL, $encoding = NULL)
{
if ($encoding == NULL) {
if ($encoding === NULL) {
$encoding = mb_internal_encoding();
}
if ($length == NULL) {
if ($length === NULL) {
return mb_substr($string, 0, $start, $encoding).
$replacement;
} else {
return mb_substr($string, 0, $start, $encoding).
$replacement.
mb_substr($string, $start + $length, mb_strlen($string, $encoding), $encoding);
mb_substr($string, $start + $length, NULL, $encoding);
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment