From: mjollnir_ Date: Fri, 5 Sep 2008 12:24:11 +0000 (+0000) Subject: MDL-16351 - make mnet_server_fault detect when it's being passed a full string rather... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ea676d6e6751eb4dabc041cab80f0acf7bd7b768;p=moodle.git MDL-16351 - make mnet_server_fault detect when it's being passed a full string rather than an 'mnet' string key --- diff --git a/mnet/xmlrpc/server.php b/mnet/xmlrpc/server.php index f8f26fd13b..8f8d38690a 100644 --- a/mnet/xmlrpc/server.php +++ b/mnet/xmlrpc/server.php @@ -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); } /**