brave fix

This commit is contained in:
2026-10-03 01:41:57 -04:00
parent 047e400c7f
commit 9ae7e3d7a3
+11 -10
View File
@@ -230,17 +230,18 @@ class brave{
$data = $data =
explode( explode(
"data:", "function(",
$discs["innerHTML"], $discs["innerHTML"]
2
); );
if(count($data) !== 2){ $data = $data[count($data) - 1];
throw new Exception("Failed to split up data field"); $data =
} explode(
"return ",
$data = $data[1]; $data,
2
)[1];
break; break;
} }
} }
@@ -449,12 +450,12 @@ class brave{
throw new Exception("Brave returned a PoW captcha"); throw new Exception("Brave returned a PoW captcha");
} }
if(!isset($data[1]["data"]["body"]["response"])){ if(!isset($data["data"]["body"]["response"])){
throw new Exception("Brave did not return a result object"); throw new Exception("Brave did not return a result object");
} }
$data = $data[1]["data"]["body"]["response"]; $data = $data["data"]["body"]["response"];
/* /*
Get web results Get web results