MDL-41531 enrol_paypal: Fix enrol errors due to non-ASCII characters
authoreWallah <info@ewallah.net>
Sun, 27 Dec 2015 16:58:53 +0000 (17:58 +0100)
committerJun Pataleta <jun@moodle.com>
Mon, 11 Jan 2016 02:48:47 +0000 (10:48 +0800)
enrol/paypal/ipn.php

index 8f972d8..197044f 100644 (file)
@@ -58,7 +58,7 @@ $data = new stdClass();
 
 foreach ($_POST as $key => $value) {
     $req .= "&$key=".urlencode($value);
-    $data->$key = $value;
+    $data->$key = fix_utf8($value);
 }
 
 $custom = explode('-', $data->custom);
@@ -211,6 +211,8 @@ if (strlen($result) > 0) {
             die;
 
         }
+        // Use the queried course's full name for the item_name field.
+        $data->item_name = $course->fullname;
 
         // ALL CLEAR !