mirror of
https://github.com/i2p/i2p.i2p.git
synced 2024-12-06 19:27:00 +01:00
Console: Trim inputs on search form
This commit is contained in:
@@ -74,43 +74,43 @@ public class NetDbHelper extends FormHandler {
|
||||
|
||||
public void setRouter(String r) {
|
||||
if (r != null && r.length() > 0)
|
||||
_routerPrefix = DataHelper.stripHTML(r); // XSS
|
||||
_routerPrefix = DataHelper.stripHTML(r.trim()); // XSS
|
||||
}
|
||||
|
||||
/** @since 0.9.21 */
|
||||
public void setVersion(String v) {
|
||||
if (v != null && v.length() > 0)
|
||||
_version = DataHelper.stripHTML(v); // XSS
|
||||
_version = DataHelper.stripHTML(v.trim()); // XSS
|
||||
}
|
||||
|
||||
/** @since 0.9.21 */
|
||||
public void setCountry(String c) {
|
||||
if (c != null && c.length() > 0)
|
||||
_country = DataHelper.stripHTML(c); // XSS
|
||||
_country = DataHelper.stripHTML(c.trim()); // XSS
|
||||
}
|
||||
|
||||
/** @since 0.9.28 */
|
||||
public void setFamily(String c) {
|
||||
if (c != null && c.length() > 0)
|
||||
_family = DataHelper.stripHTML(c); // XSS
|
||||
_family = DataHelper.stripHTML(c.trim()); // XSS
|
||||
}
|
||||
|
||||
/** @since 0.9.28 */
|
||||
public void setCaps(String c) {
|
||||
if (c != null && c.length() > 0)
|
||||
_caps = DataHelper.stripHTML(c); // XSS
|
||||
_caps = DataHelper.stripHTML(c.trim()); // XSS
|
||||
}
|
||||
|
||||
/** @since 0.9.28 */
|
||||
public void setIp(String c) {
|
||||
if (c != null && c.length() > 0)
|
||||
_ip = DataHelper.stripHTML(c); // XSS
|
||||
_ip = DataHelper.stripHTML(c.trim()); // XSS
|
||||
}
|
||||
|
||||
/** @since 0.9.28 */
|
||||
public void setSybil(String c) {
|
||||
if (c != null)
|
||||
_sybil = DataHelper.stripHTML(c); // XSS
|
||||
_sybil = DataHelper.stripHTML(c.trim()); // XSS
|
||||
}
|
||||
|
||||
/** For form, same as above but with a length check
|
||||
@@ -118,7 +118,7 @@ public class NetDbHelper extends FormHandler {
|
||||
*/
|
||||
public void setSybil2(String c) {
|
||||
if (c != null && c.length() > 0)
|
||||
_sybil = DataHelper.stripHTML(c); // XSS
|
||||
_sybil = DataHelper.stripHTML(c.trim()); // XSS
|
||||
}
|
||||
|
||||
/** @since 0.9.28 */
|
||||
@@ -151,13 +151,13 @@ public class NetDbHelper extends FormHandler {
|
||||
/** @since 0.9.28 */
|
||||
public void setMtu(String f) {
|
||||
if (f != null && f.length() > 0)
|
||||
_mtu = DataHelper.stripHTML(f); // XSS
|
||||
_mtu = DataHelper.stripHTML(f.trim()); // XSS
|
||||
}
|
||||
|
||||
/** @since 0.9.28 */
|
||||
public void setIpv6(String f) {
|
||||
if (f != null && f.length() > 0) {
|
||||
_ipv6 = DataHelper.stripHTML(f); // XSS
|
||||
_ipv6 = DataHelper.stripHTML(f.trim()); // XSS
|
||||
if (!_ipv6.endsWith(":"))
|
||||
_ipv6 = _ipv6 + ':';
|
||||
}
|
||||
@@ -166,7 +166,7 @@ public class NetDbHelper extends FormHandler {
|
||||
/** @since 0.9.28 */
|
||||
public void setSsucaps(String f) {
|
||||
if (f != null && f.length() > 0)
|
||||
_ssucaps = DataHelper.stripHTML(f); // XSS
|
||||
_ssucaps = DataHelper.stripHTML(f.trim()); // XSS
|
||||
}
|
||||
|
||||
/** @since 0.9.36 */
|
||||
|
||||
Reference in New Issue
Block a user