]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't double-slash filenames at the root.
authorringmaster <epithet@gmail.com>
Tue, 8 Oct 2013 16:48:59 +0000 (12:48 -0400)
committerringmaster <epithet@gmail.com>
Tue, 8 Oct 2013 16:48:59 +0000 (12:48 -0400)
Replace either the end of the dir string that isn't preceded by a slash or the slash at the end of the dir string with a slash and the filename.
This prevents the root directory from ending up as two slashes, which breaks files_versions on Windows servers. See #4079 for an explanation.

apps/files_versions/js/versions.js

index 3f56a3eb69857f0f86b3049bbeabe5b1d7f76607..6d25aec3152e213c7fef7a52db136e0889dd48b6 100644 (file)
@@ -14,7 +14,7 @@ $(document).ready(function(){
                                // Action to perform when clicked
                                if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback
 
-                               var file = $('#dir').val()+'/'+filename;
+                               var file = $('#dir').val().replace(/(?!<=\/)$|\/$/, '/' + filename);
                                var createDropDown = true;
                                // Check if drop down is already visible for a different file
                                if (($('#dropdown').length > 0) ) {