PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
← All changes | src/traits/country.php +4 -6 5.4.0 → 6.3.0 View file →
@@ -6,12 +6,11 @@
6 6 */
7 7
8 8 namespace WP_Defender\Traits;
9 9
10 -use DI\NotFoundException;
11 -use DI\DependencyException;
10 +use RuntimeException;
12 11 use WP_Defender\Extra\GeoIp;
13 -use MaxMind\Db\Reader\InvalidDatabaseException;
12 +use WP_DEFENDER_VENDOR\MaxMind\Db\Reader\InvalidDatabaseException;
14 13 use WP_Defender\Model\Setting\Blacklist_Lockout;
15 14
16 15 trait Country {
17 16
@@ -20,10 +19,9 @@
20 19 *
21 20 * @param string $ip IPV4 or IPV6 address.
22 21 *
23 22 * @return array|bool
24 - * @throws DependencyException Container exception.
25 - * @throws NotFoundException Thrown when DI injected class not found.
23 + * @throws RuntimeException Thrown when a dependency cannot be resolved.
26 24 * @throws InvalidDatabaseException Thrown for unexpected data is found in DB.
27 25 */
28 26 public function get_current_country( $ip ) {
29 27 if ( defender_is_wp_cli() ) {
@@ -38,9 +36,9 @@
38 36 return false;
39 37 }
40 38 $model = wd_di()->get( Blacklist_Lockout::class );
41 39 // Additional check if MaxMind dir is deleted.
42 - if ( is_null( $model->geodb_path ) || ! is_file( $model->geodb_path ) ) {
40 + if ( ! is_string( $model->geodb_path ) || ! is_file( $model->geodb_path ) ) {
43 41 return false;
44 42 }
45 43 $helper = new GeoIp( $model->geodb_path );
46 44