Fix undefined index in UnitTests
authorThomas Schüttler <tschuettler@oxfam.de>
Mon, 31 Jul 2017 15:39:32 +0000 (17:39 +0200)
committerThomas Schüttler <tschuettler@oxfam.de>
Mon, 31 Jul 2017 15:39:32 +0000 (17:39 +0200)
api/v3/Extension.php

index 0d8e40abe7471d4c19cb2749b3b7cc0e08d807e8..481a776ac158dd26e1bd4b0cd3d302a533e71608 100644 (file)
@@ -394,11 +394,15 @@ function civicrm_api3_extension_getremote($params) {
  * @return array
  */
 function _civicrm_api3_getKeys($params, $key) {
-  if (is_array($params[$key])) {
-    return $params[$key];
-  }
-  if ($params[$key] == '') {
+  if (isset($params[$key])) {
+    if (is_array($params[$key])) {
+      return $params[$key];
+    }
+    if ($params[$key] == '') {
+      return array();
+    }
+    return explode(API_V3_EXTENSION_DELIMITER, $params[$key]);
+  } else {
     return array();
   }
-  return explode(API_V3_EXTENSION_DELIMITER, $params[$key]);
 }