Skip to content
Browse files

[#849] Fixed html escaping for #{select .../} and other tags

  • Loading branch information...
1 parent 7433c73 commit b02a1305f89ff082729d243140d1ecbe1ab37bd1 @tsuijten committed May 23, 2011
View
2 framework/templates/tags/select.tag
@@ -21,7 +21,7 @@
serializedAttrs = play.templates.FastTags.serialize(_attrs, "size", "name", "items", "labelProperty", "value", "valueProperty")
}%
-<select name="${_name}" size="${_size?:1}" ${serializedAttrs}>
+<select name="${_name}" size="${_size?:1}" ${serializedAttrs.raw()}>
#{doBody /}
#{list items:_items, as:'i'}
#{option _valueProperty && i.hasProperty(_valueProperty) ? i[_valueProperty] : i}${_labelProperty && i.hasProperty(_labelProperty) ? i[_labelProperty] : i}#{/option}
View
6 samples-and-tests/just-test-cases/app/controllers/Application.java
@@ -263,12 +263,18 @@ public static void googleSearch(String word) throws InterruptedException, Execut
public static void selectTag(){
List<User> users = new ArrayList<User>(10);
User user;
+
+ // Check html escaping
+ user = new User("<All>");
+ users.add(user);
+
for(long i = 0; i < 10; i++) {
user = new User("User-" + i);
user.k = i;
user.i = (int) i;
users.add(user);
}
+
render(users);
}
}
View
1 samples-and-tests/just-test-cases/test/selectTag.test.html
@@ -9,6 +9,7 @@
assertElementPresent('css=#select2 option')
assertText('css=#select2 option[value="User-9"]', 'User-9')
assertElementPresent('css=#select2 option[value="User-5"][selected]')
+ assertText('css=#select2 option[value="&lt;All&gt;"]', '&lt;All&gt;')
#{/selenium}
#{selenium 'Check #select tag with plain content'}
open('@{Application.selectTag()}')

0 comments on commit b02a130

Please sign in to comment.
Something went wrong with that request. Please try again.