KEYCLOAK-5298: Enable autoescaping in Freemarker (#4561)

* KEYCLOAK-5298: Enable autoescaping in Freemarker

* Fix several of the failing tests.

* Fix broken tests in integration-deprecated

* Fix last failing test.
This commit is contained in:
Stan Silvert 2017-10-23 12:03:00 -04:00 committed by GitHub
parent 1eb2d894e5
commit 9083e5fe5c
37 changed files with 129 additions and 111 deletions

View file

@ -20,7 +20,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="username" name="username" <#if !realm.editUsernameAllowed>disabled="disabled"</#if> value="${(account.username!'')?html}"/> <input type="text" class="form-control" id="username" name="username" <#if !realm.editUsernameAllowed>disabled="disabled"</#if> value="${(account.username!'')}"/>
</div> </div>
</div> </div>
@ -30,7 +30,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="email" name="email" autofocus value="${(account.email!'')?html}"/> <input type="text" class="form-control" id="email" name="email" autofocus value="${(account.email!'')}"/>
</div> </div>
</div> </div>
@ -40,7 +40,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="firstName" name="firstName" value="${(account.firstName!'')?html}"/> <input type="text" class="form-control" id="firstName" name="firstName" value="${(account.firstName!'')}"/>
</div> </div>
</div> </div>
@ -50,7 +50,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="lastName" name="lastName" value="${(account.lastName!'')?html}"/> <input type="text" class="form-control" id="lastName" name="lastName" value="${(account.lastName!'')}"/>
</div> </div>
</div> </div>
@ -60,7 +60,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="user.attributes.street" name="user.attributes.street" value="${(account.attributes.street!'')?html}"/> <input type="text" class="form-control" id="user.attributes.street" name="user.attributes.street" value="${(account.attributes.street!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -69,7 +69,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="user.attributes.locality" name="user.attributes.locality" value="${(account.attributes.locality!'')?html}"/> <input type="text" class="form-control" id="user.attributes.locality" name="user.attributes.locality" value="${(account.attributes.locality!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -78,7 +78,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="user.attributes.region" name="user.attributes.region" value="${(account.attributes.region!'')?html}"/> <input type="text" class="form-control" id="user.attributes.region" name="user.attributes.region" value="${(account.attributes.region!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -87,7 +87,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="user.attributes.postal_code" name="user.attributes.postal_code" value="${(account.attributes.postal_code!'')?html}"/> <input type="text" class="form-control" id="user.attributes.postal_code" name="user.attributes.postal_code" value="${(account.attributes.postal_code!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -96,14 +96,14 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="user.attributes.country" name="user.attributes.country" value="${(account.attributes.country!'')?html}"/> <input type="text" class="form-control" id="user.attributes.country" name="user.attributes.country" value="${(account.attributes.country!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div id="kc-form-buttons" class="col-md-offset-2 col-md-10 submit"> <div id="kc-form-buttons" class="col-md-offset-2 col-md-10 submit">
<div class=""> <div class="">
<#if url.referrerURI??><a href="${url.referrerURI}">${msg("backToApplication")}/a></#if> <#if url.referrerURI??><a href="${url.referrerURI}">${msg("backToApplication")?no_esc}/a></#if>
<button type="submit" class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonLargeClass!}" name="submitAction" value="Save">${msg("doSave")}</button> <button type="submit" class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonLargeClass!}" name="submitAction" value="Save">${msg("doSave")}</button>
<button type="submit" class="${properties.kcButtonClass!} ${properties.kcButtonDefaultClass!} ${properties.kcButtonLargeClass!}" name="submitAction" value="Cancel">${msg("doCancel")}</button> <button type="submit" class="${properties.kcButtonClass!} ${properties.kcButtonDefaultClass!} ${properties.kcButtonLargeClass!}" name="submitAction" value="Cancel">${msg("doCancel")}</button>
</div> </div>

View file

@ -11,7 +11,7 @@
<label for="email" class="${properties.kcLabelClass!}">${msg("email")}</label> <label for="email" class="${properties.kcLabelClass!}">${msg("email")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="email" name="email" value="${(user.email!'')?html}" class="${properties.kcInputClass!}" /> <input type="text" id="email" name="email" value="${(user.email!'')}" class="${properties.kcInputClass!}" />
</div> </div>
</div> </div>
@ -20,7 +20,7 @@
<label for="firstName" class="${properties.kcLabelClass!}">${msg("firstName")}</label> <label for="firstName" class="${properties.kcLabelClass!}">${msg("firstName")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="firstName" name="firstName" value="${(user.firstName!'')?html}" class="${properties.kcInputClass!}" /> <input type="text" id="firstName" name="firstName" value="${(user.firstName!'')}" class="${properties.kcInputClass!}" />
</div> </div>
</div> </div>
@ -29,7 +29,7 @@
<label for="lastName" class="${properties.kcLabelClass!}">${msg("lastName")}</label> <label for="lastName" class="${properties.kcLabelClass!}">${msg("lastName")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="lastName" name="lastName" value="${(user.lastName!'')?html}" class="${properties.kcInputClass!}" /> <input type="text" id="lastName" name="lastName" value="${(user.lastName!'')}" class="${properties.kcInputClass!}" />
</div> </div>
</div> </div>
@ -39,7 +39,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.street" name="user.attributes.street" value="${(user.attributes.street!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.street" name="user.attributes.street" value="${(user.attributes.street!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -48,7 +48,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.locality" name="user.attributes.locality" value="${(user.attributes.locality!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.locality" name="user.attributes.locality" value="${(user.attributes.locality!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -57,7 +57,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.region" name="user.attributes.region" value="${(user.attributes.region!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.region" name="user.attributes.region" value="${(user.attributes.region!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -66,7 +66,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.postal_code" name="user.attributes.postal_code" value="${(user.attributes.postal_code!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.postal_code" name="user.attributes.postal_code" value="${(user.attributes.postal_code!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -75,7 +75,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.country" name="user.attributes.country" value="${(user.attributes.country!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.country" name="user.attributes.country" value="${(user.attributes.country!'')}"/>
</div> </div>
</div> </div>

View file

@ -12,7 +12,7 @@
<label for="username" class="${properties.kcLabelClass!}">${msg("username")}</label> <label for="username" class="${properties.kcLabelClass!}">${msg("username")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="username" class="${properties.kcInputClass!}" name="username" value="${(register.formData.username!'')?html}" /> <input type="text" id="username" class="${properties.kcInputClass!}" name="username" value="${(register.formData.username!'')}" />
</div> </div>
</div> </div>
</#if> </#if>
@ -21,7 +21,7 @@
<label for="firstName" class="${properties.kcLabelClass!}">${msg("firstName")}</label> <label for="firstName" class="${properties.kcLabelClass!}">${msg("firstName")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="firstName" class="${properties.kcInputClass!}" name="firstName" value="${(register.formData.firstName!'')?html}" /> <input type="text" id="firstName" class="${properties.kcInputClass!}" name="firstName" value="${(register.formData.firstName!'')}" />
</div> </div>
</div> </div>
@ -30,7 +30,7 @@
<label for="lastName" class="${properties.kcLabelClass!}">${msg("lastName")}</label> <label for="lastName" class="${properties.kcLabelClass!}">${msg("lastName")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="lastName" class="${properties.kcInputClass!}" name="lastName" value="${(register.formData.lastName!'')?html}" /> <input type="text" id="lastName" class="${properties.kcInputClass!}" name="lastName" value="${(register.formData.lastName!'')}" />
</div> </div>
</div> </div>
@ -39,7 +39,7 @@
<label for="email" class="${properties.kcLabelClass!}">${msg("email")}</label> <label for="email" class="${properties.kcLabelClass!}">${msg("email")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="email" class="${properties.kcInputClass!}" name="email" value="${(register.formData.email!'')?html}" /> <input type="text" id="email" class="${properties.kcInputClass!}" name="email" value="${(register.formData.email!'')}" />
</div> </div>
</div> </div>
@ -68,7 +68,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.street" name="user.attributes.street" value="${(register.formData['user.attributes.street']!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.street" name="user.attributes.street" value="${(register.formData['user.attributes.street']!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -77,7 +77,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.locality" name="user.attributes.locality" value="${(register.formData['user.attributes.locality']!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.locality" name="user.attributes.locality" value="${(register.formData['user.attributes.locality']!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -86,7 +86,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.region" name="user.attributes.region" value="${(register.formData['user.attributes.region']!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.region" name="user.attributes.region" value="${(register.formData['user.attributes.region']!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -95,7 +95,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.postal_code" name="user.attributes.postal_code" value="${(register.formData['user.attributes.postal_code']!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.postal_code" name="user.attributes.postal_code" value="${(register.formData['user.attributes.postal_code']!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -104,7 +104,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.country" name="user.attributes.country" value="${(register.formData['user.attributes.country']!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.country" name="user.attributes.country" value="${(register.formData['user.attributes.country']!'')}"/>
</div> </div>
</div> </div>
<#if recaptchaRequired??> <#if recaptchaRequired??>
@ -118,7 +118,7 @@
<div class="${properties.kcFormGroupClass!}"> <div class="${properties.kcFormGroupClass!}">
<div id="kc-form-options" class="${properties.kcFormOptionsClass!}"> <div id="kc-form-options" class="${properties.kcFormOptionsClass!}">
<div class="${properties.kcFormOptionsWrapperClass!}"> <div class="${properties.kcFormOptionsWrapperClass!}">
<span><a href="${url.loginUrl}">${msg("backToLogin")}</a></span> <span><a href="${url.loginUrl}">${msg("backToLogin")?no_esc}</a></span>
</div> </div>
</div> </div>

View file

@ -91,11 +91,11 @@
<apacheds.version>2.0.0-M21</apacheds.version> <apacheds.version>2.0.0-M21</apacheds.version>
<apacheds.codec.version>1.0.0-M33</apacheds.codec.version> <apacheds.codec.version>1.0.0-M33</apacheds.codec.version>
<google.zxing.version>3.2.1</google.zxing.version> <google.zxing.version>3.2.1</google.zxing.version>
<freemarker.version>2.3.26-incubating</freemarker.version>
<!-- Same version as ships with wildfly. --> <!-- Same version as ships with wildfly. -->
<google.guava.version>20.0</google.guava.version> <google.guava.version>20.0</google.guava.version>
<freemarker.version>2.3.23</freemarker.version>
<jetty9.version>9.1.0.v20131115</jetty9.version> <jetty9.version>9.1.0.v20131115</jetty9.version>
<liquibase.version>3.4.1</liquibase.version> <liquibase.version>3.4.1</liquibase.version>
<mysql.version>5.1.29</mysql.version> <mysql.version>5.1.29</mysql.version>

View file

@ -18,6 +18,7 @@
package org.keycloak.theme; package org.keycloak.theme;
import freemarker.cache.URLTemplateLoader; import freemarker.cache.URLTemplateLoader;
import freemarker.core.HTMLOutputFormat;
import freemarker.template.Configuration; import freemarker.template.Configuration;
import freemarker.template.Template; import freemarker.template.Template;
import org.keycloak.Config; import org.keycloak.Config;
@ -67,6 +68,13 @@ public class FreeMarkerUtil {
private Template getTemplate(String templateName, Theme theme) throws IOException { private Template getTemplate(String templateName, Theme theme) throws IOException {
Configuration cfg = new Configuration(); Configuration cfg = new Configuration();
// Assume *.ftl files are html. This lets freemarker know how to
// sanitize and prevent XSS attacks.
if (templateName.toLowerCase().endsWith(".ftl")) {
cfg.setOutputFormat(HTMLOutputFormat.INSTANCE);
}
cfg.setTemplateLoader(new ThemeTemplateLoader(theme)); cfg.setTemplateLoader(new ThemeTemplateLoader(theme));
return cfg.getTemplate(templateName, "UTF-8"); return cfg.getTemplate(templateName, "UTF-8");
} }

View file

@ -20,7 +20,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="username" name="username" <#if !realm.editUsernameAllowed>disabled="disabled"</#if> value="${(account.username!'')?html}"/> <input type="text" class="form-control" id="username" name="username" <#if !realm.editUsernameAllowed>disabled="disabled"</#if> value="${(account.username!'')}"/>
</div> </div>
</div> </div>
@ -30,7 +30,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="email" name="email" autofocus value="${(account.email!'')?html}"/> <input type="text" class="form-control" id="email" name="email" autofocus value="${(account.email!'')}"/>
</div> </div>
</div> </div>
@ -40,7 +40,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="firstName" name="firstName" value="${(account.firstName!'')?html}"/> <input type="text" class="form-control" id="firstName" name="firstName" value="${(account.firstName!'')}"/>
</div> </div>
</div> </div>
@ -50,7 +50,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="lastName" name="lastName" value="${(account.lastName!'')?html}"/> <input type="text" class="form-control" id="lastName" name="lastName" value="${(account.lastName!'')}"/>
</div> </div>
</div> </div>
@ -60,7 +60,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="user.attributes.street" name="user.attributes.street" value="${(account.attributes.street!'')?html}"/> <input type="text" class="form-control" id="user.attributes.street" name="user.attributes.street" value="${(account.attributes.street!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -69,7 +69,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="user.attributes.locality" name="user.attributes.locality" value="${(account.attributes.locality!'')?html}"/> <input type="text" class="form-control" id="user.attributes.locality" name="user.attributes.locality" value="${(account.attributes.locality!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -78,7 +78,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="user.attributes.region" name="user.attributes.region" value="${(account.attributes.region!'')?html}"/> <input type="text" class="form-control" id="user.attributes.region" name="user.attributes.region" value="${(account.attributes.region!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -87,7 +87,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="user.attributes.postal_code" name="user.attributes.postal_code" value="${(account.attributes.postal_code!'')?html}"/> <input type="text" class="form-control" id="user.attributes.postal_code" name="user.attributes.postal_code" value="${(account.attributes.postal_code!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -96,14 +96,14 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="user.attributes.country" name="user.attributes.country" value="${(account.attributes.country!'')?html}"/> <input type="text" class="form-control" id="user.attributes.country" name="user.attributes.country" value="${(account.attributes.country!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div id="kc-form-buttons" class="col-md-offset-2 col-md-10 submit"> <div id="kc-form-buttons" class="col-md-offset-2 col-md-10 submit">
<div class=""> <div class="">
<#if url.referrerURI??><a href="${url.referrerURI}">${msg("backToApplication")}/a></#if> <#if url.referrerURI??><a href="${url.referrerURI}">${msg("backToApplication")?no_esc}/a></#if>
<button type="submit" class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonLargeClass!}" name="submitAction" value="Save">${msg("doSave")}</button> <button type="submit" class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonLargeClass!}" name="submitAction" value="Save">${msg("doSave")}</button>
<button type="submit" class="${properties.kcButtonClass!} ${properties.kcButtonDefaultClass!} ${properties.kcButtonLargeClass!}" name="submitAction" value="Cancel">${msg("doCancel")}</button> <button type="submit" class="${properties.kcButtonClass!} ${properties.kcButtonDefaultClass!} ${properties.kcButtonLargeClass!}" name="submitAction" value="Cancel">${msg("doCancel")}</button>
</div> </div>

View file

@ -11,7 +11,7 @@
<label for="email" class="${properties.kcLabelClass!}">${msg("email")}</label> <label for="email" class="${properties.kcLabelClass!}">${msg("email")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="email" name="email" value="${(user.email!'')?html}" class="${properties.kcInputClass!}" /> <input type="text" id="email" name="email" value="${(user.email!'')}" class="${properties.kcInputClass!}" />
</div> </div>
</div> </div>
@ -20,7 +20,7 @@
<label for="firstName" class="${properties.kcLabelClass!}">${msg("firstName")}</label> <label for="firstName" class="${properties.kcLabelClass!}">${msg("firstName")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="firstName" name="firstName" value="${(user.firstName!'')?html}" class="${properties.kcInputClass!}" /> <input type="text" id="firstName" name="firstName" value="${(user.firstName!'')}" class="${properties.kcInputClass!}" />
</div> </div>
</div> </div>
@ -29,7 +29,7 @@
<label for="lastName" class="${properties.kcLabelClass!}">${msg("lastName")}</label> <label for="lastName" class="${properties.kcLabelClass!}">${msg("lastName")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="lastName" name="lastName" value="${(user.lastName!'')?html}" class="${properties.kcInputClass!}" /> <input type="text" id="lastName" name="lastName" value="${(user.lastName!'')}" class="${properties.kcInputClass!}" />
</div> </div>
</div> </div>
@ -39,7 +39,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.street" name="user.attributes.street" value="${(user.attributes.street!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.street" name="user.attributes.street" value="${(user.attributes.street!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -48,7 +48,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.locality" name="user.attributes.locality" value="${(user.attributes.locality!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.locality" name="user.attributes.locality" value="${(user.attributes.locality!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -57,7 +57,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.region" name="user.attributes.region" value="${(user.attributes.region!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.region" name="user.attributes.region" value="${(user.attributes.region!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -66,7 +66,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.postal_code" name="user.attributes.postal_code" value="${(user.attributes.postal_code!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.postal_code" name="user.attributes.postal_code" value="${(user.attributes.postal_code!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -75,7 +75,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.country" name="user.attributes.country" value="${(user.attributes.country!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.country" name="user.attributes.country" value="${(user.attributes.country!'')}"/>
</div> </div>
</div> </div>

View file

@ -12,7 +12,7 @@
<label for="username" class="${properties.kcLabelClass!}">${msg("username")}</label> <label for="username" class="${properties.kcLabelClass!}">${msg("username")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="username" class="${properties.kcInputClass!}" name="username" value="${(register.formData.username!'')?html}" /> <input type="text" id="username" class="${properties.kcInputClass!}" name="username" value="${(register.formData.username!'')}" />
</div> </div>
</div> </div>
</#if> </#if>
@ -21,7 +21,7 @@
<label for="firstName" class="${properties.kcLabelClass!}">${msg("firstName")}</label> <label for="firstName" class="${properties.kcLabelClass!}">${msg("firstName")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="firstName" class="${properties.kcInputClass!}" name="firstName" value="${(register.formData.firstName!'')?html}" /> <input type="text" id="firstName" class="${properties.kcInputClass!}" name="firstName" value="${(register.formData.firstName!'')}" />
</div> </div>
</div> </div>
@ -30,7 +30,7 @@
<label for="lastName" class="${properties.kcLabelClass!}">${msg("lastName")}</label> <label for="lastName" class="${properties.kcLabelClass!}">${msg("lastName")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="lastName" class="${properties.kcInputClass!}" name="lastName" value="${(register.formData.lastName!'')?html}" /> <input type="text" id="lastName" class="${properties.kcInputClass!}" name="lastName" value="${(register.formData.lastName!'')}" />
</div> </div>
</div> </div>
@ -39,7 +39,7 @@
<label for="email" class="${properties.kcLabelClass!}">${msg("email")}</label> <label for="email" class="${properties.kcLabelClass!}">${msg("email")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="email" class="${properties.kcInputClass!}" name="email" value="${(register.formData.email!'')?html}" /> <input type="text" id="email" class="${properties.kcInputClass!}" name="email" value="${(register.formData.email!'')}" />
</div> </div>
</div> </div>
@ -68,7 +68,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.street" name="user.attributes.street" value="${(register.formData['user.attributes.street']!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.street" name="user.attributes.street" value="${(register.formData['user.attributes.street']!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -77,7 +77,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.locality" name="user.attributes.locality" value="${(register.formData['user.attributes.locality']!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.locality" name="user.attributes.locality" value="${(register.formData['user.attributes.locality']!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -86,7 +86,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.region" name="user.attributes.region" value="${(register.formData['user.attributes.region']!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.region" name="user.attributes.region" value="${(register.formData['user.attributes.region']!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -95,7 +95,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.postal_code" name="user.attributes.postal_code" value="${(register.formData['user.attributes.postal_code']!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.postal_code" name="user.attributes.postal_code" value="${(register.formData['user.attributes.postal_code']!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -104,7 +104,7 @@
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" class="${properties.kcInputClass!}" id="user.attributes.country" name="user.attributes.country" value="${(register.formData['user.attributes.country']!'')?html}"/> <input type="text" class="${properties.kcInputClass!}" id="user.attributes.country" name="user.attributes.country" value="${(register.formData['user.attributes.country']!'')}"/>
</div> </div>
</div> </div>
<#if recaptchaRequired??> <#if recaptchaRequired??>
@ -118,7 +118,7 @@
<div class="${properties.kcFormGroupClass!}"> <div class="${properties.kcFormGroupClass!}">
<div id="kc-form-options" class="${properties.kcFormOptionsClass!}"> <div id="kc-form-options" class="${properties.kcFormOptionsClass!}">
<div class="${properties.kcFormOptionsWrapperClass!}"> <div class="${properties.kcFormOptionsWrapperClass!}">
<span><a href="${url.loginUrl}">${msg("backToLogin")}</a></span> <span><a href="${url.loginUrl}">${msg("backToLogin")?no_esc}</a></span>
</div> </div>
</div> </div>

View file

@ -439,7 +439,7 @@ public class ResetPasswordTest extends AbstractTestRealmKeycloakTest {
MimeMessage message = greenMail.getReceivedMessages()[0]; MimeMessage message = greenMail.getReceivedMessages()[0];
String changePasswordUrl = getPasswordResetEmailLink(message); String changePasswordUrl = getPasswordResetEmailLink(message).replace("&amp;", "&");
setTimeOffset(70); setTimeOffset(70);
@ -735,7 +735,12 @@ public class ResetPasswordTest extends AbstractTestRealmKeycloakTest {
assertEquals("text/html; charset=UTF-8", htmlContentType); assertEquals("text/html; charset=UTF-8", htmlContentType);
final String htmlBody = (String) multipart.getBodyPart(1).getContent(); final String htmlBody = (String) multipart.getBodyPart(1).getContent();
final String htmlChangePwdUrl = MailUtils.getLink(htmlBody);
// .replace() accounts for escaping the ampersand
// It's not escaped in the html version because html retrieved from a
// message bundle is considered safe and it must be unescaped to display
// properly.
final String htmlChangePwdUrl = MailUtils.getLink(htmlBody).replace("&", "&amp;");
assertEquals(htmlChangePwdUrl, textChangePwdUrl); assertEquals(htmlChangePwdUrl, textChangePwdUrl);

View file

@ -356,7 +356,12 @@ public abstract class AbstractIdentityProviderTest {
assertEquals("text/html; charset=UTF-8", htmlContentType); assertEquals("text/html; charset=UTF-8", htmlContentType);
final String htmlBody = (String) multipart.getBodyPart(1).getContent(); final String htmlBody = (String) multipart.getBodyPart(1).getContent();
final String htmlVerificationUrl = MailUtil.getLink(htmlBody);
// .replace() accounts for escaping the ampersand
// It's not escaped in the html version because html retrieved from a
// message bundle is considered safe and it must be unescaped to display
// properly.
final String htmlVerificationUrl = MailUtil.getLink(htmlBody).replace("&", "&amp;");
assertEquals(htmlVerificationUrl, textVerificationUrl); assertEquals(htmlVerificationUrl, textVerificationUrl);

View file

@ -12,7 +12,7 @@
<form action="${url.accountUrl}" class="form-horizontal" method="post"> <form action="${url.accountUrl}" class="form-horizontal" method="post">
<input type="hidden" id="stateChecker" name="stateChecker" value="${stateChecker?html}"> <input type="hidden" id="stateChecker" name="stateChecker" value="${stateChecker}">
<#if !realm.registrationEmailAsUsername> <#if !realm.registrationEmailAsUsername>
<div class="form-group ${messagesPerField.printIfExists('username','has-error')}"> <div class="form-group ${messagesPerField.printIfExists('username','has-error')}">
@ -21,7 +21,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="username" name="username" <#if !realm.editUsernameAllowed>disabled="disabled"</#if> value="${(account.username!'')?html}"/> <input type="text" class="form-control" id="username" name="username" <#if !realm.editUsernameAllowed>disabled="disabled"</#if> value="${(account.username!'')}"/>
</div> </div>
</div> </div>
</#if> </#if>
@ -32,7 +32,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="email" name="email" autofocus value="${(account.email!'')?html}"/> <input type="text" class="form-control" id="email" name="email" autofocus value="${(account.email!'')}"/>
</div> </div>
</div> </div>
@ -42,7 +42,7 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="firstName" name="firstName" value="${(account.firstName!'')?html}"/> <input type="text" class="form-control" id="firstName" name="firstName" value="${(account.firstName!'')}"/>
</div> </div>
</div> </div>
@ -52,14 +52,14 @@
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<input type="text" class="form-control" id="lastName" name="lastName" value="${(account.lastName!'')?html}"/> <input type="text" class="form-control" id="lastName" name="lastName" value="${(account.lastName!'')}"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div id="kc-form-buttons" class="col-md-offset-2 col-md-10 submit"> <div id="kc-form-buttons" class="col-md-offset-2 col-md-10 submit">
<div class=""> <div class="">
<#if url.referrerURI??><a href="${url.referrerURI}">${msg("backToApplication")}/a></#if> <#if url.referrerURI??><a href="${url.referrerURI}">${msg("backToApplication")?no_esc}/a></#if>
<button type="submit" class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonLargeClass!}" name="submitAction" value="Save">${msg("doSave")}</button> <button type="submit" class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonLargeClass!}" name="submitAction" value="Save">${msg("doSave")}</button>
<button type="submit" class="${properties.kcButtonClass!} ${properties.kcButtonDefaultClass!} ${properties.kcButtonLargeClass!}" name="submitAction" value="Cancel">${msg("doCancel")}</button> <button type="submit" class="${properties.kcButtonClass!} ${properties.kcButtonDefaultClass!} ${properties.kcButtonLargeClass!}" name="submitAction" value="Cancel">${msg("doCancel")}</button>
</div> </div>

View file

@ -8,8 +8,8 @@
</div> </div>
<form action="${url.revokeClientUrl}" method="post"> <form action="${url.revokeClientUrl}" method="post">
<input type="hidden" id="stateChecker" name="stateChecker" value="${stateChecker?html}"> <input type="hidden" id="stateChecker" name="stateChecker" value="${stateChecker}">
<input type="hidden" id="referrer" name="referrer" value="${stateChecker?html}"> <input type="hidden" id="referrer" name="referrer" value="${stateChecker}">
<table class="table table-striped table-bordered"> <table class="table table-striped table-bordered">
<thead> <thead>

View file

@ -26,7 +26,7 @@
</div> </div>
</#if> </#if>
<input type="hidden" id="stateChecker" name="stateChecker" value="${stateChecker?html}"> <input type="hidden" id="stateChecker" name="stateChecker" value="${stateChecker}">
<div class="form-group"> <div class="form-group">
<div class="col-sm-2 col-md-2"> <div class="col-sm-2 col-md-2">

View file

@ -43,8 +43,8 @@
</div> </div>
<li> <li>
</#if> </#if>
<#if referrer?has_content && referrer.url?has_content><li><a href="${referrer.url?html}" id="referrer">${msg("backTo",referrer.name?html)}</a></li></#if> <#if referrer?has_content && referrer.url?has_content><li><a href="${referrer.url}" id="referrer">${msg("backTo",referrer.name)}</a></li></#if>
<li><a href="${url.logoutUrl?html}">${msg("doSignOut")}</a></li> <li><a href="${url.logoutUrl}">${msg("doSignOut")}</a></li>
</ul> </ul>
</div> </div>
</div> </div>

View file

@ -29,7 +29,7 @@
<ol> <ol>
<li> <li>
<p>${msg("totpStep1")}</p> <p>${msg("totpStep1")?no_esc}</p>
</li> </li>
<li> <li>
<p>${msg("totpStep2")}</p> <p>${msg("totpStep2")}</p>
@ -44,7 +44,7 @@
<hr/> <hr/>
<form action="${url.totpUrl}" class="form-horizontal" method="post"> <form action="${url.totpUrl}" class="form-horizontal" method="post">
<input type="hidden" id="stateChecker" name="stateChecker" value="${stateChecker?html}"> <input type="hidden" id="stateChecker" name="stateChecker" value="${stateChecker}">
<div class="form-group"> <div class="form-group">
<div class="col-sm-2 col-md-2"> <div class="col-sm-2 col-md-2">
<label for="totp" class="control-label">${msg("authenticatorCode")}</label> <label for="totp" class="control-label">${msg("authenticatorCode")}</label>

View file

@ -1,5 +1,5 @@
<html> <html>
<body> <body>
${msg("emailTestBodyHtml",realmName)} ${msg("emailTestBodyHtml",realmName)?no_esc}
</body> </body>
</html> </html>

View file

@ -1,5 +1,5 @@
<html> <html>
<body> <body>
${msg("emailVerificationBodyHtml",link, linkExpiration, realmName)} ${msg("emailVerificationBodyHtml",link, linkExpiration, realmName)?no_esc}
</body> </body>
</html> </html>

View file

@ -1,5 +1,5 @@
<html> <html>
<body> <body>
${msg("eventLoginErrorBodyHtml",event.date,event.ipAddress)} ${msg("eventLoginErrorBodyHtml",event.date,event.ipAddress)?no_esc}
</body> </body>
</html> </html>

View file

@ -1,5 +1,5 @@
<html> <html>
<body> <body>
${msg("eventRemoveTotpBodyHtml",event.date, event.ipAddress)} ${msg("eventRemoveTotpBodyHtml",event.date, event.ipAddress)?no_esc}
</body> </body>
</html> </html>

View file

@ -1,5 +1,5 @@
<html> <html>
<body> <body>
${msg("eventUpdatePasswordBodyHtml",event.date, event.ipAddress)} ${msg("eventUpdatePasswordBodyHtml",event.date, event.ipAddress)?no_esc}
</body> </body>
</html> </html>

View file

@ -1,5 +1,5 @@
<html> <html>
<body> <body>
${msg("eventUpdateTotpBodyHtml",event.date, event.ipAddress)} ${msg("eventUpdateTotpBodyHtml",event.date, event.ipAddress)?no_esc}
</body> </body>
</html> </html>

View file

@ -3,6 +3,6 @@
</#assign> </#assign>
<html> <html>
<body> <body>
${msg("executeActionsBodyHtml",link, linkExpiration, realmName, requiredActionsText)} ${msg("executeActionsBodyHtml",link, linkExpiration, realmName, requiredActionsText)?no_esc}
</body> </body>
</html> </html>

View file

@ -1,5 +1,5 @@
<html> <html>
<body> <body>
${msg("identityProviderLinkBodyHtml", identityProviderAlias, realmName, identityProviderContext.username, link, linkExpiration)} ${msg("identityProviderLinkBodyHtml", identityProviderAlias, realmName, identityProviderContext.username, link, linkExpiration)?no_esc}
</body> </body>
</html> </html>

View file

@ -1,5 +1,5 @@
<html> <html>
<body> <body>
${msg("passwordResetBodyHtml",link, linkExpiration, realmName)} ${msg("passwordResetBodyHtml",link, linkExpiration, realmName)?no_esc}
</body> </body>
</html> </html>

View file

@ -3,12 +3,12 @@
<#if section = "title"> <#if section = "title">
${msg("errorTitle")} ${msg("errorTitle")}
<#elseif section = "header"> <#elseif section = "header">
${msg("errorTitleHtml")} ${msg("errorTitleHtml")?no_esc}
<#elseif section = "form"> <#elseif section = "form">
<div id="kc-error-message"> <div id="kc-error-message">
<p class="instruction">${message.summary}</p> <p class="instruction">${message.summary}</p>
<#if client?? && client.baseUrl?has_content> <#if client?? && client.baseUrl?has_content>
<p><a id="backToApplication" href="${client.baseUrl}">${msg("backToApplication")}</a></p> <p><a id="backToApplication" href="${client.baseUrl}">${msg("backToApplication")?no_esc}</a></p>
</#if> </#if>
</div> </div>
</#if> </#if>

View file

@ -10,11 +10,11 @@
<#if skipLink??> <#if skipLink??>
<#else> <#else>
<#if pageRedirectUri??> <#if pageRedirectUri??>
<p><a href="${pageRedirectUri}">${msg("backToApplication")}</a></p> <p><a href="${pageRedirectUri}">${msg("backToApplication")?no_esc}</a></p>
<#elseif actionUri??> <#elseif actionUri??>
<p><a href="${actionUri}">${msg("proceedWithAction")}</a></p> <p><a href="${actionUri}">${msg("proceedWithAction")?no_esc}</a></p>
<#elseif client.baseUrl??> <#elseif client.baseUrl??>
<p><a href="${client.baseUrl}">${msg("backToApplication")}</a></p> <p><a href="${client.baseUrl}">${msg("backToApplication")?no_esc}</a></p>
</#if> </#if>
</#if> </#if>
</div> </div>

View file

@ -7,7 +7,7 @@
<#elseif section = "form"> <#elseif section = "form">
<ol id="kc-totp-settings"> <ol id="kc-totp-settings">
<li> <li>
<p>${msg("loginTotpStep1")}</p> <p>${msg("loginTotpStep1")?no_esc}</p>
</li> </li>
<li> <li>
<p>${msg("loginTotpStep2")}</p> <p>${msg("loginTotpStep2")}</p>

View file

@ -3,7 +3,7 @@
<#if section = "title"> <#if section = "title">
${msg("oauthGrantTitle")} ${msg("oauthGrantTitle")}
<#elseif section = "header"> <#elseif section = "header">
${msg("oauthGrantTitleHtml",(realm.displayNameHtml!''))} <strong><#if client.name??>${advancedMsg(client.name)}<#else>${client.clientId}</#if></strong>. ${msg("oauthGrantTitleHtml",(realm.displayNameHtml!''))?no_esc} <strong><#if client.name??>${advancedMsg(client.name)}<#else>${client.clientId}</#if></strong>.
<#elseif section = "form"> <#elseif section = "form">
<div id="kc-oauth" class="content-area"> <div id="kc-oauth" class="content-area">
<h3>${msg("oauthGrantRequest")}</h3> <h3>${msg("oauthGrantRequest")}</h3>

View file

@ -18,7 +18,7 @@
<div class="${properties.kcFormGroupClass!}"> <div class="${properties.kcFormGroupClass!}">
<div id="kc-form-options" class="${properties.kcFormOptionsClass!}"> <div id="kc-form-options" class="${properties.kcFormOptionsClass!}">
<div class="${properties.kcFormOptionsWrapperClass!}"> <div class="${properties.kcFormOptionsWrapperClass!}">
<span><a href="${url.loginUrl}">${msg("backToLogin")}</a></span> <span><a href="${url.loginUrl}">${msg("backToLogin")?no_esc}</a></span>
</div> </div>
</div> </div>

View file

@ -3,7 +3,7 @@
<#if section = "title"> <#if section = "title">
${msg("loginTitle",realm.displayName)} ${msg("loginTitle",realm.displayName)}
<#elseif section = "header"> <#elseif section = "header">
${msg("loginTitleHtml",realm.displayNameHtml)} ${msg("loginTitleHtml",realm.displayNameHtml)?no_esc}
<#elseif section = "form"> <#elseif section = "form">
<form id="kc-totp-login-form" class="${properties.kcFormClass!}" action="${url.loginAction}" method="post"> <form id="kc-totp-login-form" class="${properties.kcFormClass!}" action="${url.loginAction}" method="post">
<div class="${properties.kcFormGroupClass!}"> <div class="${properties.kcFormGroupClass!}">

View file

@ -12,7 +12,7 @@
<label for="username" class="${properties.kcLabelClass!}">${msg("username")}</label> <label for="username" class="${properties.kcLabelClass!}">${msg("username")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="username" name="username" value="${(user.username!'')?html}" class="${properties.kcInputClass!}"/> <input type="text" id="username" name="username" value="${(user.username!'')}" class="${properties.kcInputClass!}"/>
</div> </div>
</div> </div>
</#if> </#if>
@ -21,7 +21,7 @@
<label for="email" class="${properties.kcLabelClass!}">${msg("email")}</label> <label for="email" class="${properties.kcLabelClass!}">${msg("email")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="email" name="email" value="${(user.email!'')?html}" class="${properties.kcInputClass!}" /> <input type="text" id="email" name="email" value="${(user.email!'')}" class="${properties.kcInputClass!}" />
</div> </div>
</div> </div>
@ -30,7 +30,7 @@
<label for="firstName" class="${properties.kcLabelClass!}">${msg("firstName")}</label> <label for="firstName" class="${properties.kcLabelClass!}">${msg("firstName")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="firstName" name="firstName" value="${(user.firstName!'')?html}" class="${properties.kcInputClass!}" /> <input type="text" id="firstName" name="firstName" value="${(user.firstName!'')}" class="${properties.kcInputClass!}" />
</div> </div>
</div> </div>
@ -39,7 +39,7 @@
<label for="lastName" class="${properties.kcLabelClass!}">${msg("lastName")}</label> <label for="lastName" class="${properties.kcLabelClass!}">${msg("lastName")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="lastName" name="lastName" value="${(user.lastName!'')?html}" class="${properties.kcInputClass!}" /> <input type="text" id="lastName" name="lastName" value="${(user.lastName!'')}" class="${properties.kcInputClass!}" />
</div> </div>
</div> </div>

View file

@ -3,7 +3,7 @@
<#if section = "title"> <#if section = "title">
${msg("loginTitle",(realm.displayName!''))} ${msg("loginTitle",(realm.displayName!''))}
<#elseif section = "header"> <#elseif section = "header">
${msg("loginTitleHtml",(realm.displayNameHtml!''))} ${msg("loginTitleHtml",(realm.displayNameHtml!''))?no_esc}
<#elseif section = "form"> <#elseif section = "form">
<form id="kc-x509-login-info" class="${properties.kcFormClass!}" action="${url.loginAction}" method="post"> <form id="kc-x509-login-info" class="${properties.kcFormClass!}" action="${url.loginAction}" method="post">
@ -14,7 +14,7 @@
</div> </div>
<#if subjectDN??> <#if subjectDN??>
<div class="${properties.kcLabelWrapperClass!}"> <div class="${properties.kcLabelWrapperClass!}">
<label id="certificate_subjectDN" class="${properties.kcLabelClass!}">${(subjectDN!"")?html}</label> <label id="certificate_subjectDN" class="${properties.kcLabelClass!}">${(subjectDN!"")}</label>
</div> </div>
<#else> <#else>
<div class="${properties.kcLabelWrapperClass!}"> <div class="${properties.kcLabelWrapperClass!}">
@ -30,7 +30,7 @@
<label for="username" class="${properties.kcLabelClass!}">You will be logged in as:</label> <label for="username" class="${properties.kcLabelClass!}">You will be logged in as:</label>
</div> </div>
<div class="${properties.kcLabelWrapperClass!}"> <div class="${properties.kcLabelWrapperClass!}">
<label id="username" class="${properties.kcLabelClass!}">${(username!'')?html}</label> <label id="username" class="${properties.kcLabelClass!}">${(username!'')}</label>
</div> </div>
</#if> </#if>

View file

@ -3,7 +3,7 @@
<#if section = "title"> <#if section = "title">
${msg("loginTitle",(realm.displayName!''))} ${msg("loginTitle",(realm.displayName!''))}
<#elseif section = "header"> <#elseif section = "header">
${msg("loginTitleHtml",(realm.displayNameHtml!''))} ${msg("loginTitleHtml",(realm.displayNameHtml!''))?no_esc}
<#elseif section = "form"> <#elseif section = "form">
<#if realm.password> <#if realm.password>
<form id="kc-form-login" class="${properties.kcFormClass!}" action="${url.loginAction}" method="post"> <form id="kc-form-login" class="${properties.kcFormClass!}" action="${url.loginAction}" method="post">
@ -14,9 +14,9 @@
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<#if usernameEditDisabled??> <#if usernameEditDisabled??>
<input tabindex="1" id="username" class="${properties.kcInputClass!}" name="username" value="${(login.username!'')?html}" type="text" disabled /> <input tabindex="1" id="username" class="${properties.kcInputClass!}" name="username" value="${(login.username!'')}" type="text" disabled />
<#else> <#else>
<input tabindex="1" id="username" class="${properties.kcInputClass!}" name="username" value="${(login.username!'')?html}" type="text" autofocus autocomplete="off" /> <input tabindex="1" id="username" class="${properties.kcInputClass!}" name="username" value="${(login.username!'')}" type="text" autofocus autocomplete="off" />
</#if> </#if>
</div> </div>
</div> </div>

View file

@ -3,7 +3,7 @@
<#if section = "title"> <#if section = "title">
${msg("registerWithTitle",(realm.displayName!''))} ${msg("registerWithTitle",(realm.displayName!''))}
<#elseif section = "header"> <#elseif section = "header">
${msg("registerWithTitleHtml",(realm.displayNameHtml!''))} ${msg("registerWithTitleHtml",(realm.displayNameHtml!''))?no_esc}
<#elseif section = "form"> <#elseif section = "form">
<form id="kc-register-form" class="${properties.kcFormClass!}" action="${url.registrationAction}" method="post"> <form id="kc-register-form" class="${properties.kcFormClass!}" action="${url.registrationAction}" method="post">
<input type="text" readonly value="this is not a login form" style="display: none;"> <input type="text" readonly value="this is not a login form" style="display: none;">
@ -15,7 +15,7 @@
<label for="username" class="${properties.kcLabelClass!}">${msg("username")}</label> <label for="username" class="${properties.kcLabelClass!}">${msg("username")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="username" class="${properties.kcInputClass!}" name="username" value="${(register.formData.username!'')?html}" /> <input type="text" id="username" class="${properties.kcInputClass!}" name="username" value="${(register.formData.username!'')}" />
</div> </div>
</div> </div>
</#if> </#if>
@ -24,7 +24,7 @@
<label for="firstName" class="${properties.kcLabelClass!}">${msg("firstName")}</label> <label for="firstName" class="${properties.kcLabelClass!}">${msg("firstName")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="firstName" class="${properties.kcInputClass!}" name="firstName" value="${(register.formData.firstName!'')?html}" /> <input type="text" id="firstName" class="${properties.kcInputClass!}" name="firstName" value="${(register.formData.firstName!'')}" />
</div> </div>
</div> </div>
@ -33,7 +33,7 @@
<label for="lastName" class="${properties.kcLabelClass!}">${msg("lastName")}</label> <label for="lastName" class="${properties.kcLabelClass!}">${msg("lastName")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="lastName" class="${properties.kcInputClass!}" name="lastName" value="${(register.formData.lastName!'')?html}" /> <input type="text" id="lastName" class="${properties.kcInputClass!}" name="lastName" value="${(register.formData.lastName!'')}" />
</div> </div>
</div> </div>
@ -42,7 +42,7 @@
<label for="email" class="${properties.kcLabelClass!}">${msg("email")}</label> <label for="email" class="${properties.kcLabelClass!}">${msg("email")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="text" id="email" class="${properties.kcInputClass!}" name="email" value="${(register.formData.email!'')?html}" /> <input type="text" id="email" class="${properties.kcInputClass!}" name="email" value="${(register.formData.email!'')}" />
</div> </div>
</div> </div>
@ -77,7 +77,7 @@
<div class="${properties.kcFormGroupClass!}"> <div class="${properties.kcFormGroupClass!}">
<div id="kc-form-options" class="${properties.kcFormOptionsClass!}"> <div id="kc-form-options" class="${properties.kcFormOptionsClass!}">
<div class="${properties.kcFormOptionsWrapperClass!}"> <div class="${properties.kcFormOptionsWrapperClass!}">
<span><a href="${url.loginUrl}">${msg("backToLogin")}</a></span> <span><a href="${url.loginUrl}">${msg("backToLogin")?no_esc}</a></span>
</div> </div>
</div> </div>

View file

@ -66,7 +66,7 @@
<#if message.type = 'warning'><span class="${properties.kcFeedbackWarningIcon!}"></span></#if> <#if message.type = 'warning'><span class="${properties.kcFeedbackWarningIcon!}"></span></#if>
<#if message.type = 'error'><span class="${properties.kcFeedbackErrorIcon!}"></span></#if> <#if message.type = 'error'><span class="${properties.kcFeedbackErrorIcon!}"></span></#if>
<#if message.type = 'info'><span class="${properties.kcFeedbackInfoIcon!}"></span></#if> <#if message.type = 'info'><span class="${properties.kcFeedbackInfoIcon!}"></span></#if>
<span class="kc-feedback-text">${message.summary}</span> <span class="kc-feedback-text">${message.summary?no_esc}</span>
</div> </div>
</div> </div>
</#if> </#if>

View file

@ -6,7 +6,7 @@
${msg("termsTitleHtml")} ${msg("termsTitleHtml")}
<#elseif section = "form"> <#elseif section = "form">
<div id="kc-terms-text"> <div id="kc-terms-text">
${msg("termsText")} ${msg("termsText")?no_esc}
</div> </div>
<form class="form-actions" action="${url.loginAction}" method="POST"> <form class="form-actions" action="${url.loginAction}" method="POST">
<input class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonLargeClass!}" name="accept" id="kc-accept" type="submit" value="${msg("doAccept")}"/> <input class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonLargeClass!}" name="accept" id="kc-accept" type="submit" value="${msg("doAccept")}"/>

View file

@ -11,7 +11,7 @@
<#if referrer??> <#if referrer??>
var referrer = '${referrer}'; var referrer = '${referrer}';
var referrer_uri = '${referrer_uri?html}'; var referrer_uri = '${referrer_uri}';
</#if> </#if>
<#if msg??> <#if msg??>