Commit Graph

255 Commits

Author SHA1 Message Date
Kuldeep Aggarwal
ed62584391 provide correct information [ci skip] 2014-01-02 19:28:28 +05:30
Vipul A M
98cb3e69af update copyright notices to 2014. [ci skip] 2014-01-01 23:59:49 +05:30
Akira Matsuda
f57e5f224b Unused class in AV test 2013-12-25 10:33:42 +09:00
Akira Matsuda
222f00b422 Unused classes in AV tests 2013-12-24 11:04:49 +09:00
Robin Dupret
2bc88d4f74 Add a changelog entry for #13363 [ci skip] 2013-12-21 14:03:14 +01:00
Vijay Dev
a3b1105ada Merge branch 'master' of github.com:lifo/docrails 2013-12-20 00:10:30 +05:30
Carlos Antonio da Silva
c5b76b5362 Prefer assert_raise instead of flunk + rescue to test for exceptions
Change most tests to make use of assert_raise returning the raised
exception rather than relying on a combination of flunk + rescue to
check for exception types/messages.
2013-12-19 09:20:51 -02:00
abhishek
21f0c580f3 duplication removed(DRY) 2013-12-18 16:17:11 +05:30
Guillermo Iguaran
76f8d31046 Merge pull request #13363 from kuldeepaggarwal/f-video-options
allow video_tag to accept `size` as `Number` for square shaped videos
2013-12-17 23:42:05 -08:00
Kuldeep Aggarwal
cd58745a7d allow video_tag to accept size as Number for square shaped videos 2013-12-18 12:24:08 +05:30
David Heinemeier Hansson
c0a2d474c5 Get ready to release 4.1.0.beta1 2013-12-17 16:05:28 -08:00
Jeremy Kemper
cf56dcf930 Fix integration test to pass same-origin verification 2013-12-17 15:04:59 -07:00
Carlos Antonio da Silva
6802196a6b Disable available locales checks to avoid warnings running the tests 2013-12-17 09:05:41 -02:00
Rafael Mendonça França
b34352e425 Merge pull request #13255 from strzalek/bump-builder
Bump up builder
2013-12-12 12:22:21 -08:00
Łukasz Strzałkowski
9f506c494b More liberal builder dependency
Allowing us to get 3.2.x versions if needed.
2013-12-12 20:03:02 +01:00
Godfrey Chan
ebfd97124d Merge pull request #13284 from aayushkhandelwal11/typos_corrected
s/everytime/every time/
2013-12-11 22:13:04 -08:00
Aayush khandelwal
4a9e54ef35 typos rectified [ci skip] 2013-12-12 11:29:23 +05:30
Waynn Lue
93de7ff856 test description uses "disable" when it should be "disabled" 2013-12-11 15:08:53 -08:00
Waynn Lue
b6251d626e value is "disabled" not "disable" 2013-12-11 14:30:41 -08:00
Semyon Perepelitsa
1cd965000b Fix typo in docs, missing colon in Symbol literal [ci skip] 2013-12-11 03:03:49 +08:00
Rafael Mendonça França
a220b1518d Merge pull request #13059 from imkmf/cycle-accepts-array
Cycle object should accept an array

Conflicts:
	actionview/CHANGELOG.md
2013-12-06 17:05:59 -02:00
Kristian Freeman
1eaa521273 A Cycle object should accept an array and cycle through it as it would
with a set of comma-separated objects.
2013-12-06 10:57:37 -08:00
Andriel Nuernberg
ec19c77ca5 Label only accepts :index and :namespace attributes from the input 2013-12-05 20:27:38 -02:00
Rafael Mendonça França
fe13e71162 Remove the explicit order set for the initializer
This will fix the regression added on
b068e20b35797aa6deaa377a48c990759734f515.

See tests added at ff08d31 to a better understanding about the problem
2013-12-05 16:37:10 -02:00
Jeremy Kemper
5086c8c211 Merge pull request #13189 from strzalek/retain-ap-av-dep
Retain ActionPack dependency on ActionView. Fixes #12979.
2013-12-05 07:25:17 -08:00
Shota Fukumori (sora_h)
c1d5477b63 Escalate missing error when :raise is true
Before ec16ba75a5493b9da972eea08bae630eba35b62f,
ActionView::Helpers::TranslationHelper#translate has raised errors with
specifying options[:raise] to true.

This should work by this fix:

     begin
       t(:"translations.missing", raise: true)
     rescue I18n::MissingTranslationData
       p :hello!
     end
2013-12-05 09:20:58 +09:00
Łukasz Strzałkowski
e064658d64 Include AV::Layouts directly in AM::Base
No need to do this in railtie as AM depends on AV either way
2013-12-05 01:03:03 +01:00
Łukasz Strzałkowski
d8888b94b3 Retain ActionPack dependency on ActionView 2013-12-05 01:02:46 +01:00
Godfrey Chan
2c564cdbdb Added \u2028 \u2029 to json_escape 2013-12-04 09:43:42 -08:00
Godfrey Chan
c229c7a39c Use lower case letters in unicodes sequences to match the new encoder's output 2013-12-04 09:27:55 -08:00
Godfrey Chan
2f1c5789c1 Fixed a long-standing bug in json_escape that strips quotation marks 2013-12-04 09:27:54 -08:00
Godfrey Chan
039f9b37b9 Added failing test for json_escape striping quotation marks
Expanded test coverage for html_escape and json_escape
2013-12-04 09:26:14 -08:00
Mario Visic
a156562762 Fix issue where TextHelper#simple_format was calling missing 'raw' method 2013-12-05 00:21:55 +11:00
Rafael Mendonça França
d261c5cc28 Fix documentation of number_to_currency helper
Now users have to explicit mark the unit as safe if they trust it.

Closes #13161

Conflicts:
	actionpack/lib/action_view/helpers/number_helper.rb
	actionpack/test/template/number_helper_i18n_test.rb
2013-12-04 10:27:14 -02:00
Łukasz Strzałkowski
2d3a6a0cb8 Action Pack Variants
By default, variants in the templates will be picked up if a variant is set
and there's a match. The format will be:

  app/views/projects/show.html.erb
  app/views/projects/show.html+tablet.erb
  app/views/projects/show.html+phone.erb

If request.variant = :tablet is set, we'll automatically be rendering the
html+tablet template.

In the controller, we can also tailer to the variants with this syntax:

  class ProjectsController < ActionController::Base
    def show
      respond_to do |format|
        format.html do |html|
          @stars = @project.stars

          html.tablet { @notifications = @project.notifications }
          html.phone  { @chat_heads    = @project.chat_heads }
        end

        format.js
        format.atom
      end
    end
  end

The variant itself is nil by default, but can be set in before filters, like
so:

  class ApplicationController < ActionController::Base
    before_action do
      if request.user_agent =~ /iPad/
        request.variant = :tablet
      end
    end
  end

This is modeled loosely on custom mime types, but it's specifically not
intended to be used together. If you're going to make a custom mime type,
you don't need a variant. Variants are for variations on a single mime
types.
2013-12-04 00:13:16 +01:00
Aaron Patterson
4d648819c5 optimize string literals in erb templates 2013-12-03 14:56:14 -08:00
Rafael Mendonça França
da633f81eb Remove the escaping skip
We are generating safe strings in the paragraph, so we can escape the
tags
2013-12-03 17:26:49 -02:00
Lauro Caetano
b1b9a0aeca Typos. return -> returns. [ci skip] 2013-12-03 13:31:36 -02:00
Michael Koziarski
0c7ac34aed Stop using i18n's built in HTML error handling.
i18n doesn't depend on active support which means it can't use our html_safe
code to do its escaping when generating the spans.  Rather than try to sanitize
the output from i18n, just revert to our old behaviour of rescuing the error
and constructing the tag ourselves.

Fixes: CVE-2013-4491
2013-12-02 16:42:16 -08:00
Michael Koziarski
bea9c9b4c0 Ensure simple_format escapes its html attributes
The previous behavior equated the sanitize option for simple_format with the
escape option of content_tag, however these are two distinct concepts.

This fixes CVE-2013-6416

Conflicts:
	actionview/lib/action_view/helpers/text_helper.rb
2013-12-02 16:42:07 -08:00
Michael Koziarski
b31a7a6f1e Escape the unit value provided to number_to_currency
Previously the unit values were trusted leading to potential XSS vulnerabilities.

Fixes: CVE-2013-6415
2013-12-02 16:41:14 -08:00
Aaron Patterson
2e3c3a87d8 Only use valid mime type symbols as cache keys
CVE-2013-6414
2013-12-02 16:41:09 -08:00
Guillermo Iguaran
b40faf423c Merge pull request #13138 from gsamokovarov/remove-cattr-requires
Remove deprecated cattr_* requires
2013-12-02 14:30:39 -08:00
Genadi Samokovarov
6329d9fa8b Remove deprecated cattr_* requires 2013-12-03 00:28:15 +02:00
Rafael Mendonça França
83e4f33ea1 Make ActionView::Tags loading tread safe 2013-12-02 20:27:50 -02:00
Guillermo Iguaran
152edcc16b activemodel isn't a runtime dependency for actionview 2013-12-02 15:41:16 -05:00
Xavier Noria
d362ee17db Merge pull request #13117 from akshay-vishnoi/typo
Typo and grammatical fixes [ci skip]
2013-12-02 06:17:09 -08:00
Akshay Vishnoi
ef0f633c66 Typo and grammatical fixes [ci skip] 2013-12-02 19:35:02 +05:30
Yves Senn
543ccf740d ActionView::MissingTemplate for partials includes underscore.
Missing partial folder/_partial instead of folder/partial.

Closes #13002.
2013-12-02 08:35:34 +01:00
Kuldeep Aggarwal
fff0309081 unnecessary checking of size with second regex if matched with first one 2013-11-27 15:51:47 +05:30