mirror of
https://github.com/YGGverse/YGGo.git
synced 2025-02-07 12:24:28 +00:00
fix data type formatting
This commit is contained in:
parent
79878d17fe
commit
baa8b0d2f0
@ -288,7 +288,7 @@ foreach ($db->getHostPageCrawlQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECOND
|
||||
$hostImageDescriptionCRC32id = crc32(md5((string) $imageAlt . (string) $imageTitle));
|
||||
|
||||
if (!$db->getHostImageDescription($hostImageId, $hostImageDescriptionCRC32id)) {
|
||||
$db->addHostImageDescription($hostImageId, $hostImageDescriptionCRC32id, (string) Filter::imageAlt($imageAlt), (string) Filter::imageTitle($imageTitle), time());
|
||||
$db->addHostImageDescription($hostImageId, $hostImageDescriptionCRC32id, Filter::imageAlt($imageAlt), Filter::imageTitle($imageTitle), time());
|
||||
}
|
||||
|
||||
// Relate host image with host page was found
|
||||
|
@ -2,12 +2,16 @@
|
||||
|
||||
class Filter {
|
||||
|
||||
static public function url(string $url) {
|
||||
static public function url(mixed $url) {
|
||||
|
||||
$url = (string) $url;
|
||||
|
||||
return trim(urldecode($url));
|
||||
}
|
||||
|
||||
static public function pageTitle(string $title) {
|
||||
static public function pageTitle(mixed $title) {
|
||||
|
||||
$title = (string) $title;
|
||||
|
||||
$title = preg_replace('/[\s]+/', ' ', $title);
|
||||
|
||||
@ -16,7 +20,9 @@ class Filter {
|
||||
return $title;
|
||||
}
|
||||
|
||||
static public function pageDescription(string $description) {
|
||||
static public function pageDescription(mixed $description) {
|
||||
|
||||
$description = (string) $description;
|
||||
|
||||
$description = preg_replace('/[\s]+/', ' ', $description);
|
||||
|
||||
@ -25,7 +31,9 @@ class Filter {
|
||||
return $description;
|
||||
}
|
||||
|
||||
static public function pageKeywords(string $keywords) {
|
||||
static public function pageKeywords(mixed $keywords) {
|
||||
|
||||
$keywords = (string) $keywords;
|
||||
|
||||
$keywords = preg_replace('/[\s]+/', ' ', $keywords);
|
||||
|
||||
@ -34,21 +42,27 @@ class Filter {
|
||||
return $keywords;
|
||||
}
|
||||
|
||||
static public function imageAlt(string $alt) {
|
||||
static public function imageAlt(mixed $alt) {
|
||||
|
||||
$alt = (string) $alt;
|
||||
|
||||
$alt = trim($alt);
|
||||
|
||||
return $alt;
|
||||
}
|
||||
|
||||
static public function imageTitle(string $title) {
|
||||
static public function imageTitle(mixed $title) {
|
||||
|
||||
$title = (string) $title;
|
||||
|
||||
$title = trim($title);
|
||||
|
||||
return $title;
|
||||
}
|
||||
|
||||
static public function pageData(string $data) {
|
||||
static public function pageData(mixed $data) {
|
||||
|
||||
$data = (string) $data;
|
||||
|
||||
$filterDataPre = [
|
||||
'/<script.*?\/script>/s',
|
||||
|
Loading…
x
Reference in New Issue
Block a user