forked from Cavemanon/cavepaintings
format
This commit is contained in:
@@ -13,7 +13,7 @@ class Eokm extends Extension
|
||||
$username = $config->get_string("eokm_username");
|
||||
$password = $config->get_string("eokm_password");
|
||||
|
||||
if($username && $password) {
|
||||
if ($username && $password) {
|
||||
$ch = curl_init("https://api.eokmhashdb.nl/v1/check/md5");
|
||||
// curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml', $additionalHeaders));
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
@@ -21,18 +21,16 @@ class Eokm extends Extension
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $event->image->hash);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$return = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
if($return == "false") {
|
||||
if ($return == "false") {
|
||||
// all ok
|
||||
}
|
||||
elseif($return == "true") {
|
||||
} elseif ($return == "true") {
|
||||
log_warning("eokm", "User tried to upload banned image {$event->image->hash}");
|
||||
throw new UploadException("Image banned");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
log_warning("eokm", "Unexpected return from EOKM: $return");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user