From 0e9e0392c60068c360eb1cc3b40754df440bf572 Mon Sep 17 00:00:00 2001 From: drastik <jwjoshuawalker@gmail.com> Date: Fri, 9 Jan 2015 11:46:03 -0600 Subject: [PATCH] Fix possibility for "Undefined index: class" assigning .stripe-payment-form in hook_buildForm(). --- stripe.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stripe.php b/stripe.php index 210efe69..71199685 100644 --- a/stripe.php +++ b/stripe.php @@ -122,6 +122,9 @@ function stripe_civicrm_buildForm($formName, &$form) { if (!stristr($formName, '_Confirm') && !stristr($formName, '_ThankYou')) { // This is the 'Main', or first step of the form that collects CC data. if (!isset($form->_elementIndex['stripe_token'])) { + if (empty($form->_attributes['class'])) { + $form->_attributes['class'] = ''; + } $form->_attributes['class'] .= " stripe-payment-form"; $form->addElement('hidden', 'stripe_token', NULL, array('id' => 'stripe-token')); stripe_add_stripe_js($form); -- GitLab