aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/string_ext_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* html_escape should escape single quotesSantiago Pastorino2012-07-311-2/+2
| | | | | https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content Closes #7215
* Truncate now has the ability to receive a html option that allows it to call ↵Li Ellis Gallardo2012-05-261-0/+4
| | | | | | | | | | | | rails helpers. This way if my text is long I don't have to do something like this: .text = truncate(@text, :length => 27) if @text.size >= 27 = link_to "continue", notes_path, ....."")
* Fix warning: possibly useless use of % in void contextkennyj2012-05-191-1/+1
|
* doesn't modify params in SafeBuffer#%Vasiliy Ermolovich2012-05-181-0/+7
|
* fix safe string interpolation with SafeBuffer#%, closes #6352Vasiliy Ermolovich2012-05-161-0/+24
|
* Tests for regexp separator in String#truncateAlexey Gaziev2012-04-291-0/+6
| | | | https://github.com/rails/rails/commit/5a7513593f64e0ff7e4de1ee37bac5eeddfae270
* use AS::TestCase as the base classAaron Patterson2012-01-051-2/+2
|
* deprecate String#encoding_aware? and remove its usageSergey Nartimov2011-12-241-1/+3
|
* Initial pass at removing dead 1.8.x code from Active Support.José Valim2011-12-201-44/+6
| | | | | | There are a bunch of other implicit branches that adds 1.8.x specific code that still needs to be removed. Pull requests for those cases are welcome.
* Restore performance of ERB::Util.html_escapeJon Jensen2011-12-031-6/+17
| | | | | | | Revert html_escape to do a single gsub again, but add the "n" flag (no language, i.e. not multi-byte) to protect against XSS via invalid utf8 Signed-off-by: José Valim <jose.valim@gmail.com>
* defines Module#qualified_const_(defined?|get|set) and String#deconstantizeXavier Noria2011-10-291-0/+4
| | | | | | | | | | This commit also implements a faster version of #demodulize I was unable to isolate with git add --patch. Not a big fan of the name #deconstantize. It complements #demodulize getting rid of the rightmost constant, hence the name, but it is unrelated to the well-known #constantize. So unsure. Could not come with anything better, please feel free to rename.
* Modified String#pluralize to take an optional count parameter.Ryan Oblak2011-09-281-4/+8
|
* Added ActiveSupport::Inflector.safe_constantize and String#safe_constantize; ↵Ryan Oblak2011-09-231-1/+22
| | | | refactored common constantize tests into ConstantizeTestCases
* properly escape html to avoid invalid utf8 causing XSS attacksAaron Patterson2011-08-161-0/+7
|
* Removing extra requires from the test. Already loaded in abstract_unit.Arun Agrawal2011-07-311-1/+0
|
* Changed the year of a date used in a test which fails when using 1.8.7 on a ↵Josh Kalderimis2011-07-191-1/+1
| | | | 32bit machine (ArgumentError: time out of range)
* Merge pull request #1463 from psanford/masterSantiago Pastorino2011-07-061-0/+1
|\ | | | | Fix timezone handling in String.to_time
| * Make String.to_time respect timezonesNate Mueller2011-06-021-0/+1
| |
* | all numerics should be html_safe - Closes #1935Damien Mathieu2011-07-031-0/+4
| |
* | Define ActiveSupport#to_param as to_str - closes #1663Andrew White2011-06-121-1/+7
|/
* Revert "Merge pull request #275 from pk-amooma/master"José Valim2011-05-071-12/+0
| | | | | | | Several AP tests fail after this change. This reverts commit aaf01cd53718c8aa5b69ac056b997e6dd9893777, reversing changes made to 9cc18c52faeebaad6a76bd62cdca1c6b9f96afed.
* Merge pull request #275 from pk-amooma/masterJosé Valim2011-05-071-0/+12
|\ | | | | properly escape "'" to "'" for XML
| * test "Escapes special HTML/XML characters" do ...Philipp Kempgen2011-04-261-0/+12
| |
* | Merge remote branch 'rolftimmermans/desc_tracker'José Valim2011-05-071-0/+1
|\ \
| * | Add missing dependency string inflection test.Rolf Timmermans2011-03-131-0/+1
| |/
* / Add String#inquiry as a convenience method for turning a string into a ↵David Heinemeier Hansson2011-04-181-0/+5
|/ | | | StringInquirer object [DHH]
* removes orphan tests, custom String#% was removed from AS in 39d6f9eXavier Noria2010-11-191-69/+0
|
* let String#strip_heredoc handle blank lines even if they are not indentedXavier Noria2010-08-301-0/+9
|
* implements String#strip_heredocXavier Noria2010-08-291-0/+23
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* Added getbyte as a core_ext to Ruby < 1.9Santiago Pastorino2010-06-271-0/+8
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Extracted String#truncate from TextHelper#truncate [DHH]David Heinemeier Hansson2010-06-011-0/+29
|
* Use multibyte proxy class on 1.9, refactor Unicode.Norman Clarke2010-05-211-5/+3
| | | | | | | | | | Makes String#mb_chars on Ruby 1.9 return an instance of ActiveSupport::Multibyte::Chars to work around 1.9's lack of Unicode case folding. Refactors class methods from ActiveSupport::Multibyte::Chars into new Unicode module, adding other related functionality for consistency. [#4594 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Final iteration of use better testing methodsNeeraj Singh2010-05-191-7/+7
| | | | | | [#4652 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Revert "Moved encoding work in progress to a feature branch."wycats2010-05-171-0/+8
| | | | This reverts commit ade756fe42423033bae8e5aea8f58782f7a6c517.
* Moved encoding work in progress to a feature branch.Jeremy Kemper2010-05-161-8/+0
| | | | This reverts commits af0d1a88157942c6e6398dbf73891cff1e152405 and 64d109e3539ad600f58536d3ecabd2f87b67fd1c.
* Initial work to improve the state of encodings for templateswycats2010-05-161-0/+8
|
* updates String#to_(date|date_time|time) to return nil for blank stringsDaniel Neighman2010-04-211-3/+6
|
* removes code written for Ruby < 1.8.7Xavier Noria2010-04-171-12/+0
|
* Fix some more warnings on 1.9wycats2010-03-171-1/+1
|
* Be sure to pass through args to to_yamlJeremy Kemper2010-03-111-1/+1
|
* OutputBuffer#to_yaml should return string yaml, not some custom class dumpJeremy Kemper2010-03-111-0/+4
|
* Fixed html_safe test cases which weren't testing correctlySantiago Pastorino and José Ignacio Costa2010-02-051-17/+20
| | | | | | [#3845 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* For performance reasons, you can no longer call html_safe! on Strings. ↵Yehuda Katz2010-01-311-33/+34
| | | | | | | | | | | | Instead, all Strings are always not html_safe?. Instead, you can get a SafeBuffer from a String by calling #html_safe, which will SafeBuffer.new(self). * Additionally, instead of doing concat("</form>".html_safe), you can do safe_concat("</form>"), which will skip both the flag set, and the flag check. * For the first pass, I converted virtually all #html_safe!s to #html_safe, and the tests pass. A further optimization would be to try to use #safe_concat as much as possible, reducing the performance impact if we know up front that a String is safe.
* String#exclude? core extension: inverse of #include?Jeremy Kemper2009-12-271-0/+7
|
* String#<< should work for any object which responds to :to_str, so enable ↵José Valim2009-12-261-0/+24
| | | | this without the performance hit and make Fixnum safe by default.
* Consolidate date & time landscape: require 'active_support/time'Jeremy Kemper2009-11-141-1/+1
|
* Fix missing dependencyJeremy Kemper2009-11-091-0/+1
|
* String#each_char is not needed for Ruby >= 1.8.7Xavier Noria2009-11-091-11/+0
|
* String#start_with? and String#end_with? are not needed for Ruby >= 1.8.7, ↵Xavier Noria2009-11-091-8/+0
| | | | leaves their plural aliases though