fix typo
This commit is contained in:
parent
64b090ee05
commit
785452873f
59 changed files with 2592 additions and 1277 deletions
29
opensearch.php
Normal file
29
opensearch.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
header("Content-Type: application/xml");
|
||||
include "data/config.php";
|
||||
|
||||
$domain =
|
||||
htmlspecialchars(
|
||||
(strpos(strtolower($_SERVER['SERVER_PROTOCOL']), 'https') === false ? 'http' : 'https') .
|
||||
'://' . $_SERVER["HTTP_HOST"]
|
||||
);
|
||||
|
||||
echo
|
||||
'<?xml version="1.0" encoding="UTF-8"?>' .
|
||||
'<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">' .
|
||||
'<ShortName>' . htmlspecialchars(config::SERVER_NAME) . '</ShortName>' .
|
||||
'<InputEncoding>UTF-8</InputEncoding>' .
|
||||
'<Image width="16" height="16">' . $domain . '/favicon.ico</Image>' .
|
||||
'<Url type="text/html" method="GET" template="' . $domain . '/web?s={searchTerms}"/>';
|
||||
|
||||
if(
|
||||
isset($_GET["ac"]) &&
|
||||
is_string($_GET["ac"]) &&
|
||||
$_GET["ac"] != "disabled"
|
||||
){
|
||||
|
||||
echo '<Url rel="suggestions" type="application/x-suggestions+json" template="' . $domain . '/api/v1/ac?s={searchTerms}&scraper=' . htmlspecialchars($_GET["ac"]) . '"/>';
|
||||
}
|
||||
|
||||
echo '</OpenSearchDescription>';
|
Loading…
Add table
Add a link
Reference in a new issue