Fix default value $length value. Creates an error in fill in blanks see #7610

1.10.x
Julio Montoya 11 years ago
parent dad77a0cfa
commit 05535419fe
  1. 7
      main/inc/lib/internationalization.lib.php

@ -1389,6 +1389,9 @@ function api_strtoupper($string, $encoding = null)
*/
function api_substr($string, $start, $length = null, $encoding = null)
{
if (is_null($length)) {
$length = api_strlen($string, $encoding);
}
return Utf8::substr($string, $start, $length);
}
@ -1426,6 +1429,10 @@ function api_substr_count($haystack, $needle, $encoding = null)
*/
function api_substr_replace($string, $replacement, $start, $length = null, $encoding = null)
{
if (is_null($length)) {
$length = api_strlen($string);
}
return UTf8::substr_replace($string, $replacement, $start, $length);
}

Loading…
Cancel
Save