From 9b8544d78a20d569463d8d8cf35645404ed784d1 Mon Sep 17 00:00:00 2001 From: Jagadedes Date: Wed, 5 Nov 2014 14:08:48 +0530 Subject: [PATCH] #30846 allow apostrophe in title --- CRM/Wci/Form/CreateWidget.php | 9 +++++---- CRM/Wci/Page/WidgetList.php | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CRM/Wci/Form/CreateWidget.php b/CRM/Wci/Form/CreateWidget.php index 387dc12..320e080 100644 --- a/CRM/Wci/Form/CreateWidget.php +++ b/CRM/Wci/Form/CreateWidget.php @@ -238,9 +238,10 @@ where w.id=" . $this->_id;*/ if(isset($values['hide_pbcap'])){ $hide_pbcap = $values['hide_pbcap']; } + $title = str_replace("'", "''", $values['title']); if (isset($this->_id)) { - $sql = "UPDATE civicrm_wci_widget SET title = '". base64_encode($values['title']) + $sql = "UPDATE civicrm_wci_widget SET title = '". $title . "', logo_image = '" . $values['logo_image'] . "', image = '" . $values['image'] . "', button_title = '" . $values['button_title'] . "', button_link_to = '" . $values['button_link_to'] @@ -268,7 +269,7 @@ where w.id=" . $this->_id;*/ email_signup_group_id, size_variant, color_title, color_title_bg, color_progress_bar, color_widget_bg, color_description, color_border, color_button, color_button_bg, hide_title, hide_border, hide_pbcap, style_rules, override" . $coma . $cust_tmpl_col ." ) - VALUES ('" . base64_encode($values['title']) . "','" . $values['logo_image'] . "','" . + VALUES ('" . $title . "','" . $values['logo_image'] . "','" . $values['image'] . "','" . $values['button_title'] . "','" . $values['button_link_to'] . "','" . $values['progress_bar'] . "','" . base64_encode($values['description']) . "','" . @@ -277,8 +278,8 @@ where w.id=" . $this->_id;*/ $values['color_title_bg'] . "','" . $values['color_bar'] . "','" . $values['color_widget_bg'] . "','" . $values['color_description'] . "','" . $values['color_border'] . "','" . $values['color_button'] . "','" . - $values['color_button_bg'] . "','" . $values['hide_title'] . "','" . - $values['hide_border'] . "','" . $values['hide_pbcap'] . "','" + $values['color_button_bg'] . "','" . $hide_title . "','" . + $hide_border . "','" . $hide_pbcap . "','" . base64_encode($values['style_rules']) . "','" . $override . $quote . $coma . $quote . $cust_tmpl . "')"; diff --git a/CRM/Wci/Page/WidgetList.php b/CRM/Wci/Page/WidgetList.php index 624d246..c3b0ce0 100644 --- a/CRM/Wci/Page/WidgetList.php +++ b/CRM/Wci/Page/WidgetList.php @@ -50,7 +50,7 @@ class CRM_Wci_Page_WidgetList extends CRM_Core_Page { while ($dao->fetch()) { $wid_page[$dao->id] = array(); CRM_Core_DAO::storeValues($dao, $wid_page[$dao->id]); - $wid_page[$dao->id]['title'] = base64_decode($wid_page[$dao->id]['title']); + $wid_page[$dao->id]['title'] = $wid_page[$dao->id]['title']; $description = base64_decode($wid_page[$dao->id]['description']); $wid_page[$dao->id]['description'] = strip_tags($description); -- 2.25.1