New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve parameter handling in UsersManager.getUsers #13515
Conversation
Can a test be added to UsersManager/tests/Integration/APITest.php? |
plugins/UsersManager/API.php
Outdated
* @return array the list of all the users | ||
*/ | ||
public function getUsers($userLogins = '') | ||
{ | ||
Piwik::checkUserHasSomeAdminAccess(); | ||
|
||
$logins = array(); | ||
if (!empty($userLogins)) { | ||
|
||
if (is_array($userLogins)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or should we just fail if userLogins is not a string? In theory you may be able to send now some weird array structures to maybe cause an error? (haven't tested, just a thought)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't have a strong opinion on that. failing if no string is given works as well for sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets do this to keep things simple 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. changed it.
aims to fix #13507 (comment)