Skip to content
Snippets Groups Projects
Commit 3f885933 authored by Fabiano Sant'Ana's avatar Fabiano Sant'Ana
Browse files

Issue #2522040 by wundo, Michelle: Backporting changes from Drupal 7

parent 37ef1489
Branches 6.x-2.x
Tags 6.x-2.7
No related merge requests found
......@@ -29,7 +29,7 @@ function captcha_set_form_id_setting($form_id, $captcha_type) {
elseif ($captcha_type == NULL) {
db_query("DELETE FROM {captcha_points} WHERE form_id = '%s'", $form_id);
}
elseif (is_object($captcha_type) && isset($captcha_type->module) && isset($captcha_type->captcha_type)) {
elseif (is_object($captcha_type) && !empty($captcha_type->module) && !empty($captcha_type->captcha_type)) {
db_query("DELETE FROM {captcha_points} WHERE form_id = '%s'", $form_id);
db_query("INSERT INTO {captcha_points} (form_id, module, captcha_type) VALUES ('%s', '%s', '%s')", $form_id, $captcha_type->module, $captcha_type->captcha_type);
}
......@@ -72,7 +72,7 @@ function captcha_get_form_id_setting($form_id, $symbolic=FALSE) {
if (!$captcha_point) {
$captcha_point = NULL;
}
elseif ($captcha_point->captcha_type == 'default') {
elseif (!empty($captcha_point->captcha_type) && $captcha_point->captcha_type == 'default') {
if (!$symbolic) {
list($module, $type) = explode('/', variable_get('captcha_default_challenge', 'captcha/Math'));
$captcha_point->module = $module;
......@@ -82,7 +82,7 @@ function captcha_get_form_id_setting($form_id, $symbolic=FALSE) {
$captcha_point = 'default';
}
}
elseif ($captcha_point->module == NULL && $captcha_point->captcha_type == NULL && $symbolic) {
elseif (empty($captcha_point->module) && empty($captcha_point->captcha_type) && $symbolic) {
$captcha_point = 'none';
}
elseif ($symbolic) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment