* Console:

- Parameterize download button tags (ticket #425)
      - Clean up summary bar HTML warnings
      - Just display a summary bar link for text browsers
      - Move welcome div from the readme files to index.jsp
      - Require a nonce to change language
This commit is contained in:
zzz
2011-03-08 03:07:02 +00:00
parent f9b2c0bc63
commit b02fe536bc
24 changed files with 114 additions and 263 deletions

View File

@ -28,11 +28,13 @@ public class CSSHelper extends HelperBase {
return url;
}
/** change default language for the router but don't save it */
/** change default language for the router AND save it */
public void setLang(String lang) {
// TODO: Protect with nonce or require POST
if (lang != null && lang.length() == 2)
// Protected with nonce in css.jsi
if (lang != null && lang.length() == 2 && !lang.equals(_context.getProperty(Messages.PROP_LANG))) {
_context.router().setConfigSetting(Messages.PROP_LANG, lang);
_context.router().saveConfig();
}
}
/** needed for conditional css loads for zh */
@ -61,4 +63,13 @@ public class CSSHelper extends HelperBase {
.append("</title>");
return buf.toString();
}
/**
* Should we allow a refreshing IFrame?
* @since 0.8.5
*/
public boolean allowIFrame(String ua) {
return ua == null || !(ua.startsWith("Lynx") || ua.startsWith("w3m") ||
ua.startsWith("ELinks") || ua.startsWith("Dillo"));
}
}