Add spotter-ping.php

This commit is contained in:
Disassembler 2018-09-02 18:16:48 +02:00
parent c564eda438
commit 46f212f1d9
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499

19
zz-extra/spotter-ping.php Normal file
View File

@ -0,0 +1,19 @@
<?php
$url = (string)filter_input(INPUT_POST, 'url');
if (empty($url)) {
exit;
}
if(substr($url, -1) == '/') {
$url = substr($url, 0, -1);
}
$url .= '/spotter-ping';
$ch = curl_init($url);
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HEADER => FALSE, CURLOPT_SSL_VERIFYHOST => FALSE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_TIMEOUT => 4]);
$content = curl_exec($ch);
curl_close($ch);
if ($content == 'spotter-pong') {
echo 'spotter-pong';
}