Skip to content

Commit 2905b65

Browse files
authored
Merge branch 'master' into hostname
2 parents 66017ac + 29feb2a commit 2905b65

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ language: php
33
sudo: false
44

55
php:
6-
- 5.3
7-
- 5.4
8-
- 5.5
9-
- 5.6
6+
- '5.5'
7+
- '5.6'
8+
- '7.0'
9+
- '7.1'
1010
- hhvm
11+
- nightly
1112

1213
before_script:
1314
- composer install

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ $recaptcha = new \ReCaptcha\ReCaptcha($secret);
8383
$resp = $recaptcha->verify($gRecaptchaResponse, $remoteIp);
8484
if ($resp->isSuccess()) {
8585
// verified!
86+
// if Domain Name Validation turned off don't forget to check hostname field
87+
// if($resp->getHostName() === $_SERVER['SERVER_NAME']) { }
8688
} else {
8789
$errors = $resp->getErrorCodes();
8890
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"source": "https://github.com/google/recaptcha"
1111
},
1212
"require": {
13-
"php": ">=5.3.2"
13+
"php": ">=5.5"
1414
},
1515
"require-dev": {
16-
"phpunit/phpunit": "4.5.*"
16+
"phpunit/phpunit": "^4.8"
1717
},
1818
"autoload": {
1919
"psr-4": {

tests/ReCaptcha/ResponseTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public function testIsSuccess()
6262

6363
$response = new Response(false);
6464
$this->assertFalse($response->isSuccess());
65+
66+
$response = new Response(true, array(), 'example.com');
67+
$this->assertEquals('example.com', $response->getHostName());
6568
}
6669

6770
public function testGetErrorCodes()

0 commit comments

Comments
 (0)