message MDL-25816 added safety checks in form processing
authorAndrew Davis (andyjdavis) <andrew@moodle.com>
Tue, 22 Feb 2011 08:05:01 +0000 (16:05 +0800)
committerAndrew Davis (andyjdavis) <andrew@moodle.com>
Tue, 22 Feb 2011 08:05:01 +0000 (16:05 +0800)
message/output/email/message_output_email.php
message/output/jabber/message_output_jabber.php

index 90bf792..dff4874 100644 (file)
@@ -85,7 +85,9 @@ class message_output_email extends message_output {
      * @param array $preferences preferences array
      */
     function process_form($form, &$preferences){
      * @param array $preferences preferences array
      */
     function process_form($form, &$preferences){
-        $preferences['message_processor_email_email'] = $form->email_email;
+        if (isset($form->email_email)) {
+            $preferences['message_processor_email_email'] = $form->email_email;
+        }
     }
 
     /**
     }
 
     /**
index a6f9f65..945d790 100644 (file)
@@ -106,7 +106,9 @@ class message_output_jabber extends message_output {
      * @param array $preferences preferences array
      */
     function process_form($form, &$preferences){
      * @param array $preferences preferences array
      */
     function process_form($form, &$preferences){
-        $preferences['message_processor_jabber_jabberid'] = $form->jabber_jabberid;
+        if (isset($form->jabber_jabberid)) {
+            $preferences['message_processor_jabber_jabberid'] = $form->jabber_jabberid;
+        }
     }
 
     /**
     }
 
     /**