You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some code that checks the supplied username+password when accessing this area of the API is failing when supplied with "0" for the user id. (Other file operations like create/rename/delete are working)
There are places in lib/private/user/Session.php that do stuff like:
if (!empty($request->server['PHP_AUTH_USER']) && ...
which will not do the expected code when the user is "0".
And possibly quite a few other places where the user id is used and checked.
I came across this because I was testing the case when the user id is a string of digits "123". That seems to work, and I guess there are installations out there that will use an integer as a user id (maybe a University that uses a student number directly as the user id? or...)
I tried "0" and it has problems - which will be due to the pain of empty("0") === true in PHP and similar.
Actually should "0" just be declared not a valid user id (reject it when adding a user)?
yeah, we need to find all of those places anyway... we're already trying to avoid such problems in new code but there is likely old code still doing the checks wrong... thank you PHP for empty('0') === true ...
Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.
Activity
phil-davis commentedon Jul 17, 2017
I came across this because I was testing the case when the user id is a string of digits "123". That seems to work, and I guess there are installations out there that will use an integer as a user id (maybe a University that uses a student number directly as the user id? or...)
I tried "0" and it has problems - which will be due to the pain of empty("0") === true in PHP and similar.
Actually should "0" just be declared not a valid user id (reject it when adding a user)?
hodyroff commentedon Jul 18, 2017
should be fixed - if not too difficult.
PVince81 commentedon Sep 7, 2017
yeah, we need to find all of those places anyway... we're already trying to avoid such problems in new code but there is likely old code still doing the checks wrong... thank you PHP for
empty('0') === true...phil-davis commentedon Oct 10, 2017
#29198 requires usernames to be 3 or more chars. So that would "fix" (=workaround) this particular issue.
ownclouders commentedon Dec 19, 2017
Hey, this issue has been closed because the label
status/STALEis set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.phil-davis commentedon Dec 20, 2017
Username cannot be "0" any more. So the particular issue reported here is avoided. Leaving closed.
lock commentedon Jul 30, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.