UserData size restriction:

main
Inga 🏳‍🌈 14 years ago
parent 63df1340ac
commit 05cb92e8ee
  1. 2
      Builder/IISMainHandler/build.txt
  2. 3
      Common/dataobjects/User.cs
  3. 8
      IISMainHandler/handlers/request/UserDataHandler.cs

@ -308,6 +308,9 @@ namespace FLocal.Common.dataobjects {
} }
public void UpdateData(UserData newData) { public void UpdateData(UserData newData) {
if(newData.location.Length > 30) throw new FLocalException("Location is too long");
if(newData.title.Length > 30) throw new FLocalException("Title is too long");
if(newData.signatureUbb.Length > 1024) throw new FLocalException("Signature is too long");
ChangeSetUtil.ApplyChanges( ChangeSetUtil.ApplyChanges(
new UpdateChange( new UpdateChange(
TableSpec.instance, TableSpec.instance,

@ -18,10 +18,10 @@ namespace FLocal.IISHandler.handlers.request {
protected override XElement[] Do(WebContext context) { protected override XElement[] Do(WebContext context) {
User.UserData newData = new User.UserData { User.UserData newData = new User.UserData {
location = context.httprequest.Form["location"], location = context.httprequest.Form["location"].Trim(),
title = context.httprequest.Form["title"], title = context.httprequest.Form["title"].Trim(),
signatureUbb = context.httprequest.Form["signature"], signatureUbb = context.httprequest.Form["signature"].Trim(),
biographyUbb = context.httprequest.Form["biography"], biographyUbb = context.httprequest.Form["biography"].Trim(),
}; };
context.account.user.UpdateData(newData); context.account.user.UpdateData(newData);

Loading…
Cancel
Save