mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-05 14:01:32 +00:00
checkup: delete images containing cloudcrap scripts
<script src="/_Incapsula_Resource?...>
This commit is contained in:
parent
eee06c920b
commit
035d304150
1 changed files with 8 additions and 1 deletions
|
@ -186,8 +186,15 @@ class CheckupCommand extends CConsoleCommand
|
||||||
$nbUpdated = 0; $nbDropped = 0;
|
$nbUpdated = 0; $nbDropped = 0;
|
||||||
foreach ($coins->findAll() as $coin) {
|
foreach ($coins->findAll() as $coin) {
|
||||||
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);
|
||||||
|
if (strstr($data, "<script ")) {
|
||||||
|
unlink($this->basePath.$coin->image);
|
||||||
|
$coin->image = NULL;
|
||||||
|
$nbDropped += $coin->save();
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
if (file_exists($this->basePath."/images/coin-$coin->symbol.png")) {
|
if (file_exists($this->basePath."/images/coin-$coin->symbol.png")) {
|
||||||
$coin->image = "/images/coin-$coin->symbol.png";
|
$coin->image = "/images/coin-$coin->symbol.png";
|
||||||
$nbUpdated += $coin->save();
|
$nbUpdated += $coin->save();
|
||||||
|
|
Loading…
Add table
Reference in a new issue