Projet

Général

Profil

Révision 0ef18d70

Ajouté par Assos Assos il y a environ 9 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/honeypot/honeypot.admin.inc
32 32
  $form['configuration']['honeypot_element_name'] = array(
33 33
    '#type' => 'textfield',
34 34
    '#title' => t('Honeypot element name'),
35
    '#description' => t("The name of the Honeypot form field. It's usually most effective to use a generic name like email, homepage, or name, but this should be changed if it interferes with fields that are already in your forms. Must not contain spaces or special characters."),
35
    '#description' => t("The name of the Honeypot form field. It's usually most effective to use a generic name like email, homepage, or link, but this should be changed if it interferes with fields that are already in your forms. Must not contain spaces or special characters."),
36 36
    '#default_value' => variable_get('honeypot_element_name', 'url'),
37 37
    '#required' => TRUE,
38 38
    '#size' => 30,
......
170 170
  if (!preg_match("/^[-_a-zA-Z0-9]+$/", $form_state['values']['honeypot_element_name'])) {
171 171
    form_set_error('honeypot_element_name', t("The element name cannot contain spaces or other special characters."));
172 172
  }
173

  
174
  // Make sure Honeypot element name isn't one of the reserved names.
175
  $reserved_element_names = array(
176
    'name',
177
    'pass',
178
    'website',
179
  );
180
  if (in_array($form_state['values']['honeypot_element_name'], $reserved_element_names)) {
181
    form_set_error('honeypot_element_name', t("The element name cannot match one of the common Drupal form field names (e.g. @names).", array('@names' => implode(', ', $reserved_element_names))));
182
  }
173 183
}
174 184

  
175 185
/**

Formats disponibles : Unified diff