MediaWiki  1.30.0
recaptchalib.php File Reference

Go to the source code of this file.

Functions

 _recaptcha_http_post ( $host, $path, $data, $port=80)
 Submits an HTTP POST to a reCAPTCHA server. More...
 
 _recaptcha_qsencode ( $data)
 Encodes the given data into a query string format. More...
 
 recaptcha_get_html ( $pubkey, $error=null, $use_ssl=false)
 Gets the challenge HTML (javascript and non-javascript version). More...
 

Variables

const RECAPTCHA_API_SECURE_SERVER "https://www.google.com/recaptcha/api"
 
const RECAPTCHA_API_SERVER "http://www.google.com/recaptcha/api"
 This is a PHP library that handles calling reCAPTCHA. More...
 
const RECAPTCHA_VERIFY_SERVER "www.google.com"
 

Function Documentation

◆ _recaptcha_http_post()

_recaptcha_http_post (   $host,
  $path,
  $data,
  $port = 80 
)

Submits an HTTP POST to a reCAPTCHA server.

Parameters
string$host
string$path
array$data
intport
Returns
array response

Definition at line 67 of file recaptchalib.php.

References $req, $response, and _recaptcha_qsencode().

◆ _recaptcha_qsencode()

_recaptcha_qsencode (   $data)

Encodes the given data into a query string format.

Parameters
$data- array of string elements to be encoded
Returns
string - encoded request

Definition at line 47 of file recaptchalib.php.

References $req, $value, and as.

Referenced by _recaptcha_http_post().

◆ recaptcha_get_html()

recaptcha_get_html (   $pubkey,
  $error = null,
  $use_ssl = false 
)

Gets the challenge HTML (javascript and non-javascript version).

This is called from the browser, and the resulting reCAPTCHA HTML widget is embedded within the HTML form it was called from.

Parameters
string$pubkeyA public key for reCAPTCHA
string$errorThe error given by reCAPTCHA (optional, default is null)
boolean$use_sslShould the request be made over ssl? (optional, default is false)
Returns
string - The HTML to be embedded in the user's form.

Definition at line 106 of file recaptchalib.php.

References RECAPTCHA_API_SECURE_SERVER, and RECAPTCHA_API_SERVER.

Referenced by ReCaptcha\getFormInformation(), and HTMLReCaptchaField\getInputHTML().

Variable Documentation

◆ RECAPTCHA_API_SECURE_SERVER

const RECAPTCHA_API_SECURE_SERVER "https://www.google.com/recaptcha/api"

Definition at line 39 of file recaptchalib.php.

Referenced by recaptcha_get_html().

◆ RECAPTCHA_API_SERVER

const RECAPTCHA_API_SERVER "http://www.google.com/recaptcha/api"

This is a PHP library that handles calling reCAPTCHA.

Copyright (c) 2007 reCAPTCHA – http://recaptcha.net AUTHORS: Mike Crawford Ben Maurer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The reCAPTCHA server URL's

Definition at line 38 of file recaptchalib.php.

Referenced by recaptcha_get_html().

◆ RECAPTCHA_VERIFY_SERVER

const RECAPTCHA_VERIFY_SERVER "www.google.com"

Definition at line 40 of file recaptchalib.php.