]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16351 - make mnet_server_fault detect when it's being passed a full string rather...
authormjollnir_ <mjollnir_>
Fri, 5 Sep 2008 12:24:11 +0000 (12:24 +0000)
committermjollnir_ <mjollnir_>
Fri, 5 Sep 2008 12:24:11 +0000 (12:24 +0000)
mnet/xmlrpc/server.php

index f8f26fd13b8cc7a330f615f568e415af541d576b..8f8d38690a5331ffe5dd0a589c9a5547527dd505 100644 (file)
@@ -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);
 }
 
 /**