Révision bc175c27
Ajouté par Assos Assos il y a plus de 5 ans
drupal7/sites/all/modules/honeypot/honeypot.module | ||
---|---|---|
78 | 78 |
if (variable_get('honeypot_protect_all_forms', 0) && !in_array($form_id, $unprotected_forms)) { |
79 | 79 |
// Don't protect system forms - only admins should have access, and system |
80 | 80 |
// forms may be programmatically submitted by drush and other modules. |
81 |
if (strpos($form_id, 'system_') === FALSE && strpos($form_id, 'search_') === FALSE && strpos($form_id, 'views_exposed_form_') === FALSE) {
|
|
81 |
if (preg_match('/[^a-zA-Z]system_/', $form_id) === 0 && preg_match('/[^a-zA-Z]search_/', $form_id) === 0 && preg_match('/[^a-zA-Z]views_exposed_form_/', $form_id) === 0) {
|
|
82 | 82 |
honeypot_add_form_protection($form, $form_state, array('honeypot', 'time_restriction')); |
83 | 83 |
} |
84 | 84 |
} |
... | ... | |
503 | 503 |
* The path to the honeypot.css file. |
504 | 504 |
*/ |
505 | 505 |
function honeypot_get_css_file_path() { |
506 |
return file_default_scheme() . '://honeypot/honeypot.css'; |
|
506 |
return honeypot_file_default_scheme() . '://honeypot/honeypot.css';
|
|
507 | 507 |
} |
508 | 508 |
|
509 | 509 |
/** |
... | ... | |
513 | 513 |
* The honeypot element class name (e.g. 'url'). |
514 | 514 |
*/ |
515 | 515 |
function honeypot_create_css($element_name) { |
516 |
$path = file_default_scheme() . '://honeypot'; |
|
516 |
$path = honeypot_file_default_scheme() . '://honeypot';
|
|
517 | 517 |
|
518 | 518 |
if (!file_prepare_directory($path, FILE_CREATE_DIRECTORY)) { |
519 | 519 |
drupal_set_message(t('Unable to create Honeypot CSS directory, %path. Check the permissions on your files directory.', array('%path' => file_uri_target($path))), 'error'); |
... | ... | |
592 | 592 |
|
593 | 593 |
return $honeypot_time; |
594 | 594 |
} |
595 |
|
|
596 |
/** |
|
597 |
* Gets the default file stream for honeypot. |
|
598 |
* |
|
599 |
* @return |
|
600 |
* 'public', 'private' or any other file scheme defined as the default. |
|
601 |
* |
|
602 |
* @see file_default_scheme() |
|
603 |
*/ |
|
604 |
function honeypot_file_default_scheme() { |
|
605 |
return variable_get('honeypot_file_default_scheme', file_default_scheme()); |
|
606 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules