mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-02-03 10:25:52 +00:00
fix mime content type update
This commit is contained in:
parent
34e25a1d94
commit
0fed16621a
@ -233,15 +233,17 @@ try {
|
|||||||
// Skip page processing non 200 code
|
// Skip page processing non 200 code
|
||||||
if (200 != $curl->getCode()) {
|
if (200 != $curl->getCode()) {
|
||||||
|
|
||||||
$db->updateHostPageHttpCode($queueHostPage->hostPageId, $curl->getCode(), time());
|
|
||||||
|
|
||||||
$hostPagesBanned += $db->updateHostPageTimeBanned($queueHostPage->hostPageId, time());
|
$hostPagesBanned += $db->updateHostPageTimeBanned($queueHostPage->hostPageId, time());
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip page processing on MIME type not provided
|
// Validate MIME content type
|
||||||
if (!$contentType = $curl->getContentType()) {
|
if ($contentType = $curl->getContentType()) {
|
||||||
|
|
||||||
|
$db->updateHostPageMime($queueHostPage->hostPageId, Filter::mime($contentType), time());
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
$hostPagesBanned += $db->updateHostPageTimeBanned($queueHostPage->hostPageId, time());
|
$hostPagesBanned += $db->updateHostPageTimeBanned($queueHostPage->hostPageId, time());
|
||||||
|
|
||||||
@ -261,8 +263,6 @@ try {
|
|||||||
|
|
||||||
if ($hostPageBanned) {
|
if ($hostPageBanned) {
|
||||||
|
|
||||||
$db->updateHostPageMime($queueHostPage->hostPageId, Filter::mime($contentType), time());
|
|
||||||
|
|
||||||
$hostPagesBanned += $db->updateHostPageTimeBanned($queueHostPage->hostPageId, time());
|
$hostPagesBanned += $db->updateHostPageTimeBanned($queueHostPage->hostPageId, time());
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
@ -276,15 +276,6 @@ class MySQL {
|
|||||||
return $query->rowCount();
|
return $query->rowCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateHostPageHttpCode(int $hostPageId, int $httpCode) {
|
|
||||||
|
|
||||||
$query = $this->_db->prepare('UPDATE `hostPage` SET `httpCode` = ? WHERE `hostPageId` = ? LIMIT 1');
|
|
||||||
|
|
||||||
$query->execute([$httpCode, $hostPageId]);
|
|
||||||
|
|
||||||
return $query->rowCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function updateHostPageMime(int $hostPageId, string $mime) {
|
public function updateHostPageMime(int $hostPageId, string $mime) {
|
||||||
|
|
||||||
$query = $this->_db->prepare('UPDATE `hostPage` SET `mime` = ? WHERE `hostPageId` = ? LIMIT 1');
|
$query = $this->_db->prepare('UPDATE `hostPage` SET `mime` = ? WHERE `hostPageId` = ? LIMIT 1');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user