diff --git a/config.php.example b/config.php.example
old mode 100755
new mode 100644
index 4f1929b..f274ed2
--- a/config.php.example
+++ b/config.php.example
@@ -39,9 +39,13 @@
// CURLOPT_PROXYTYPE => CURLPROXY_HTTP,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
- CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36",
+ CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36",
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
CURLOPT_CUSTOMREQUEST => "GET",
+ CURLOPT_PROTOCOLS => CURLPROTO_HTTPS | CURLPROTO_HTTP,
+ CURLOPT_REDIR_PROTOCOLS => CURLPROTO_HTTPS | CURLPROTO_HTTP,
+ CURLOPT_MAXREDIRS => 5,
+ CURLOPT_TIMEOUT => 8,
CURLOPT_VERBOSE => false
)
diff --git a/engines/bittorrent/nyaa.php b/engines/bittorrent/nyaa.php
index 6d4d6e3..e2b846d 100644
--- a/engines/bittorrent/nyaa.php
+++ b/engines/bittorrent/nyaa.php
@@ -20,11 +20,11 @@
array_push($results,
array (
- "name" => $name,
+ "name" => htmlspecialchars($name),
"seeders" => (int) $seeders,
"leechers" => (int) $leechers,
- "magnet" => $magnet,
- "size" => $size,
+ "magnet" => htmlspecialchars($magnet),
+ "size" => htmlspecialchars($size),
"source" => "nyaa.si"
)
);
@@ -32,4 +32,4 @@
return $results;
}
-?>
\ No newline at end of file
+?>
diff --git a/engines/bittorrent/rutor.php b/engines/bittorrent/rutor.php
index 4ef3ec3..c5db2d5 100644
--- a/engines/bittorrent/rutor.php
+++ b/engines/bittorrent/rutor.php
@@ -21,11 +21,11 @@
array_push($results,
array (
- "name" => $name,
+ "name" => htmlspecialchars($name),
"seeders" => (int) remove_special($seeders),
"leechers" => (int) remove_special($leechers),
- "magnet" => $magnet,
- "size" => $size,
+ "magnet" => htmlspecialchars($magnet),
+ "size" => htmlspecialchars($size),
"source" => "rutor.info"
)
);
@@ -33,4 +33,4 @@
return $results;
}
-?>
\ No newline at end of file
+?>
diff --git a/engines/bittorrent/thepiratebay.php b/engines/bittorrent/thepiratebay.php
index 46136a4..2944dbc 100644
--- a/engines/bittorrent/thepiratebay.php
+++ b/engines/bittorrent/thepiratebay.php
@@ -24,11 +24,11 @@
array_push($results,
array (
- "size" => $size,
- "name" => $name,
- "seeders" => $seeders,
- "leechers" => $leechers,
- "magnet" => $magnet,
+ "size" => htmlspecialchars($size),
+ "name" => htmlspecialchars($name),
+ "seeders" => htmlspecialchars($seeders),
+ "leechers" => htmlspecialchars($leechers),
+ "magnet" => htmlspecialchars($magnet),
"source" => "thepiratebay.org"
)
);
@@ -37,4 +37,4 @@
return $results;
}
-?>
\ No newline at end of file
+?>
diff --git a/engines/bittorrent/torrentgalaxy.php b/engines/bittorrent/torrentgalaxy.php
index 5679d79..5d31e82 100644
--- a/engines/bittorrent/torrentgalaxy.php
+++ b/engines/bittorrent/torrentgalaxy.php
@@ -19,11 +19,11 @@
array_push($results,
array (
- "name" => $name,
+ "name" => htmlspecialchars($name),
"seeders" => (int) $seeders,
"leechers" => (int) $leechers,
- "magnet" => $magnet,
- "size" => $size,
+ "magnet" => htmlspecialchars($magnet),
+ "size" => htmlspecialchars($size),
"source" => "torrentgalaxy.to"
)
);
diff --git a/engines/bittorrent/yts.php b/engines/bittorrent/yts.php
index fa43add..f3a588d 100644
--- a/engines/bittorrent/yts.php
+++ b/engines/bittorrent/yts.php
@@ -26,11 +26,11 @@
array_push($results,
array (
- "size" => $size,
- "name" => $name,
- "seeders" => $seeders,
- "leechers" => $leechers,
- "magnet" => $magnet,
+ "size" => htmlspecialchars($size),
+ "name" => htmlspecialchars($name),
+ "seeders" => htmlspecialchars($seeders),
+ "leechers" => htmlspecialchars($leechers),
+ "magnet" => htmlspecialchars($magnet),
"source" => "yts.mx"
)
);
@@ -42,4 +42,4 @@
return $results;
}
-?>
\ No newline at end of file
+?>
diff --git a/engines/google/image.php b/engines/google/image.php
index fe779bf..3cf7361 100644
--- a/engines/google/image.php
+++ b/engines/google/image.php
@@ -61,4 +61,4 @@
echo "";
}
-?>
\ No newline at end of file
+?>
diff --git a/engines/special/currency.php b/engines/special/currency.php
index 4fbc2aa..4c50849 100644
--- a/engines/special/currency.php
+++ b/engines/special/currency.php
@@ -22,10 +22,10 @@
$source = "https://moneyconvert.net/";
return array(
"special_response" => array(
- "response" => $formatted_response,
+ "response" => htmlspecialchars($formatted_response),
"source" => $source
)
);
}
}
-?>
\ No newline at end of file
+?>
diff --git a/engines/special/definition.php b/engines/special/definition.php
index 9ef33c9..bd1f364 100644
--- a/engines/special/definition.php
+++ b/engines/special/definition.php
@@ -14,11 +14,11 @@
$source = "https://dictionaryapi.dev";
return array(
"special_response" => array(
- "response" => $definition,
+ "response" => htmlspecialchars($definition),
"source" => $source
)
);
}
}
-?>
\ No newline at end of file
+?>
diff --git a/engines/special/wikipedia.php b/engines/special/wikipedia.php
index f1df6ed..b7e29c8 100644
--- a/engines/special/wikipedia.php
+++ b/engines/special/wikipedia.php
@@ -14,7 +14,7 @@
$source = check_for_privacy_frontend("https://wikipedia.org/wiki/$query");
$response = array(
"special_response" => array(
- "response" => $description,
+ "response" => htmlspecialchars($description),
"source" => $source
)
);
@@ -30,4 +30,4 @@
return $response;
}
}
-?>
\ No newline at end of file
+?>
diff --git a/index.php b/index.php
index fd2241f..52bdf0a 100644
--- a/index.php
+++ b/index.php
@@ -15,4 +15,4 @@
-
\ No newline at end of file
+
diff --git a/misc/header.php b/misc/header.php
index 3f32587..aa05de9 100644
--- a/misc/header.php
+++ b/misc/header.php
@@ -11,7 +11,7 @@
"/>
diff --git a/search.php b/search.php
index 5fcf435..4c213b4 100644
--- a/search.php
+++ b/search.php
@@ -7,7 +7,7 @@
strlen($query) || strlen($query) > 256)
@@ -107,4 +107,4 @@
}
?>
-
\ No newline at end of file
+
diff --git a/settings.php b/settings.php
index eee5d1b..598f078 100644
--- a/settings.php
+++ b/settings.php
@@ -1,20 +1,36 @@
-
+
+ require "misc/header.php";
+?>