Download & Extend

PHP errors on activation of module

Project:CAPTCHA
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

When the module is first enabled a number of PHP warnings are generated because no captcha 'type' (image, math etc) has yet been selected.

The module trys to loads an empty string - 'captcha_.inc' file name.

Comments

#1

Status:active» needs review

_captcha_load() tries to access a system variable that does not exist at this moment.

Way 1 to solve the Problem:
change $captcha_type = variable_get("captcha_type", NULL); to $captcha_type = variable_get("captcha_type", 'math');
Way 2:
Check if variable_get() returns NULL and exit with FALSE.

AttachmentSizeStatusTest resultOperations
patch_16.txt747 bytesIgnored: Check issue status.NoneNone

#2

Status:needs review» closed (fixed)

Fixed.