1

Just wondering if there needs to be any sanitization here:

/**
 * Implements hook_ajax_render_alter().
 */
function my_module_ajax_render_alter(&$commands) {
  if (isset($_POST['_triggering_element_name'])) {
    $commands[] = array(
      'command' => 'myCustomCommand',
      'data' => $_POST['_triggering_element_name'],
    );
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.