diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-12-21 20:15:15 +0100 |
---|---|---|
committer | Backportbot <backportbot-noreply@rullzer.com> | 2018-12-24 13:22:06 +0000 |
commit | e2465c67930894b37fe0d1735a17e3d474eb0bf7 (patch) | |
tree | 580e8c2cc2b3e2c077f89d27c087174b94a501d1 /apps | |
parent | 0f3a0420f7d240f80df547e214eacfb5144bfeec (diff) | |
download | nextcloud-server-e2465c67930894b37fe0d1735a17e3d474eb0bf7.tar.gz nextcloud-server-e2465c67930894b37fe0d1735a17e3d474eb0bf7.zip |
Fix opening search results for comments
"OC.dirname" removes everything after the last "/", so a path without
slashes is returned without changes. "result.path" does not include
leading nor trailing "/", so when the path is for a file or folder in
the base folder "OC.dirname(result.path)" returns "result.path".
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/comments/js/search.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/comments/js/search.js b/apps/comments/js/search.js index 11a96594580..8e0a35ff6ed 100644 --- a/apps/comments/js/search.js +++ b/apps/comments/js/search.js @@ -92,7 +92,9 @@ .css('background-image', 'url(' + OC.imagePath('core', 'actions/comment') + ')') .css('opacity', '.4'); var dir = OC.dirname(result.path); - if (dir === '') { + // "result.path" does not include a leading "/", so "OC.dirname" + // returns the path itself for files or folders in the root. + if (dir === result.path) { dir = '/'; } $row.find('td.info a').attr('href', |