Skip to content

Commit 9156341

Browse files
authored
URL encode param names, fix proxy, validate host (#22)
* URL encode param names, fix proxy, validate host * remove PHP 8.1 * phpunit no longer runs against PHP 8.2
1 parent 56705d6 commit 9156341

File tree

8 files changed

+147
-67
lines changed

8 files changed

+147
-67
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
# https://www.php.net/supported-versions.php
17-
php-version: ["8.1", "8.2", "8.3", "8.4", "8.5"]
17+
php-version: ["8.3", "8.4", "8.5"]
1818

1919
name: PHP OpenCage Geocode
2020

CHANGES.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
3.4.0 -- Sat Mar 29 2026
2+
=====================================================
3+
- deprecate PHP 8.1
4+
- URL encode API key and all query parameter names
5+
- host and proxy parameter have to be set before calling geocode(). Values are now
6+
stricter. In the last 30 days no customer used either option.
7+
- Explicitly enforce SSL certificate verification in both CURL and fopen.
8+
- Proxy now requires CURL extension; raises explicit error with fopen fallback
9+
- Fix stream context not being passed to file_get_contents
10+
111
3.3.4 -- Mon Dec 15 2025
212
=====================================================
313
- removes deprecation warning when using PHP 8.5 on $http_response_header created by fopen (thanks to @TimWolla)

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ if ($result && $result['total_results'] > 0) {
8989
### Set a proxy URL
9090

9191
```php
92-
$geocoder->setProxy('http://proxy.example.com:1234');
92+
$geocoder = new \OpenCage\Geocoder\Geocoder('YOUR-API-KEY');
93+
$geocoder->setProxy('https://proxy.example.com:1234');
9394
$result = $geocoder->geocode("Brandenburger Tor, Berlin");
9495
print_r($result['results'][0]['formatted']);
9596
// Brandenburger Tor, Unter den Linden, 10117 Berlin, Germany

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
}
1616
},
1717
"require": {
18-
"php": ">=8.1"
18+
"php": ">=8.2"
1919
},
2020
"require-dev": {
21-
"phpunit/phpunit": "^10.5 || ^11.0 || ^12.0",
21+
"phpunit/phpunit": "^12.5.8",
2222
"squizlabs/php_codesniffer": "^3.7 || ^4.0",
2323
"phpstan/phpstan": "^2.0"
2424
},

composer.lock

Lines changed: 53 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)