Skip to content

Commit 95e9ae0

Browse files
authored
Merge branch 'develop' into feature/load-module-tests
2 parents 1156a27 + 2012aa2 commit 95e9ae0

File tree

7 files changed

+431
-12
lines changed

7 files changed

+431
-12
lines changed

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
language: go
22

33
go:
4-
- 1.4
5-
- 1.5
6-
- 1.6
74
- 1.7
85
- 1.8
96
- tip

CHANGELOG.md

Lines changed: 403 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
A high productivity, full-stack web framework for the [Go language](http://www.golang.org).
66

7-
Current Version: 0.14.0 (2017-03-24)
7+
Current Version: 0.16.0-dev (2017-05-11)
88

9-
**As of Revel 0.13.0, Go 1.4+ is required.**
9+
**As of Revel 0.15.0, Go 1.7+ is required.**
1010

1111
## Quick Start
1212

@@ -26,7 +26,6 @@ Open http://localhost:9000 in your browser and you should see "It works!"
2626

2727
* [Gitter](https://gitter.im/revel/community)
2828
* [StackOverflow](http://stackoverflow.com/questions/tagged/revel)
29-
* [Google Groups](https://groups.google.com/forum/#!forum/revel-framework)
3029

3130
## Learn More
3231

@@ -50,7 +49,7 @@ Finally, we'd like to thank the professional organizations that have supported t
5049

5150
## Announcements
5251

53-
View the [v0.14.0 release notes](https://github.com/revel/revel/releases/tag/v0.14.0)
52+
View the [v0.15.0 release notes](https://github.com/revel/revel/releases/tag/v0.15.0)
5453
for all of the relevant changes.
5554

5655
We are working on increasing the speed and quality of our releases. Your feedback has never been so valuable, please share your thoughts with us and help shape Revel!

i18n.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package revel
66

77
import (
88
"fmt"
9+
"html/template"
910
"os"
1011
"path/filepath"
1112
"regexp"
@@ -85,7 +86,18 @@ func Message(locale, message string, args ...interface{}) string {
8586

8687
if len(args) > 0 {
8788
TRACE.Printf("Arguments detected, formatting '%s' with %v", value, args)
88-
value = fmt.Sprintf(value, args...)
89+
safeArgs := make([]interface{}, 0, len(args))
90+
for _, arg := range args {
91+
switch a := arg.(type) {
92+
case template.HTML:
93+
safeArgs = append(safeArgs, a)
94+
case string:
95+
safeArgs = append(safeArgs, template.HTML(template.HTMLEscapeString(a)))
96+
default:
97+
safeArgs = append(safeArgs, a)
98+
}
99+
}
100+
value = fmt.Sprintf(value, safeArgs...)
89101
}
90102

91103
return value

i18n_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package revel
66

77
import (
8+
"html/template"
89
"io/ioutil"
910
"log"
1011
"net/http"
@@ -72,6 +73,14 @@ func TestI18nMessage(t *testing.T) {
7273
if message := Message("nl", "unknown message"); message != "??? unknown message ???" {
7374
t.Error("Message 'unknown message' is not supposed to exist")
7475
}
76+
// XSS
77+
if message := Message("en", "arguments.string", "<img src=a onerror=alert(1) />"); message != "My name is &lt;img src=a onerror=alert(1) /&gt;" {
78+
t.Error("XSS protection for messages is broken:", message)
79+
}
80+
// Avoid escaping HTML
81+
if message := Message("en", "arguments.string", template.HTML("<img src=a onerror=alert(1) />")); message != "My name is <img src=a onerror=alert(1) />" {
82+
t.Error("Passing safe HTML to message is broken:", message)
83+
}
7584
}
7685

7786
func TestI18nMessageWithDefaultLocale(t *testing.T) {

testing/testsuite_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ func TestGetCustom(t *testing.T) {
7676

7777
testSuite.AssertOk()
7878
testSuite.AssertContentType("application/json")
79-
testSuite.AssertHeader("Server", "gunicorn/19.7.0")
8079
testSuite.AssertContains("httpbin.org")
8180
testSuite.AssertContainsRegex("gzip|deflate")
8281
}

version.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ package revel
66

77
const (
88
// Version current Revel version
9-
Version = "0.14.0"
9+
Version = "0.16.0-dev"
1010

1111
// BuildDate latest commit/release date
12-
BuildDate = "2017-03-24"
12+
BuildDate = "2017-05-11"
1313

1414
// MinimumGoVersion minimum required Go version for Revel
15-
MinimumGoVersion = ">= go1.4"
15+
MinimumGoVersion = ">= go1.7"
1616
)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy