mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 09:27:25 +00:00
exchanges: handle more Cloudflare JSON api errors! morons
This commit is contained in:
parent
2cfbd87157
commit
cb7ad18421
1 changed files with 9 additions and 6 deletions
|
@ -1,13 +1,16 @@
|
|||
<?php
|
||||
|
||||
/* A REST/JSON API IS NOT SUPPOSED TO RETURN HTML AND CSS! MORONS!!!! */
|
||||
function strip_data($data)
|
||||
{
|
||||
$out = strip_tags($data);
|
||||
$out = preg_replace("#[\t ]+#", " ", $out);
|
||||
$out = preg_replace("# [\r\n]+#", "\n", $out);
|
||||
$out = preg_replace("#[\r\n]+#", "\n", $out);
|
||||
if (strpos($out, 'CloudFlare') !== false) $out = 'CloudFlare error';
|
||||
return $out;
|
||||
$out = strip_tags($data);
|
||||
$out = preg_replace("#[\t ]+#", " ", $out);
|
||||
$out = preg_replace("# [\r\n]+#", "\n", $out);
|
||||
$out = preg_replace("#[\r\n]+#", "\n", $out);
|
||||
if (strpos($out, 'CloudFlare') !== false) $out = 'CloudFlare error';
|
||||
if (strpos($out, 'DDoS protection by Cloudflare') !== false) $out = 'CloudFlare error';
|
||||
if (strpos($out, '500 Error') !== false) $out = '500 Error';
|
||||
return $out;
|
||||
}
|
||||
|
||||
require_once("poloniex.php");
|
||||
|
|
Loading…
Add table
Reference in a new issue