Fix long address lines overflowing label
[civicrm-core.git] / CRM / Utils / Type.php
index 1c99a7e06a5d45e9843dad39d61bd22213dd5a59..7ddc8dd9d328f5ae4ff49933d1c92ef1de318e92 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.7                                                |
+ | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2018                                |
  +--------------------------------------------------------------------+
@@ -422,6 +422,8 @@ class CRM_Utils_Type {
       'MysqlOrderByDirection',
       'MysqlOrderBy',
       'ExtensionKey',
+      'Json',
+      'Alphanumeric',
     );
     if (!in_array($type, $possibleTypes)) {
       if ($isThrowException) {
@@ -530,6 +532,18 @@ class CRM_Utils_Type {
           return $data;
         }
         break;
+
+      case 'Json':
+        if (CRM_Utils_Rule::json($data)) {
+          return $data;
+        }
+        break;
+
+      case 'Alphanumeric':
+        if (CRM_Utils_Rule::alphanumeric($data)) {
+          return $data;
+        }
+        break;
     }
 
     if ($abort) {