From adff27d86db674b2ccdcfc0a2f42b38b2084bef6 Mon Sep 17 00:00:00 2001 From: kristuff Date: Tue, 23 Feb 2021 20:31:53 +0100 Subject: [PATCH] v0.9.11 **Fixed** - getCategoryIdByName and getCategoryNameById now return string (instead array) - IoT Targeted report category now named iot (instead of oit) --- README.md | 2 +- lib/ApiBase.php | 10 +++++----- lib/ApiHandler.php | 4 ++-- lib/ApiResponse.php | 2 +- lib/CurlTrait.php | 2 +- lib/InvalidPermissionException.php | 2 +- lib/QuietApiHandler.php | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1763b8a..b9df5c3 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Deploy with composer: ```json ... "require": { - "kristuff/abuseipdb": ">=0.9.10-stable" + "kristuff/abuseipdb": ">=0.9.11-stable" }, ``` diff --git a/lib/ApiBase.php b/lib/ApiBase.php index c0d029e..2be1bd9 100644 --- a/lib/ApiBase.php +++ b/lib/ApiBase.php @@ -14,7 +14,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * - * @version 0.9.10 + * @version 0.9.11 * @copyright 2020-2021 Kristuff */ @@ -128,7 +128,7 @@ abstract class ApiBase // Abuse was targeted at an "Internet of Things" type device. Include // information about what type of device was targeted in the comments. - ['oit' , '23', 'IoT Targeted', true], + ['iot' , '23', 'IoT Targeted', true], ]; /** @@ -153,11 +153,11 @@ abstract class ApiBase * * @return string|bool The category id in string format if found, otherwise false */ - public static function getCategoryIdbyName(string $categoryName) + public static function getCategoryIdByName(string $categoryName) { foreach (self::$aipdbApiCategories as $cat){ if ($cat[0] === $categoryName) { - return $cat; + return $cat[1]; } } @@ -178,7 +178,7 @@ abstract class ApiBase { foreach (self::$aipdbApiCategories as $cat){ if ($cat[1] === $categoryId) { - return $cat; + return $cat[0]; } } diff --git a/lib/ApiHandler.php b/lib/ApiHandler.php index 7f93857..2bf2d43 100644 --- a/lib/ApiHandler.php +++ b/lib/ApiHandler.php @@ -14,7 +14,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * - * @version 0.9.10 + * @version 0.9.11 * @copyright 2020-2021 Kristuff */ @@ -35,7 +35,7 @@ class ApiHandler extends ApiBase /** * @var string */ - const VERSION = 'v0.9.10'; + const VERSION = 'v0.9.11'; /** * The ips to remove from report messages diff --git a/lib/ApiResponse.php b/lib/ApiResponse.php index 8fa3e3c..099e705 100644 --- a/lib/ApiResponse.php +++ b/lib/ApiResponse.php @@ -14,7 +14,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * - * @version 0.9.10 + * @version 0.9.11 * @copyright 2020-2021 Kristuff */ diff --git a/lib/CurlTrait.php b/lib/CurlTrait.php index ba44556..18ce4f1 100644 --- a/lib/CurlTrait.php +++ b/lib/CurlTrait.php @@ -14,7 +14,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * - * @version 0.9.10 + * @version 0.9.11 * @copyright 2020-2021 Kristuff */ diff --git a/lib/InvalidPermissionException.php b/lib/InvalidPermissionException.php index fd5b75c..27becac 100644 --- a/lib/InvalidPermissionException.php +++ b/lib/InvalidPermissionException.php @@ -14,7 +14,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * - * @version 0.9.10 + * @version 0.9.11 * @copyright 2020-2021 Kristuff */ diff --git a/lib/QuietApiHandler.php b/lib/QuietApiHandler.php index 0bea1ee..96211d7 100644 --- a/lib/QuietApiHandler.php +++ b/lib/QuietApiHandler.php @@ -14,7 +14,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * - * @version 0.9.10 + * @version 0.9.11 * @copyright 2020-2021 Kristuff */