ampersa / surbl
A package to easliy test links and URLs against surbl.org
Installs: 9 372
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: ^7.0 | ^8.0
- league/uri: ^6.0
Requires (Dev)
- phpunit/phpunit: ^9.0
README
This package enables you to query multi.surbl.org with a URL and determine if the domain is listed.
Installation
Composer
$ composer require ampersa/surbl
Usage
Basic usage
use Ampersa\SURBL\SURBL; ... $surbl = new SURBL; $result = $surbl->listed('http://ampersa.co.uk'); // Returns: (bool) false $result = $surbl->listed('http://surbl-org-permanent-test-point.com/'); // Returns: (bool) true
Specify lists to query
By default, all lists (phishing (PH), malware (MW), AbuseButler (ABUSE) and cracked (CR)) are queried.
To specify lists to use, pass a bitmask of options to the constructor
$surbl = new SURBL(SURBL::LIST_PH | SURBL::LIST_MW); $result = $surbl->listed('http://surbl-org-permanent-test-point.com/'); // Returns: (bool) false
Call statically
A static accessor has been included to provide shorthand access to the listed() function. The second argument may be used to pass the bitmask of options.
$result = SURBL::isListed('http://surbl-org-permanent-test-point.com/'); // Returns: (bool) true $result = SURBL::isListed('http://surbl-org-permanent-test-point.com/', SURBL::LIST_PH | SURBL::LIST_MW); // Returns: (bool) false
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request