diff --git a/CRM/Contribute/Page/ContributionPage.php b/CRM/Contribute/Page/ContributionPage.php index 549e96ee1..58c370033 100644 --- a/CRM/Contribute/Page/ContributionPage.php +++ b/CRM/Contribute/Page/ContributionPage.php @@ -334,6 +334,10 @@ function run() { if ($shorten) { $this->assign('shorten', $shorten); } + $shorten_pcp = CRM_Core_OptionGroup::getValue('shorten_url', 'civicrm_pcp.'.$id, 'name', 'String', 'value'); + if ($shorten_pcp) { + $this->assign('shorten_pcp', $shorten_pcp); + } // statistics CRM_Utils_System::setTitle(ts('Dashlets')." - ".$page['title']); diff --git a/CRM/Core/Page/AJAX/SaveShortenURL.php b/CRM/Core/Page/AJAX/SaveShortenURL.php index 43f4bc6ed..cb2a1cc78 100644 --- a/CRM/Core/Page/AJAX/SaveShortenURL.php +++ b/CRM/Core/Page/AJAX/SaveShortenURL.php @@ -4,7 +4,7 @@ static function run() { $pageId = CRM_Utils_Request::retrieve('page_id', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, 'REQUEST'); $pageType = CRM_Utils_Request::retrieve('page_type', 'String', CRM_Core_DAO::$_nullObject, TRUE, NULL, 'REQUEST'); $shorten = CRM_Utils_Request::retrieve('shorten', 'String', CRM_Core_DAO::$_nullObject, TRUE, NULL, 'REQUEST'); - if (in_array($pageType, array('civicrm_contribution_page', 'civicrm_event.info', 'civicrm_event.register', 'civicrm_uf_group'))) { + if (in_array($pageType, array('civicrm_contribution_page', 'civicrm_pcp', 'civicrm_event.info', 'civicrm_event.register', 'civicrm_uf_group'))) { $exists = CRM_Core_OptionGroup::getValue('shorten_url', $pageType.'.'.$pageId, 'name', 'String', 'id'); $groupParams = array( 'name' => 'shorten_url', diff --git a/CRM/Utils/String.php b/CRM/Utils/String.php index 203873a6f..6eb881315 100644 --- a/CRM/Utils/String.php +++ b/CRM/Utils/String.php @@ -446,10 +446,10 @@ static function htmlToText($html) { return $converter->get_text(); } - static function htmlPurifier($html, $allowed_tags = array()) { + static function htmlPurifier($html, $allowedTags = array()) { require_once 'packages/IDS/vendors/htmlpurifier/HTMLPurifier.auto.php'; static $_purifier; - $hash = md5(CRM_Utils_Array::implode('', $allowed_tags)); + $hash = md5(CRM_Utils_Array::implode(',', $allowedTags)); if (!$_purifier[$hash]) { $config = CRM_Core_Config::singleton(); @@ -467,7 +467,8 @@ static function htmlPurifier($html, $allowed_tags = array()) { $purifierConfig->set('URI.SafeIframeRegexp', '%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%'); //allow YouTube and Vimeo // allowed tags put at the end - $purifierConfig->set('HTML.Allowed', $allowed_tags); + $allowed = implode(', ', $allowedTags); + $purifierConfig->set('HTML.Allowed', $allowed); // def needs after configure // fullscreen diff --git a/templates/CRM/Contribute/Page/ContributionPageEdit.tpl b/templates/CRM/Contribute/Page/ContributionPageEdit.tpl index d233829d3..a4da8f743 100644 --- a/templates/CRM/Contribute/Page/ContributionPageEdit.tpl +++ b/templates/CRM/Contribute/Page/ContributionPageEdit.tpl @@ -98,12 +98,12 @@ {ts}New personal campaign page{/ts}