coindb: avoid html in retrieved icons

This commit is contained in:
Tanguy Pruvot 2018-06-21 17:27:02 +02:00
parent 0606c9ada8
commit 9038f0941a
2 changed files with 2 additions and 2 deletions

View file

@ -188,7 +188,7 @@ class CheckupCommand extends CConsoleCommand
if (!empty($coin->image)) {
if (file_exists($this->basePath.$coin->image)) {
$data = file_get_contents($this->basePath.$coin->image);
if (strstr($data, "<script ")) {
if (strstr($data, "<script") || strstr($data, "<html")) {
unlink($this->basePath.$coin->image);
$coin->image = NULL;
$nbDropped += $coin->save();

View file

@ -441,7 +441,7 @@ class CoindbCommand extends CConsoleCommand
} catch (Exception $e) {
continue;
}
if (strlen($data) < 3000 || strstr($data, 'script src')) continue;
if (strlen($data) < 3000 || strstr($data, '<script') || strstr($data,'<html')) continue;
echo $symbol." icon found\n";
file_put_contents($local, $data);
if (filesize($local) > 0) {