mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 17:37:25 +00:00
coindb: avoid html in retrieved icons
This commit is contained in:
parent
0606c9ada8
commit
9038f0941a
2 changed files with 2 additions and 2 deletions
|
@ -188,7 +188,7 @@ class CheckupCommand extends CConsoleCommand
|
||||||
if (!empty($coin->image)) {
|
if (!empty($coin->image)) {
|
||||||
if (file_exists($this->basePath.$coin->image)) {
|
if (file_exists($this->basePath.$coin->image)) {
|
||||||
$data = file_get_contents($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);
|
unlink($this->basePath.$coin->image);
|
||||||
$coin->image = NULL;
|
$coin->image = NULL;
|
||||||
$nbDropped += $coin->save();
|
$nbDropped += $coin->save();
|
||||||
|
|
|
@ -441,7 +441,7 @@ class CoindbCommand extends CConsoleCommand
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
continue;
|
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";
|
echo $symbol." icon found\n";
|
||||||
file_put_contents($local, $data);
|
file_put_contents($local, $data);
|
||||||
if (filesize($local) > 0) {
|
if (filesize($local) > 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue