fix update user for empty username#1857
fix update user for empty username#1857Frenzie merged 3 commits intoFreshRSS:devfrom kevinpapst:fix-update-user
Conversation
app/Controllers/userController.php
Outdated
|
|
||
| $username = Minz_Request::param('username'); | ||
| $ok = self::updateUser($username, $passwordPlain, $apiPasswordPlain, array( | ||
| if (!empty($username)) { |
There was a problem hiding this comment.
Would the check make more sense at the top of updateUser() itself? Perhaps similar issues could occur elsewhere.
if (empty($user) {
return false;
}There was a problem hiding this comment.
But then the user won't get the visible feedback (see below for the Minz_Request::bad() call).
Depends on the wanted behavior in a case where the user submits an empty form.
There was a problem hiding this comment.
I said updateUser(), ergo line 48. ;-)
(Not saying it's the way to go, but I definitely wasn't suggesting to avoid feedback.)
There was a problem hiding this comment.
Right, misunderstood your suggestion. Thats better, as the function is used from multiple places.
|
I have made a slight change, checking the user config object instead: 6fda584 |
|
Not much left of my changes hahaha but as |
Minor fix for the page
/i/?c=user&a=managewhere you could previously hit the Update button and get a 500 error:I added a minor validation to prevent that.