diff --git a/config.php b/config.php deleted file mode 100644 index 791c2cc..0000000 --- a/config.php +++ /dev/null @@ -1,20 +0,0 @@ - array( - // CURLOPT_PROXY => "ip:port", - // 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/109.0.0.0 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 => 18, - CURLOPT_VERBOSE => false - ) - ); -?> - -// settings basically stolen from LibreX - https://github.com/hnhx/librex diff --git a/image_proxy.php b/image_proxy.php index 4e9756d..bf9781d 100644 --- a/image_proxy.php +++ b/image_proxy.php @@ -7,9 +7,8 @@ $allowed_domains = array("pinimg.com", "i.pinimg.com", "pinterest.com"); if (in_array(get_root_domain($url), $allowed_domains)) { - header("Content-Type: image/jpeg"); + header("Content-type: image/jpeg"); echo request($url); } -?> -// somewhat stolen from github.com/hnhx/librex +?> diff --git a/misc/tools.php b/misc/tools.php index e13f8ec..09123d7 100644 --- a/misc/tools.php +++ b/misc/tools.php @@ -21,12 +21,10 @@ { $config = require "config.php"; - if (isset($_COOKIE[$frontend]) || isset($_REQUEST[$frontend]) || !empty($config->$frontend)) + if (isset($_COOKIE[$frontend]) || !empty($config->$frontend)) { if (isset($_COOKIE[$frontend])) $frontend = $_COOKIE[$frontend]; - else if (isset($_REQUEST[$frontend])) - $frontend = $_REQUEST[$frontend]; else if (!empty($config->$frontend)) $frontend = $config->$frontend; @@ -140,7 +138,7 @@ function check_for_special_search($query) { - if (isset($_COOKIE["disable_special"]) || isset($_REQUEST["disable_special"])) + if (isset($_COOKIE["disable_special"])) return 0; $query_lower = strtolower($query); @@ -194,13 +192,12 @@ function request($url) { - $ch = curl_init($url); -// curl_setopt_array($ch, $config->curl_settings); - curl_setopt($ch, CURLOPT_HEADER, false); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - $response = curl_exec($ch); + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_HEADER, false); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $response = curl_exec($ch); - return $response; + return $response; } function human_filesize($bytes, $dec = 2) @@ -226,13 +223,6 @@ function print_next_page_button($text, $page, $query, $type) { echo "
"; - foreach($_REQUEST as $key=>$value) - { - if ($key != "q" && $key != "p" && $key != "t") - { - echo ""; - } - } echo ""; echo ""; echo ""; @@ -240,5 +230,3 @@ echo "
"; } ?> - -//basically completely stolen from LibreX - https://github.com/hnhx/LibreX diff --git a/search.php b/search.php index d0297d1..2d75be4 100644 --- a/search.php +++ b/search.php @@ -25,13 +25,9 @@ + +<?php + $query = htmlspecialchars(trim($_REQUEST["q"])); + echo $query; +?> - Pinternet + + +
+

Pinternet

+ strlen($query) || strlen($query) > 64) + { + header("Location: ./"); + die(); + } + + echo "value=\"$query\""; + ?> +
+
+
+ +{"resource_response"}->{"data"}->{"results"} as $result) + { + $image = $result->{"images"}->{"orig"}; + $url = $image->{"url"}; + array_push($images, $url); + } + return $images; +}; + +$images = $search($_REQUEST["q"]); +echo json_encode($images); + +foreach ($img as $imgs) { + echo ""; +} + +?>