Merge pull request #15326 from totten/master-headfoot-2
[civicrm-core.git] / CRM / Utils / API / HTMLInputCoder.php
index 93dd7a208ec70fc807252ac6d40a0bb71d8e8459..bf1fc3e13e98006064f6770f5c49696978b37b96 100644 (file)
@@ -1,27 +1,11 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 5                                                  |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019                                |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM.                                    |
- |                                                                    |
- | CiviCRM is free software; you can copy, modify, and distribute it  |
- | under the terms of the GNU Affero General Public License           |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
- |                                                                    |
- | CiviCRM is distributed in the hope that it will be useful, but     |
- | WITHOUT ANY WARRANTY; without even the implied warranty of         |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
- | See the GNU Affero General Public License for more details.        |
+ | Copyright CiviCRM LLC. All rights reserved.                        |
  |                                                                    |
- | You should have received a copy of the GNU Affero General Public   |
- | License and the CiviCRM Licensing Exception along                  |
- | with this program; if not, contact CiviCRM LLC                     |
- | at info[AT]civicrm[DOT]org. If you have questions about the        |
- | GNU Affero General Public License or the licensing of CiviCRM,     |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
+ | This work is published under the GNU AGPLv3 license with some      |
+ | permitted exceptions and without any warranty. For full license    |
+ | and copyright information, see https://civicrm.org/licensing       |
  +--------------------------------------------------------------------+
  */
 
@@ -35,7 +19,7 @@
  * escaping scheme and consequently remove HTMLInputCoder.
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC https://civicrm.org/licensing
  */
 class CRM_Utils_API_HTMLInputCoder extends CRM_Utils_API_AbstractFieldCoder {
   private $skipFields = NULL;
@@ -63,7 +47,7 @@ class CRM_Utils_API_HTMLInputCoder extends CRM_Utils_API_AbstractFieldCoder {
    */
   public function getSkipFields() {
     if ($this->skipFields === NULL) {
-      $this->skipFields = array(
+      $this->skipFields = [
         'widget_code',
         'html_message',
         'body_html',
@@ -97,20 +81,31 @@ class CRM_Utils_API_HTMLInputCoder extends CRM_Utils_API_AbstractFieldCoder {
         'honor_block_text',
         'pay_later_text',
         'pay_later_receipt',
-        'label', // This is needed for FROM Email Address configuration. dgg
-        'url', // This is needed for navigation items urls
+        // This is needed for FROM Email Address configuration. dgg
+        'label',
+        // This is needed for navigation items urls
+        'url',
         'details',
-        'msg_text', // message templates’ text versions
-        'text_message', // (send an) email to contact’s and CiviMail’s text version
-        'data', // data i/p of persistent table
-        'sqlQuery', // CRM-6673
+        // message templates’ text versions
+        'msg_text',
+        // (send an) email to contact’s and CiviMail’s text version
+        'text_message',
+        // data i/p of persistent table
+        'data',
+        // CRM-6673
+        'sqlQuery',
         'pcp_title',
         'pcp_intro_text',
-        'new', // The 'new' text in word replacements
-        'replyto_email', // e.g. '"Full Name" <user@example.org>'
+        // The 'new' text in word replacements
+        'new',
+        // e.g. '"Full Name" <user@example.org>'
+        'replyto_email',
         'operator',
-        'content', // CRM-20468
-      );
+        // CRM-20468
+        'content',
+        // CiviCampaign Goal Details
+        'goal_general',
+      ];
       $custom = CRM_Core_DAO::executeQuery('SELECT id FROM civicrm_custom_field WHERE html_type = "RichTextEditor"');
       while ($custom->fetch()) {
         $this->skipFields[] = 'custom_' . $custom->id;
@@ -135,7 +130,7 @@ class CRM_Utils_API_HTMLInputCoder extends CRM_Utils_API_AbstractFieldCoder {
       }
     }
     elseif ($castToString || is_string($values)) {
-      $values = str_replace(array('<', '>'), array('&lt;', '&gt;'), $values);
+      $values = str_replace(['<', '>'], ['&lt;', '&gt;'], $values);
     }
   }
 
@@ -150,7 +145,7 @@ class CRM_Utils_API_HTMLInputCoder extends CRM_Utils_API_AbstractFieldCoder {
       }
     }
     elseif ($castToString || is_string($values)) {
-      $values = str_replace(array('&lt;', '&gt;'), array('<', '>'), $values);
+      $values = str_replace(['&lt;', '&gt;'], ['<', '>'], $values);
     }
   }