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) {
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(
new UpdateChange(
TableSpec.instance,

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

Loading…
Cancel
Save