diff -crB amartel-redmine_webdav-a52fc7d/lib/acts_as_webdav.rb redmine_webdav/lib/acts_as_webdav.rb *** amartel-redmine_webdav-a52fc7d/lib/acts_as_webdav.rb 2010-08-23 16:06:51.000000000 +0200 --- redmine_webdav/lib/acts_as_webdav.rb 2010-08-24 12:41:30.543055835 +0200 *************** *** 346,351 **** --- 346,361 ---- def move_to_path(resource, dest_path, depth) raise ForbiddenError unless resource_model + http_user_agent=request.env["HTTP_USER_AGENT"].to_s + http_request_method=request.env['REQUEST_METHOD'].to_s + case http_user_agent + when /Microsoft Data Access/ + if (http_request_method == "MOVE") then + elements_number=URI.unescape(dest_path).split('/').length + dest_path=Iconv.iconv('UTF-8', 'latin1', URI.unescape(dest_path)).join + logger.debug("DEST_PATH CONVERTED: " + dest_path.inspect ) + end + end resource.move_to_path(dest_path, depth) end *************** *** 356,361 **** --- 366,381 ---- def copy_to_path(resource, dest_path, depth) raise ForbiddenError unless resource_model + http_user_agent=request.env["HTTP_USER_AGENT"].to_s + http_request_method=request.env['REQUEST_METHOD'].to_s + case http_user_agent + when /Microsoft Data Access/ + if (http_request_method == "COPY") then + elements_number=URI.unescape(dest_path).split('/').length + dest_path=Iconv.iconv('UTF-8', 'latin1', URI.unescape(dest_path)).join + logger.debug("DEST_PATH CONVERTED: " + dest_path.inspect ) + end + end resource.copy_to_path(dest_path, depth) end *************** *** 382,393 **** def set_path_info raise ForbiddenError if params[:path_info].nil? ! logger.debug "params[:path_info] = #{params[:path_info].inspect}" path = params[:path_info].join('/') ! @path_info = case request.env["HTTP_USER_AGENT"] ! # when /Microsoft|Windows/ ! # logger.info("CONVERTED: " + Iconv.iconv('UTF-8', 'latin1', URI.unescape(path)).first) ! # Iconv.iconv('UTF-8', 'latin1', URI.unescape(path)).first when /cadaver/ URI.unescape(URI.unescape(path)) else --- 402,433 ---- def set_path_info raise ForbiddenError if params[:path_info].nil? ! logger.debug "DEBUG: params[:path_info] = #{params[:path_info].inspect}" path = params[:path_info].join('/') ! logger.debug ("DEBUG: HTTP_USER_AGENT: " + request.env["HTTP_USER_AGENT"].inspect ) ! logger.debug ("DEBUG: HTTP_REQUEST_METHOD: " + request.env['REQUEST_METHOD'].inspect ) ! logger.debug "DEBUG: Path: " + path.inspect ! http_user_agent=request.env["HTTP_USER_AGENT"].to_s ! http_request_method=request.env['REQUEST_METHOD'].to_s ! @path_info = case http_user_agent ! when /Microsoft Data Access/ ! elements_number=URI.unescape(path).split('/').length ! logger.debug("DEBUG: elements number: " + elements_number.to_s ) ! if (elements_number == 3) then ! if (http_request_method != "PROPFIND") then ! path=Iconv.iconv('UTF-8', 'latin1', URI.unescape(path)).join ! logger.debug("CONVERTED: " + path.inspect ) ! end ! ! else ! path=Iconv.iconv('UTF-8', 'latin1', URI.unescape(path)).join ! logger.info("CONVERTED: " + path.inspect ) ! end ! URI.unescape(path) ! when /\.NET CLR 3.5/ ! path=Iconv.iconv('UTF-8', 'latin1', URI.unescape(path)).join ! logger.info("CONVERTED: " + path.inspect ) ! URI.unescape(path) when /cadaver/ URI.unescape(URI.unescape(path)) else