Skip to content

Commit

Permalink
Fix tainewoo#1 ArgumentError: invalid %-encoding
Browse files Browse the repository at this point in the history
Fix name for file name in cache
  • Loading branch information
miramir authored Aug 28, 2019
1 parent 1790930 commit 67d4e5e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ldap_sync/core_ext/file_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@
# You should have received a copy of the GNU General Public License
# along with Redmine LDAP Sync. If not, see <http://www.gnu.org/licenses/>.
class ActiveSupport::Cache::FileStore
def file_path_key(path)
fname = path[cache_path.to_s.size..-1].split(File::SEPARATOR, 4).last.gsub(File::SEPARATOR, '')
URI.decode_www_form_component(fname, Encoding::UTF_8)
end
def delete_unless
options = merged_options(options)
search_dir(cache_path) do |path|
key = file_path_key(path)
delete_entry(key, options) unless yield(key)
end
end
end
end

0 comments on commit 67d4e5e

Please sign in to comment.