You are here

function stripe_element_remove_name in Stripe 7

Pre render callback for Stripe elements with sensitive information, to remove the 'name' attribute. This ensures that the browser doesn't post the values back to the server.

1 string reference to 'stripe_element_remove_name'
stripe_element_process in ./stripe.module
Process callback for this module elements.

File

./stripe.module, line 303
stripe.module Drupal hooks used for integrating the Stripe service.

Code

function stripe_element_remove_name($element) {
  $name_pattern = '/\\sname\\s*=\\s*[\'"]?' . preg_quote($element['#name']) . '[\'"]?/';
  return preg_replace($name_pattern, '', $content);
}