MDL-73784 usertours: Deprecation of the step::get_string_from_input

Modified code to just simply call helper::get_string_from_input() rather than duplicating the code
This commit is contained in:
Huong Nguyen 2022-02-07 09:45:24 +07:00
parent 21caea1f9a
commit d9d068699c

View File

@ -803,19 +803,7 @@ class step {
public static function get_string_from_input($string) {
debugging('Use of ' . __FUNCTION__ .
'() have been deprecated, please update your code to use helper::get_string_from_input()', DEBUG_DEVELOPER);
$string = trim($string);
if (preg_match('|^([a-zA-Z][a-zA-Z0-9\.:/_-]*),([a-zA-Z][a-zA-Z0-9\.:/_-]*)$|', $string, $matches)) {
if ($matches[2] === 'moodle') {
$matches[2] = 'core';
}
if (get_string_manager()->string_exists($matches[1], $matches[2])) {
$string = get_string($matches[1], $matches[2]);
}
}
return $string;
return helper::get_string_from_input($string);
}
/**