diff --git a/src/controllers/User/Update.php b/src/controllers/User/Update.php index b8d65f2b..916d1b56 100644 --- a/src/controllers/User/Update.php +++ b/src/controllers/User/Update.php @@ -188,9 +188,13 @@ public function &run(Router &$router, View &$view, array &$args) { // biography change request - $model->profile->setBiography($model->biography); - $model->biography_error = ['green', 'CHANGE_SUCCESS']; - $profile_changed = true; + if (strlen($model->biography) > $model->biography_max_len) { + $model->biography_error = ['red', 'TOO_LONG']; + } else { + $model->profile->setBiography($model->biography); + $model->biography_error = ['green', 'CHANGE_SUCCESS']; + $profile_changed = true; + } } diff --git a/src/templates/User/Update.phtml b/src/templates/User/Update.phtml index 65edc967..d1e91848 100644 --- a/src/templates/User/Update.phtml +++ b/src/templates/User/Update.phtml @@ -60,8 +60,8 @@ switch ($this->getContext()->display_name_error[1]) { switch ($this->getContext()->biography_error[1]) { case null: case '': $biography_error = ''; break; - case 'CHANGE_FAILED': - $biography_error = 'Failed to change biography.'; break; + case 'TOO_LONG': + $biography_error = 'Your biography is too long.'; break; case 'CHANGE_SUCCESS': $biography_error = 'Your biography was updated.'; break; default: