commit 63687d6e39267994701046f1c0dd372db968e5b9 Author: Karoly Negyesi Date: Thu Aug 11 19:13:06 2011 +0200 Removed eval from skinr diff --git a/README.markdown b/README.markdown index d0fe9ed..522dcb0 100644 --- a/README.markdown +++ b/README.markdown @@ -55,6 +55,7 @@ Other Removed eval() -------------- * modr8 - http://drupal.org/node/1249228 +* skinr - http://drupal.org/node/1236200 Multisite Install Profile ------------------------- diff --git a/public_html/sites/all/modules/contrib/skinr/skinr.module b/public_html/sites/all/modules/contrib/skinr/skinr.module index be1760c..fb6d6d0 100644 --- a/public_html/sites/all/modules/contrib/skinr/skinr.module +++ b/public_html/sites/all/modules/contrib/skinr/skinr.module @@ -240,9 +240,17 @@ function skinr_form_alter(&$form, $form_state, $form_id) { } // Only add submit handler once. - eval('$element =& $form'. $form_settings['submit_handler_attach_to'] .';'); - if (!empty($element) && !in_array('skinr_form_submit', $element)) { - $string = $element[] = 'skinr_form_submit'; + if (is_string($form_settings['submit_handler_attach_to'])) { + // Backwards compatibility with previous versions + $form_settings['submit_handler_attach_to'] = explode('][', preg_replace('/(^\[|\]$|\'|")/', '', $form_settings['submit_handler_attach_to'])); + } + // Find the property to check + $attr = &$form; + foreach($form_settings['submit_handler_attach_to'] as $part) { + $attr = &$attr[$part]; + } + if (!empty($attr) && !in_array('skinr_ui_form_submit', $attr)) { + $string = $attr[] = 'skinr_ui_form_submit'; } // Keep looping, there might be other modules that implement the same form_id.