From 6eb45cdfe653181235b8e631a7449c5a55ea0170 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20K=C3=A4stner?= Date: Tue, 13 Oct 2015 22:31:59 +0200 Subject: [PATCH] improve browserintegration and add parsing of get parameter in case fragment does not work --- index.php | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 847dbcc..2321c8b 100644 --- a/index.php +++ b/index.php @@ -15,6 +15,10 @@ $dse = ""; if ( isset($_GET['dse']) and preg_match('/^[0-9a-z]{1,5}$/', $_GET['dse']) === 1 ) { // TODO: prevent injection, check whether dse is a valid searchengine $dse = $_GET['dse']; } +$browserintegration = ""; +if ( isset($_GET['include']) and $_GET['include'] == "browserintegration" ) { + $browserintegration = "true"; +} if ( isset($_GET['get']) and $_GET['get'] === "opensearchdescription" ) { header('Content-Type: text/xml'); @@ -45,7 +49,7 @@ if ( isset($_GET['get']) and $_GET['get'] === "opensearchdescription" ) { consearch +' . "\n"; +} +?> +
@@ -232,9 +246,25 @@ please enable javascript

-add to browser +add to browser +

+ + + +

+Now add consearch to your browser. In firefox this is done via the searchbar. If this does not work then consearch can be added via the following form, but this would send all queries to the server :-(

+
' . "\n"; + if ( $dse ) { echo '' . "\n"; } + echo ' +
+'; +} +?> +

about

-- 2.30.2