CRM-21123 Ensure that the selectedChild on message templates is one of allowed types
authorSeamus Lee <seamuslee001@gmail.com>
Tue, 19 Sep 2017 03:23:29 +0000 (13:23 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Wed, 20 Sep 2017 08:41:32 +0000 (18:41 +1000)
CRM-21123 Put the array into the if statement

CRM/Admin/Page/MessageTemplates.php

index d94ffc020ec0e4199d9ebb71805c8dd870f229d2..b9b99b4235fa9c06307f3f61816ed9e7e1d8f32d 100644 (file)
@@ -199,9 +199,10 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic {
 
       CRM_Core_BAO_MessageTemplate::revert($id);
     }
-
-    $this->assign('selectedChild', CRM_Utils_Request::retrieve('selectedChild', 'String', $this));
-
+    $selectedChild = CRM_Utils_Request::retrieve('selectedChild', 'String', $this);
+    if (in_array($selectedChild, array('user', 'workflow'))) {
+      $this->assign('selectedChild', $selectedChild);
+    }
     return parent::run($args, $pageArgs, $sort);
   }