Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#44973] File picker: Directories with spaces don't load correctly

Andreas Pfohl3f10a9654272
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_query.rb
index 5e00df01721..a410b4c4147 100644
--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_query.rb
+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_query.rb
@@ -36,13 +36,13 @@ module Storages::Peripherals::StorageInteraction::Nextcloud
@base_path = "/remote.php/dav/files/#{token.origin_user_id}"
end
- def query(data)
+ def query(parent)
http = Net::HTTP.new(@uri.host, @uri.port)
http.use_ssl = @uri.scheme == 'https'
result = @with_refreshed_token.call(@token) do |token|
response = http.propfind(
- "#{@base_path}#{data}",
+ "#{@base_path}#{requested_folder(parent)}",
requested_properties,
{
'Depth' => '1',
@@ -58,6 +58,12 @@ module Storages::Peripherals::StorageInteraction::Nextcloud
private
+ def requested_folder(folder)
+ return '' if folder.nil?
+
+ folder.gsub(' ', '%20')
+ end
+
def requested_properties
Nokogiri::XML::Builder.new do |xml|
xml['d'].propfind(