mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-16351 - make mnet_server_fault detect when it's being passed a full string rather than an 'mnet' string key
This commit is contained in:
parent
98bc644685
commit
ea676d6e67
@ -240,6 +240,7 @@ function mnet_server_strip_wrappers($HTTP_RAW_POST_DATA) {
|
||||
*
|
||||
* @param int $code The ID code of the error message
|
||||
* @param string $text The array-key of the error message in the lang file
|
||||
* or the full string (will be detected by the function
|
||||
* @param string $param The $a param for the error message in the lang file
|
||||
* @return string $text The text of the error message
|
||||
*/
|
||||
@ -250,8 +251,12 @@ function mnet_server_fault($code, $text, $param = null) {
|
||||
}
|
||||
$code = intval($code);
|
||||
|
||||
$text = get_string($text, 'mnet', $param);
|
||||
return mnet_server_fault_xml($code, $text);
|
||||
$string = get_string($text, 'mnet', $param);
|
||||
if (strpos($string, '[[') === 0) {
|
||||
$string = $text;
|
||||
}
|
||||
|
||||
return mnet_server_fault_xml($code, $string);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user