Tags: dereuromark/cakephp-geo
Tags
Use plugin-specific i18n domain for translations (#98) Convert __() calls in src/ and templates/ to __d('geo', ...) so user-facing strings live in their own translation domain instead of leaking into the host app's default domain. Also re-route the pre-existing __d('tools', ...) calls in the pagination element and GoogleMapHelper alt-text — they were leftovers from when this code was copied from cakephp-tools — to __d('geo', ...) so the plugin owns its strings. Add resources/locales/geo.pot generated via cake i18n extract so translators have a stable POT to base language files on.
Add more tests for improved coverage - GeoCoordinate: comprehensive tests for all methods - Calculator: exception paths, GeoCoordinate support, blur with level 0 - GeoCalculator: empty array exception path - GeoapifyProvider: named colors, hex colors, invalid size, marker options
Fix __PHP_Incomplete_Class error when reading cached geocode data (#77) * Fix __PHP_Incomplete_Class error when reading cached geocode data When cached geocode data cannot be properly unserialized (e.g., due to missing class definitions during autoloading), PHP returns an __PHP_Incomplete_Class object instead of the expected Geocoder\Location. This caused a TypeError when isExpectedType() was called on the invalid object. The fix validates that cached data is a proper Location instance before returning it. If the data is invalid, it deletes the corrupted cache entry and re-geocodes the address. * Store geocode cache as JSON instead of serialized PHP objects This change replaces PHP object serialization with JSON for the cached geocode data, which prevents __PHP_Incomplete_Class issues entirely. Changes: - Add CachedLocation class that implements Geocoder\Location interface and can be reconstructed from JSON array data - Change 'data' column type from 'object' to 'json' - Store $result->toArray() instead of the full Location object - When reading from cache, reconstruct CachedLocation from JSON array - Maintains backwards compatibility: old serialized Location objects are still handled (returned directly if valid, deleted if corrupted) Benefits: - No PHP serialization means no class autoloading issues - JSON is human-readable and debuggable - Cache data survives PHP/library version upgrades - Self-healing: invalid cache entries are automatically cleaned up * Fix coding style and PHPStan errors - Apply PSR-2R coding standard (braces on same line) - Remove unused Location import - Simplify cache reading logic (no backwards compat for old serialized objects since JSON type won't decode them anyway)
Fix security vulnerabilities and add type hints - Fix unsafe deserialization in ObjectType by whitelisting safe classes - Fix path traversal vulnerability in GoogleMapHelper icon method - Fix SQL injection in GeocoderBehavior distanceConditions - Implement isAccurateEnough() method in Geocoder - Add missing type hints to GoogleMapHelper methods - Fix type casting in GeoCoordinate::fromString() 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
PreviousNext