Project

General

Profile

Defect #1173

Missing User Agent leads to error 500

Added by Björn Peemöller over 6 years ago. Updated over 6 years ago.

Status:
終了(Closed)
Priority:
通常(Normal)
Assignee:
Target version:
Start date:
01/18/2013
Due date:
% Done:

100%

Estimated time:

Description

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).

Associated revisions

Revision 3121ef39 (diff)
Added by Haru Iida over 6 years ago

fixes #1173 Missing User Agent leads to error 500.

History

#1

Updated by Haru Iida over 6 years ago

  • Project changed from r-labs to Wiki Extensions
  • Assignee set to Haru Iida
  • Target version set to 0.6.2
#2

Updated by Haru Iida over 6 years ago

  • Status changed from 新規(New) to 解決(Resolved)
  • % Done changed from 0 to 100

更新履歴 commit:61a1ecd66ba8 で適用されました。

#3

Updated by Haru Iida over 6 years ago

Thanks. I've fixed.

#4

Updated by Haru Iida over 6 years ago

  • Status changed from 解決(Resolved) to 終了(Closed)

Also available in: Atom PDF