diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index f44396c..5ec4258 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -1149 \ No newline at end of file +1159 \ No newline at end of file diff --git a/Common/dataobjects/User.cs b/Common/dataobjects/User.cs index 12c741b..a9b82cf 100644 --- a/Common/dataobjects/User.cs +++ b/Common/dataobjects/User.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, diff --git a/IISMainHandler/handlers/request/UserDataHandler.cs b/IISMainHandler/handlers/request/UserDataHandler.cs index 6e51d5a..ed7756d 100644 --- a/IISMainHandler/handlers/request/UserDataHandler.cs +++ b/IISMainHandler/handlers/request/UserDataHandler.cs @@ -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);