Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option api_host to custom the reCAPTCHA API server hostname #197

Merged
merged 3 commits into from
Mar 25, 2018

Conversation

moesoha
Copy link
Contributor

@moesoha moesoha commented Mar 25, 2018

The host www.google.com introduced in Google document is blocked in Mainland China. For Chinese users, a solution is to use an official reverse proxy server recaptcha.net. So I add an option api_host(default value: www.google.com) to change the reCAPTCHA API server's hostname.

@excelwebzone
Copy link
Owner

I can merge it but can you make a few small changes before:

  1. Add space between variable and constant:
$apiHost='www.google.com'

to

$apiHost = 'www.google.com'
  1. Use sprintf instead of using .:
'https://'.$apiHost.'/recaptcha/api.js';

to

sprintf('https://%s/recaptcha/api.js';', $apiHost)
  1. Change new parameters names:
protected $RECAPTCHA_API_SERVER;
protected $RECAPTCHA_API_JS_SERVER;

to

protected $recaptchaApiServer;
protected $recaptchaApiJsServer;

@moesoha
Copy link
Contributor Author

moesoha commented Mar 25, 2018

I followed your advice and committed after fixing code style.

@excelwebzone excelwebzone merged commit 6166ea6 into excelwebzone:master Mar 25, 2018
@excelwebzone
Copy link
Owner

Thanks. I tagged it v1.5.6 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants