fix broken mojeek instant answer iamge

This commit is contained in:
lolcat 2025-08-07 17:56:39 -04:00
parent 7ac53c6e11
commit ad535a1609
1 changed files with 8 additions and 7 deletions

View File

@ -692,17 +692,18 @@ class mojeek{
preg_match( preg_match(
'/\/image\?img=([^&]+)/i', '/\/image\?img=([^&]+)/i',
$thumb[0]["attributes"]["src"], $thumb[0]["attributes"]["src"],
$thumb $matches
); );
if(count($thumb) === 2){ if(count($matches) === 2){
// for some reason, if we dont get the image from mojeek
// it sometimes fail to fetch the right image URL
$answer["thumb"] = $answer["thumb"] =
urldecode( "https://mojeek.com" .
$this->fuckhtml $this->fuckhtml
->getTextContent( ->getTextContent(
$thumb[1] $thumb[0]["attributes"]["src"]
)
); );
} }
} }