diff options
-rw-r--r-- | layouts/search/single.html | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/layouts/search/single.html b/layouts/search/single.html index 639cb6f..768c5c1 100644 --- a/layouts/search/single.html +++ b/layouts/search/single.html @@ -1,7 +1,11 @@ {{ define "customphp" -}}
{{ "<?php" | safeHTML }}
-
- $q = $_GET['q'];
+ if (isset($_GET['q']) && $_GET['q'] != '') {
+
+ $q =$_GET['q'];
+}
+
+
$manticore = new mysqli("127.0.0.1", "", "", "", 9306);
$q=$manticore->real_escape_string($q);
$sphinxQl="SELECT * ,SNIPPET(content,'".$q."','limit=200') as snippet FROM hugo WHERE MATCH('".$q."')";
|