操作
Defect #1173
完了Missing User Agent leads to error 500
説明
I had an request to an issue page from a user which did not transfer his HTTP_USER_AGENT
.
In consequence, the wiki-extensions
plugin lead to an error 500 because of the following error:
ERROR MESSAGE: NoMethodError: undefined method `match' for nil:NilClass WHERE: issues#show [PROJECT_ROOT]/plugins/redmine_wiki_extensions/lib/wiki_extensions_helper_patch.rb:63 [PROJECT_ROOT]/plugins/redmine_wiki_extensions/lib/wiki_extensions_helper_patch.rb:36 [PROJECT_ROOT]/lib/redmine/wiki_formatting/textile/helper.rb:23 [PROJECT_ROOT]/app/views/issues/_edit.html.erb:31 ...
Looking at wiki_extensions_helper_patch.rb:61- 64
, I see:
def ie6_or_ie7? useragent = request.env['HTTP_USER_AGENT'] return useragent.match(/IE[ ]+[67]./) != nil end
So it might be useful to change line 62 to
useragent = request.env['HTTP_USER_AGENT'].to_s
or something similar (I'm no Ruby expert).
操作