mirror of
https://github.com/kristuff/abuseipdb.git
synced 2024-12-11 10:30:14 -08:00
d7b635875a
- Fixed: Update email pattern in `cleanMessage()` method to handle local addresses without TLD and to allow using the caracter `@` in custom message. Close #4
45 lines
1.0 KiB
PHP
45 lines
1.0 KiB
PHP
<?php declare(strict_types=1);
|
|
|
|
/**
|
|
* _ ___ ___ ___ ___
|
|
* __ _| |__ _ _ ___ ___|_ _| _ \ \| _ )
|
|
* / _` | '_ \ || (_-</ -_)| || _/ |) | _ \
|
|
* \__,_|_.__/\_,_/__/\___|___|_| |___/|___/
|
|
*
|
|
* This file is part of Kristuff\AbuseIPDB.
|
|
*
|
|
* (c) Kristuff <kristuff@kristuff.fr>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*
|
|
* @version 1.1
|
|
* @copyright 2020-2022 Kristuff
|
|
*/
|
|
|
|
namespace Kristuff\AbuseIPDB;
|
|
|
|
/**
|
|
* cURL helper functions
|
|
*/
|
|
trait CurlTrait
|
|
{
|
|
/**
|
|
* helper to configure cURL option
|
|
*
|
|
* @access protected
|
|
* @param resource $ch
|
|
* @param int $option
|
|
* @param mixed $value
|
|
*
|
|
* @return void
|
|
* @throws \RuntimeException
|
|
*/
|
|
protected function setCurlOption($ch, int $option, $value): void
|
|
{
|
|
if(!curl_setopt($ch,$option,$value)){
|
|
throw new \RuntimeException('curl_setopt failed! '.curl_error($ch));
|
|
}
|
|
}
|
|
}
|