Compare commits

...

4 Commits

Author SHA1 Message Date
ngn
16f954f1e5 ups: update to 430c0a2
All checks were successful
docker / docker (push) Successful in 31s
2025-07-11 11:11:58 +03:00
f7db6ba295 fix potential xss woops 2025-07-11 11:11:48 +03:00
8bea7758f0 duckduckgo spelling fix 2025-07-11 11:10:21 +03:00
b794dcbcd3 marginalia crash fix 2025-07-11 11:10:03 +03:00
5 changed files with 13 additions and 8 deletions

View File

@ -24,7 +24,7 @@ class anubis{
"script" "script"
); );
if(count($script) === 0){ if($script === false){
throw new Exception("Failed to scrape anubis challenge data"); throw new Exception("Failed to scrape anubis challenge data");
} }

View File

@ -719,7 +719,7 @@ class ddg{
->getTextContent( ->getTextContent(
$json["suggestion"] $json["suggestion"]
), ),
"correction" => $json["recourseText"] "correction" => html_entity_decode($json["recourseText"])
]; ];
} }
} }

View File

@ -317,14 +317,19 @@ class marginalia{
// //
// Bypass anubis check // Bypass anubis check
// //
/*
if(($anubis_key = apcu_fetch("marginalia_cookie")) === false){ if(($anubis_key = apcu_fetch("marginalia_cookie")) === false){
try{ try{
$html = $html =
$this->get( $this->get(
$proxy, $proxy,
"https://old-search.marginalia.nu/" "https://old-search.marginalia.nu/search",
[
"query" => $search
]
); );
}catch(Exception $error){ }catch(Exception $error){
throw new Exception("Failed to get anubis challenge"); throw new Exception("Failed to get anubis challenge");
@ -361,7 +366,7 @@ class marginalia{
} }
apcu_store("marginalia_cookie", $anubis_key); apcu_store("marginalia_cookie", $anubis_key);
} }*/
if($get["npt"]){ if($get["npt"]){
@ -377,7 +382,7 @@ class marginalia{
$proxy, $proxy,
"https://old-search.marginalia.nu/search?" . $params, "https://old-search.marginalia.nu/search?" . $params,
[], [],
$anubis_key //$anubis_key
); );
}catch(Exception $error){ }catch(Exception $error){
@ -408,7 +413,7 @@ class marginalia{
$proxy, $proxy,
"https://old-search.marginalia.nu/search", "https://old-search.marginalia.nu/search",
$params, $params,
$anubis_key //$anubis_key
); );
}catch(Exception $error){ }catch(Exception $error){

View File

@ -84,7 +84,7 @@ if($results["spelling"]["type"] != "no_correction"){
'&' . '&' .
$frontend->buildquery($get, true) . $frontend->buildquery($get, true) .
'&spellcheck=no">' . '&spellcheck=no">' .
$results["spelling"]["correction"] . htmlspecialchars($results["spelling"]["correction"]) .
'</a>?' . '</a>?' .
'</div>'; '</div>';
} }

View File

@ -1,7 +1,7 @@
{ {
"upstream": "https://git.lolcat.ca/lolcat/4get", "upstream": "https://git.lolcat.ca/lolcat/4get",
"provider": "gitea", "provider": "gitea",
"commit": "a2bc1e6190bab561b7244e2e9bbda994ab0d0d31", "commit": "430c0a2f0f72f1254ab65d53f13640fe02418f05",
"scripts": [ "scripts": [
"s/--- a\\//--- a\\/src\\//g", "s/--- a\\//--- a\\/src\\//g",
"s/+++ b\\//+++ b\\/src\\//g" "s/+++ b\\//+++ b\\/src\\//g"