Compare commits

...

10 Commits

Author SHA1 Message Date
Arthur Neves
4f33cd1eae Bump to version 2.6.2 2015-01-23 10:18:03 -05:00
Florian Weingarten
1854cd17ab Bump version to 2.6.1 2015-01-23 10:17:18 -05:00
Arthur Nogueira Neves
69c2575485 Merge pull request #503 from parkr/patch-1
Remove duplicate `index0` key in htmltags
2014-12-30 13:15:04 -05:00
Parker Moore
0e98b29665 Remove duplicate index0 key in htmltags
Half of #502.
2014-12-26 16:33:47 -05:00
Florian Weingarten
deeb813d53 Merge pull request #300 from Shopify/cherry_pick_security_fix_to_2-6-stable
Cherry pick security fix to 2-6-stable
2014-01-10 10:20:41 -08:00
Florian Weingarten
eb409ff237 Cherry pick security fix (#274) to 2-6-stable 2014-01-10 11:22:28 -05:00
Arthur Neves
442041206f Update history log 2013-11-25 10:25:39 -05:00
Arthur Neves
dc6c6fbb9a Bump version to 2.6.0 2013-11-25 10:24:30 -05:00
Florian Weingarten
4293be3154 Update history 2013-11-11 09:02:32 -05:00
Arthur Nogueira Neves
736c11c876 Merge pull request #268 from Shopify/better_rake
Improve Rakefile
Conflicts:
	Rakefile
2013-10-10 10:59:26 -04:00
6 changed files with 37 additions and 17 deletions

View File

@@ -3,7 +3,13 @@
IMPORTANT: Liquid 2.6 is going to be the last version of Liquid which maintains explicit Ruby 1.8 compatability.
The following releases will only be tested against Ruby 1.9 and Ruby 2.0 and are likely to break on Ruby 1.8.
## 2.6.0 (not yet released)
## 2.6.1 / 2014-01-10 / branch "2-6-stable"
Security fix, cherry-picked from master (4e14a65):
* Don't call to_sym when creating conditions for security reasons, see #273 [Bouke van der Bijl, bouk]
* Prevent arbitrary method invocation on condition objects, see #274 [Dylan Thacker-Smith, dylanahsmith]
## 2.6.0 / 2013-11-25
* ...
* Bugfix for #106: fix example servlet [gnowoel]
@@ -14,6 +20,7 @@ The following releases will only be tested against Ruby 1.9 and Ruby 2.0 and are
* Bugfix for #204: 'raw' parsing bug [Florian Weingarten, fw42]
* Bugfix for #150: 'for' parsing bug [Peter Schröder, phoet]
* Bugfix for #126: Strip CRLF in strip_newline [Peter Schröder, phoet]
* Bugfix for #174, "can't convert Fixnum into String" for "replace" [wǒ_is神仙, jsw0528]
* Allow a Liquid::Drop to be passed into Template#render [Daniel Huckstep, darkhelmet]
* Resource limits [Florian Weingarten, fw42]
* Add reverse filter [Jay Strybis, unreal]
@@ -24,7 +31,11 @@ The following releases will only be tested against Ruby 1.9 and Ruby 2.0 and are
* Better documentation for 'include' tag (closes #163) [Peter Schröder, phoet]
* Use of BigDecimal on filters to have better precision (closes #155) [Arthur Nogueira Neves, arthurnn]
## 2.5.3 / branch "2.5-stable"
## 2.5.4 / 2013-11-11 / branch "2.5-stable"
* Fix "can't convert Fixnum into String" for "replace", see #173, [wǒ_is神仙, jsw0528]
## 2.5.3 / 2013-10-09
* #232, #234, #237: Fix map filter bugs [Florian Weingarten, fw42]

View File

@@ -1,9 +1,7 @@
#!/usr/bin/env ruby
require 'rubygems'
require 'rake'
require 'rake/testtask'
require 'rubygems/package_task'
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require "liquid/version"
task :default => 'test'
@@ -13,14 +11,20 @@ Rake::TestTask.new(:test) do |t|
t.verbose = false
end
gemspec = eval(File.read('liquid.gemspec'))
Gem::PackageTask.new(gemspec) do |pkg|
pkg.gem_spec = gemspec
task :gem => :build
task :build do
system "gem build liquid.gemspec"
end
desc "Build the gem and release it to rubygems.org"
task :release => :gem do
sh "gem push pkg/liquid-#{gemspec.version}.gem"
task :install => :build do
system "gem install liquid-#{Liquid::VERSION}.gem"
end
task :release => :build do
system "git tag -a v#{Liquid::VERSION} -m 'Tagging #{Liquid::VERSION}'"
system "git push --tags"
system "gem push liquid-#{Liquid::VERSION}.gem"
system "rm liquid-#{Liquid::VERSION}.gem"
end
namespace :benchmark do

View File

@@ -43,7 +43,6 @@ module Liquid
'index0' => index,
'col' => col + 1,
'col0' => col,
'index0' => index,
'rindex' => length - index,
'rindex0' => length - index - 1,
'first' => (index == 0),

View File

@@ -15,6 +15,7 @@ module Liquid
SyntaxHelp = "Syntax Error in tag 'if' - Valid syntax: if [expression]"
Syntax = /(#{QuotedFragment})\s*([=!<>a-z_]+)?\s*(#{QuotedFragment})?/o
ExpressionsAndOperators = /(?:\b(?:\s?and\s?|\s?or\s?)\b|(?:\s*(?!\b(?:\s?and\s?|\s?or\s?)\b)(?:#{QuotedFragment}|\S+)\s*)+)/o
BOOLEAN_OPERATORS = %w(and or)
def initialize(tag_name, markup, tokens)
@blocks = []
@@ -61,7 +62,8 @@ module Liquid
raise(SyntaxError, SyntaxHelp) unless expressions.shift.to_s =~ Syntax
new_condition = Condition.new($1, $2, $3)
new_condition.send(operator.to_sym, condition)
raise SyntaxError, "invalid boolean operator" unless BOOLEAN_OPERATORS.include?(operator)
new_condition.send(operator, condition)
condition = new_condition
end
@@ -71,8 +73,6 @@ module Liquid
@blocks.push(block)
@nodelist = block.attach(Array.new)
end
end
Template.register_tag('if', If)

View File

@@ -1,4 +1,4 @@
# encoding: utf-8
module Liquid
VERSION = "2.6.0.rc1"
VERSION = "2.6.2"
end

View File

@@ -157,4 +157,10 @@ class IfElseTagTest < Test::Unit::TestCase
assert_template_result('yes',
%({% if 'gnomeslab-and-or-liquid' contains 'gnomeslab-and-or-liquid' %}yes{% endif %}))
end
def test_operators_are_whitelisted
assert_raise(SyntaxError) do
assert_template_result('', %({% if 1 or throw or or 1 %}yes{% endif %}))
end
end
end # IfElseTest