Skip to content

Instantly share code, notes, and snippets.

@danielneis
Created December 10, 2019 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielneis/4113cae86ca5ac817b7f8315d8d308da to your computer and use it in GitHub Desktop.
Save danielneis/4113cae86ca5ac817b7f8315d8d308da to your computer and use it in GitHub Desktop.
diff --git a/search/index.php b/search/index.php
index 936dfbc7a70..088251c1c69 100644
--- a/search/index.php
+++ b/search/index.php
@@ -66,6 +66,10 @@ if (\core_search\manager::is_global_search_enabled() === false) {
$search = \core_search\manager::instance(true);
+if (strpos($q, 'admin:') === 0) {
+ redirect(new moodle_url('/admin/search.php', ['query' => trim(substr($q, 6))]));
+}
+
// Set up custom data for form.
$customdata = ['searchengine' => $search->get_engine()->get_plugin_name()];
if ($contextid) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment