From 63cf4192a848759e63e0fcc361c24d3b91a3374a Mon Sep 17 00:00:00 2001
From: sarehag <joakim.sarehag@gmail.com>
Date: Fri, 4 Mar 2016 11:34:57 +0100
Subject: [PATCH] #1477:Search heading still displayed although search disabled

---
 inc/template.php | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/inc/template.php b/inc/template.php
index a1bdc8d64..ec9974211 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -303,10 +303,13 @@ function tpl_metaheaders($alt = true) {
 
     // the usual stuff
     $head['meta'][] = array('name'=> 'generator', 'content'=> 'DokuWiki');
-    $head['link'][] = array(
-        'rel' => 'search', 'type'=> 'application/opensearchdescription+xml',
-        'href'=> DOKU_BASE.'lib/exe/opensearch.php', 'title'=> $conf['title']
-    );
+    if(actionOK('search')) {
+        $head['link'][] = array(
+            'rel' => 'search', 'type'=> 'application/opensearchdescription+xml',
+            'href'=> DOKU_BASE.'lib/exe/opensearch.php', 'title'=> $conf['title']
+        );
+    }
+
     $head['link'][] = array('rel'=> 'start', 'href'=> DOKU_BASE);
     if(actionOK('index')) {
         $head['link'][] = array(
-- 
GitLab