mirror of
https://github.com/moodle/moodle.git
synced 2025-03-18 14:40:06 +01:00
MDL-77102 mod_wiki: remove deprecated mbstring overload checks.
This commit is contained in:
parent
67bbf6c416
commit
03a1ca582b
@ -494,15 +494,7 @@ class mod_wiki_external extends external_api {
|
||||
$retpage['contentformat'] = $contentformat;
|
||||
} else {
|
||||
// Return the size of the content.
|
||||
$retpage['contentsize'] = strlen($cachedcontent);
|
||||
// TODO: Remove this block of code once PHP 8.0 is the min version supported.
|
||||
// For PHP < 8.0, if strlen() was overloaded, calculate
|
||||
// the bytes using mb_strlen(..., '8bit').
|
||||
if (PHP_VERSION_ID < 80000) {
|
||||
if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) {
|
||||
$retpage['contentsize'] = mb_strlen($cachedcontent, '8bit');
|
||||
}
|
||||
}
|
||||
$retpage['contentsize'] = \core_text::strlen($cachedcontent);
|
||||
}
|
||||
|
||||
$returnedpages[] = $retpage;
|
||||
|
@ -646,15 +646,7 @@ class externallib_test extends externallib_advanced_testcase {
|
||||
|
||||
// Check that WS doesn't return page content if includecontent is false, it returns the size instead.
|
||||
foreach ($expectedpages as $i => $expectedpage) {
|
||||
$expectedpages[$i]['contentsize'] = strlen($expectedpages[$i]['cachedcontent']);
|
||||
// TODO: Remove this block of code once PHP 8.0 is the min version supported.
|
||||
// For PHP < 8.0, if strlen() was overloaded, calculate
|
||||
// the bytes using mb_strlen(..., '8bit').
|
||||
if (PHP_VERSION_ID < 80000) {
|
||||
if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) {
|
||||
$expectedpages[$i]['contentsize'] = mb_strlen($expectedpages[$i]['cachedcontent'], '8bit');
|
||||
}
|
||||
}
|
||||
$expectedpages[$i]['contentsize'] = \core_text::strlen($expectedpages[$i]['cachedcontent']);
|
||||
unset($expectedpages[$i]['cachedcontent']);
|
||||
unset($expectedpages[$i]['contentformat']);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user