diff --git a/client/components/breadcrumb.js b/client/components/breadcrumb.js index 1ae03577..1cffa978 100644 --- a/client/components/breadcrumb.js +++ b/client/components/breadcrumb.js @@ -132,11 +132,21 @@ export class PathElementWrapper extends React.Component { render(){ let className = "component_path-element-wrapper"; - if(this.props.highlight) { className += " highlight";} + if(this.props.highlight) { className += " highlight"; } + + let href = "/files" + (this.props.path.full || "") + href = href + .replace(/\%/g, "%2525") // Hack to get the Link Component to work + // See ExistingThing in 'thing-existing.js' + .replace(/#/g, "%23") + .replace(/\?/g, "%3F"); + href = href || "/" + href += location.search; + return (
  • - + {this.limitSize(this.props.path.label)} diff --git a/client/model/files.js b/client/model/files.js index 42f8cbef..bb45a800 100644 --- a/client/model/files.js +++ b/client/model/files.js @@ -42,7 +42,6 @@ class FileSystem{ _ls_from_http(path, show_hidden){ const url = appendShareToUrl("/api/files/ls?path="+prepare(path)); - return http_get(url).then((response) => { response = fileMiddleware(response, path, show_hidden); @@ -93,7 +92,7 @@ class FileSystem{ } this.obs.next(_err); return Promise.reject(err); - }); + }) } _ls_from_cache(path, _record_access = false){ diff --git a/client/pages/filespage.js b/client/pages/filespage.js index 41abba5c..7860a5d0 100644 --- a/client/pages/filespage.js +++ b/client/pages/filespage.js @@ -34,7 +34,7 @@ export class FilesPage extends React.Component { this.props.history.push(props.match.url + "/"); } this.state = { - path: props.match.url.replace("/files", "").replace(/%23/g, "#") || "/", + path: (decodeURIComponent(location.pathname).replace("/files", "") || "/" ), sort: settings_get("filespage_sort") || "type", sort_reverse: true, show_hidden: settings_get("filespage_show_hidden") || CONFIG["display_hidden"], @@ -96,7 +96,7 @@ export class FilesPage extends React.Component { if(/\/$/.test(path) === false){ path = path + "/"; } if(/^\//.test(path) === false){ path = "/"+ path; } return path; - }((nextProps.match.params.path || "").replace(/%23/g, "#")); + }((nextProps.match.params.path || "").replace(/%23/g, "#").replace(/%3F/g, "?").replace(/%25/g, "%")); if(new_path !== this.state.path){ this.setState({path: new_path, loading: true}); this.onRefresh(new_path); diff --git a/client/pages/filespage/thing-existing.js b/client/pages/filespage/thing-existing.js index 9d8b2455..e2dc4155 100644 --- a/client/pages/filespage/thing-existing.js +++ b/client/pages/filespage/thing-existing.js @@ -240,7 +240,11 @@ export class ExistingThing extends React.Component { } className = className.trim(); - let fileLink = this.props.file.link.replace(/%2F/g, '/'); + let fileLink = this.props.file.link + .replace(/%2F/g, "/") + .replace(/\%/g, "%2525") // Hack to get the Link Component to work + .replace(/\?/g, "%3F") + .replace(/\#/g, "%23"); return connectDragSource(connectDropNativeFile(connectDropFile(