google reCAPTCHA V2 "Use of undefined constant .."

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
krot
Forum Newbie
Posts: 15
Joined: Sun Nov 23, 2014 9:26 am

google reCAPTCHA V2 "Use of undefined constant .."

Post by krot »

I'm implementing google's reCAPTCHA V2. It works almost perfectly except for the following error located in the recaptchalib.php:

Notice: Use of undefined constant success - assumed 'success' in (script location)

https://github.com/google/ReCAPTCHA/blo ... chalib.php

Anyone got an idea how to fix this?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: google reCAPTCHA V2 "Use of undefined constant .."

Post by Celauran »

Code: Select all

        if (trim($answers [success]) == true) {
should be

Code: Select all

        if (trim($answers ['success']) == true) {
krot
Forum Newbie
Posts: 15
Joined: Sun Nov 23, 2014 9:26 am

Re: google reCAPTCHA V2 "Use of undefined constant .."

Post by krot »

Celauran. Perfect. Thanks :D
Post Reply