Add specific exception for disabled search
[gitphp.git] / include / controller / Controller_Message.class.php
blob:a/include/controller/Controller_Message.class.php -> blob:b/include/controller/Controller_Message.class.php
--- a/include/controller/Controller_Message.class.php
+++ b/include/controller/Controller_Message.class.php
@@ -154,6 +154,18 @@
 			return 'Project is required';
 		}
 
+		if ($exception instanceof GitPHP_SearchDisabledException) {
+			if ($exception->FileSearch) {
+				if ($this->resource)
+					return $this->resource->translate('File search has been disabled');
+				return 'File search has been disabled';
+			} else {
+				if ($this->resource)
+					return $this->resource->translate('Search has been disabled');
+				return 'Search has been disabled';
+			}
+		}
+
 		return $exception->getMessage();
 	}
 

comments