Do not check defined?(CGI) on every call #to_query
Merge pull request #15091 from printercu/patch-5

Do not check defined?(CGI) on every call #to_query