Fixed: Can't use non-latin anchor in wiki (#11577).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10206 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2012-08-13 19:36:00 +00:00
1 parent d79bcc4369
commit 3673fbd881
2 files changed
+10 -1

No files matched your search

+6 -1
View File
@@ -1157,7 +1157,12 @@ module ApplicationHelper
end
def sanitize_anchor_name(anchor)
anchor.gsub(%r{[^\w\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
if ''.respond_to?(:encoding)
anchor.gsub(%r{[^\p{Word}\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
else
# TODO: remove when ruby1.8 is no longer supported
anchor.gsub(%r{[^\w\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
end
end
# Returns the javascript tags that are included in the html layout head