remove unnecessary #dup
Merge pull request #8694 from goshakkk/undup

Remove unnecessary #dup
remove another unnecessary dup
do not mutate the options hash (when we do not need to)
ask the form builder for form tag attributes
take into account multipart when calculating tag attributes
do not append a second slash when using
Fix a number of validation/style errors:

 * <pre> is not allowed to be nested inside of <p> elements in HTML
 * Indentation of </p> doesn't match corresponding <p>
 * <p> element not explicitly closed
 * One more </div> than <div>

In each case, the template was fixed to match how a HTML5 parser would "see"
the resulting page.
Merge pull request #8702 from rubys/master

Fix a number of validation/style errors
Fixing closing </p>
Merge pull request #8701 from senny/8700_double_slash_with_trailing_slash

do not append a second slash when using `trailing_slash: true`
CVE-2012-5664 options hashes should only be extracted if there are extra parameters

Conflicts:
	activerecord/lib/active_record/dynamic_matchers.rb
Merge pull request #8697 from goshakkk/undup

Remove another unnecessary dup
Restore original remote_ip algorithm.

Proxy servers add X-Forwarded-For headers, resulting in a list of IPs. We
remove trusted IP values, and then take the last given value, assuming that
it is the most likely to be the correct, unfaked value. See [1] for a very
thorough discussion of why that is the best option we have at the moment.

[1]: http://blog.gingerlime.com/2012/rails-ip-spoofing-vulnerabilities-and-protection/

Fixes #7979