From 8172b5d5350b94b2756482953d95b06a9fa785f2 Mon Sep 17 00:00:00 2001 From: Stefan Matheis Date: Sat, 5 Jan 2013 10:57:21 +0000 Subject: [PATCH] SOLR-4045: SOLR admin page returns HTTP 404 on core names containing a '.' (dot) git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1429259 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 2 ++ solr/webapp/web/js/scripts/analysis.js | 2 +- solr/webapp/web/js/scripts/app.js | 6 ++++-- solr/webapp/web/js/scripts/dashboard.js | 2 +- solr/webapp/web/js/scripts/dataimport.js | 4 ++-- solr/webapp/web/js/scripts/file.js | 2 +- solr/webapp/web/js/scripts/plugins.js | 4 ++-- solr/webapp/web/js/scripts/query.js | 2 +- solr/webapp/web/js/scripts/replication.js | 2 +- solr/webapp/web/js/scripts/schema-browser.js | 2 +- 10 files changed, 16 insertions(+), 12 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 0a6f891a075..152ed1fe5de 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -445,6 +445,8 @@ Bug Fixes * SOLR-4257: PeerSync updates and Log Replay updates should not wait for a ZooKeeper connection in order to proceed. (yonik) +* SOLR-4045: SOLR admin page returns HTTP 404 on core names containing + a '.' (dot) (steffkes) Other Changes ---------------------- diff --git a/solr/webapp/web/js/scripts/analysis.js b/solr/webapp/web/js/scripts/analysis.js index 2a7a71a2314..ede8ba707ea 100644 --- a/solr/webapp/web/js/scripts/analysis.js +++ b/solr/webapp/web/js/scripts/analysis.js @@ -18,7 +18,7 @@ // #/:core/analysis sammy.get ( - /^#\/([\w\d-]+)\/(analysis)$/, + new RegExp( app.core_regex_base + '\\/(analysis)$' ), function( context ) { var active_core = this.active_core; diff --git a/solr/webapp/web/js/scripts/app.js b/solr/webapp/web/js/scripts/app.js index c0835b1fb62..3df019ab30b 100644 --- a/solr/webapp/web/js/scripts/app.js +++ b/solr/webapp/web/js/scripts/app.js @@ -100,7 +100,7 @@ var sammy = $.sammy { var selector = '~' === this.params.splat[0][0] ? '#' + this.params.splat[0].replace( /^~/, '' ) + '.global' - : '#menu-selector #' + this.params.splat[0]; + : '#menu-selector #' + this.params.splat[0].replace( /\./g, '__' ); var active_element = $( selector, menu_wrapper ); @@ -152,6 +152,8 @@ var solr_admin = function( app_config ) this.timeout = null; + this.core_regex_base = '^#\\/([\\w\\d-\\.]+)'; + show_global_error = function( error ) { var main = $( '#main' ); @@ -205,7 +207,7 @@ var solr_admin = function( app_config ) classes.push( 'default' ); } - var core_tpl = '