Applied patch from Redmine feature #7249

https://dev.metasploit.com/redmine/issues/7249