Skip to content

Commit 755912e

Browse files
author
vars1ty
committed
Sync with main patches
1 parent 5f4d804 commit 755912e

File tree

8 files changed

+38
-15
lines changed

8 files changed

+38
-15
lines changed

api.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<br/>
88
<p>\"q\" is the keyword</p>
99
<p>\"p\" is the result page (the first page is 0)</p>
10-
<p>\"t\" is the search type (0=text, 1=image, 2=video, 3=torrent)</p>
10+
<p>\"t\" is the search type (0=text, 1=image, 2=video, 3=torrent, 4=tor)</p>
1111
<br/>
1212
<p>The results are going to be in JSON format.</p>
1313
<p>The API supports both POST and GET requests.</p>";

config.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
// Wikipedia
3838
// Wikiless hardly does anything but bypass censorship in some countries, and remove some small amounts of non-critical JavaScript.
3939
"wikiless" => "https://wikiless.org", // <= Hosted in Finland through Hetzner with low latency, official instance
40+
"quetre" => "", // quora
41+
"libremdb" => "", // imdb
4042

4143
/*
4244
To send requests trough a proxy uncomment CURLOPT_PROXY and CURLOPT_PROXYTYPE:
@@ -57,7 +59,7 @@
5759
CURLOPT_RETURNTRANSFER => true,
5860
CURLOPT_ENCODING => "",
5961
// This should preferably be up-to-date with the latest Chrome version to blend in with requests.
60-
CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",
62+
CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
6163
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
6264
CURLOPT_CUSTOMREQUEST => "GET",
6365
CURLOPT_PROTOCOLS => CURLPROTO_HTTPS | CURLPROTO_HTTP,

engines/ahmia/hidden_service.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function get_hidden_service_results($query): array
1313
$description = $xpath->evaluate(".//p", $result)[0]->textContent;
1414

1515
$results[] = array(
16-
"title" => $title,
16+
"title" => $title ? htmlspecialchars($title) : "No description provided",
1717
"url" => htmlspecialchars($url),
1818
"base_url" => htmlspecialchars(get_base_url($url)),
1919
"description" => htmlspecialchars($description)

engines/bittorrent/thepiratebay.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ function get_thepiratebay_results($response): array
88
$results = array();
99
$json_response = json_decode($response, true);
1010

11-
foreach ($json_response as $response) {
11+
if (empty($json_response)) {
12+
return $results;
13+
}
1214

15+
foreach ($json_response as $response) {
1316
$size = human_filesize($response["size"]);
1417
$hash = $response["info_hash"];
1518
$name = $response["name"];
@@ -24,13 +27,11 @@ function get_thepiratebay_results($response): array
2427
$results[] = array(
2528
"size" => htmlspecialchars($size),
2629
"name" => htmlspecialchars($name),
27-
"seeders" => htmlspecialchars($seeders),
28-
"leechers" => htmlspecialchars($leechers),
30+
"seeders" => (int)htmlspecialchars($seeders),
31+
"leechers" => (int)htmlspecialchars($leechers),
2932
"magnet" => htmlspecialchars($magnet),
3033
"source" => "thepiratebay.org"
3134
);
3235
}
33-
3436
return $results;
35-
36-
}
37+
}

misc/tools.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ function check_for_privacy_frontend($url)
3636
"reddit.com" => "libreddit",
3737
"tiktok.com" => "proxitok",
3838
"translate.google.com" => "libretranslate",
39-
"wikipedia.org" => "wikiless"
39+
"wikipedia.org" => "wikiless",
40+
"quora.com" => "quetre",
41+
"imdb.com" => "libremdb"
4042
);
4143

4244
foreach ($frontends as $original => $frontend) {

search.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<?php
2727
foreach ($_REQUEST as $key => $value) {
2828
if ($key != "q" && $key != "p" && $key != "t") {
29-
echo "<input type='hidden' name='$key' value='$value'/>";
29+
echo "<input type=\"hidden\" name=\"" . htmlspecialchars($key) . "\" value=\"" . htmlspecialchars($value) . "\"/>";
3030
}
3131
}
3232

settings.php

+10
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@
9292
generate_input_field("wikiless", "Wikiless", "", "Replace Wikipedia");
9393
?>
9494
</div>
95+
<div>
96+
<?php
97+
generate_input_field("quetre", "Quetre", "", "Replace Quora");
98+
?>
99+
</div>
100+
<div>
101+
<?php
102+
generate_input_field("libremdb", "LibreMDb", "", "Replace IMDb");
103+
?>
104+
</div>
95105
</div>
96106
<div>
97107
<?php generate_checkbox("disable_frontends", "Disable privacy frontends", "Disables privacy frontends"); ?>

static/css/styles.css

+12-4
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ a:hover,
259259
}
260260

261261
.image-result-container {
262-
display: grid;
263-
grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
262+
display: flex;
263+
flex-wrap: wrap;
264264
grid-gap: 1.5rem;
265265
justify-items: center;
266266
margin-left: 9%;
@@ -269,9 +269,17 @@ a:hover,
269269
margin-bottom: 50px;
270270
}
271271

272+
a[title] {
273+
flex-grow: 1;
274+
height: 12rem;
275+
}
276+
272277
.image-result-container img {
273-
border: 2px solid var(--button-bg);
274-
margin: 10px;
278+
margin: 0;
279+
height: 100%;
280+
width: 100%;
281+
object-fit: cover;
282+
vertical-align: bottom;
275283
}
276284

277285
.footer-container {

0 commit comments

Comments
 (0)