Page 1 of 1

How to fix google_captcha.php the error message? (OpenCart 2.3.0.2)

Posted: Mon Jul 17, 2017 10:15 pm
by HAO
Today I originally planned to carry out the Acunetix Vulnerability Scanner, But I suddenly found my google_captcha.php file with an error message.

Because my source of the file was given to me, I forgot where the source of the file came from, May I help me fix this problem?

Because this continues, I can not fill out forms by automatically testing program, Please help me!

Code: Select all

<?php
class ControllerExtensionCaptchaGoogleCaptcha extends Controller {
	public function index($error = array()) {
		$this->load->language('extension/captcha/google_captcha');
		$data['text_captcha'] = $this->language->get('text_captcha');
		$data['entry_captcha'] = $this->language->get('entry_captcha');
		if (isset($error['captcha'])) {
			$data['error_captcha'] = $error['captcha'];
		} else {
			$data['error_captcha'] = '';
		}
		$data['site_key'] = $this->config->get('google_captcha_key');
		$data['route'] = $this->request->get['route']; 
		return $this->load->view('extension/captcha/google_captcha', $data);
	}
	public function validate() {
		if (empty($this->session->data['gcapcha'])) {
			$this->load->language('extension/captcha/google_captcha');
			$recaptcha = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($this->config->get('google_captcha_secret')) . '&response=' . $this->request->post['g-recaptcha-response'] . '&remoteip=' . $this->request->server['REMOTE_ADDR']);
	
			$recaptcha = json_decode($recaptcha, true);
	
			if ($recaptcha['success']) {
				$this->session->data['gcapcha']	= true;
			} else {
				return $this->language->get('error_captcha');
			}
		}
	}
}
error message

Code: Select all

Warning: file_get_contents(https://www.google.com/recaptcha/api/siteverify?secret=6Le-CikUAAAAAHAWGXDVvmmuAVZlGq94DfTLMyWj&response=03AEHxwuy0lQ7qW_dh_2awExwKQuqXr-2ybqzmKURGl3dJQj6Zllwtb6TJdCOIAPeA_oigJ9Tgznr_rfuOIzqITyMCjKhPIE4NRvM9UNnJMDWt1czdN4mKuryakif3TmsyDFDxY9cRS93ti-W_AaEaxUHkr2schUy1JtPk9IbEd3ctK397S4M0Ej9JeMK7j96fNIiXlj9LkrCU8DW8GciNtlT7dSjoHIqYYfMqK7kcz9j_HI5hcOk-75TuiGcfy3HPoXpiwnHVbeHdRcqr7o5VjUz3KxgBERhonPPEEfVySXI44d9yf9Bx_gwjMLePs6ieOCzDXzjI0j4f1uUtuTIrQAnU2tFnqTQJ_6hXy6RwHBxkf0Y2Z4dcirPHKD-T8eQccNpmNg6jCLqKnKTIoMkVGrpETRFhhUQL9U4FDyza-g-CbZl-7M7XNYRSBWmFxHbgy8DCV8XNk5dDYMWxYNpsP7Raj8kPKdhnvA&remoteip=1.173.67.156): failed to open stream: Connection timed out in /home/httpd/vhosts/shianya.com/httpdocs/2302/catalog/controller/extension/captcha/google_captcha.php on line 19

Re: How to fix google_captcha.php the error message? (OpenCart 2.3.0.2)

Posted: Mon Jul 17, 2017 11:04 pm
by HAO
My web hosting provider says they have blocked the IP address of Google, Is this the reason for the inability to function properly?

Re: How to fix google_captcha.php the error message? (OpenCart 2.3.0.2)

Posted: Fri Jul 21, 2017 6:33 pm
by ADD Creative

Code: Select all

failed to open stream: Connection timed out
This error would suggest that www.google.com is blocked.

Re: How to fix google_captcha.php the error message? (OpenCart 2.3.0.2)

Posted: Fri Jul 21, 2017 6:55 pm
by HAO
It looks like my web hosting provider, At that time there have been blocked Google-related IP will cause this problem.

Has solved this problem!