Skip to content
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

Merged
merged 1 commit into from Oct 1, 2018
Merged

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Oct 1, 2018

aims to fix #13507 (comment)

@sgiehl sgiehl added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Oct 1, 2018
@sgiehl sgiehl added this to the 3.6.1 milestone Oct 1, 2018
@diosmosis
Copy link
Member

Can a test be added to UsersManager/tests/Integration/APITest.php?

* @return array the list of all the users
*/
public function getUsers($userLogins = '')
{
Piwik::checkUserHasSomeAdminAccess();

$logins = array();
if (!empty($userLogins)) {

if (is_array($userLogins)) {
Copy link
Member

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)

Copy link
Member Author

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

Copy link
Member

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 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. changed it.

@diosmosis diosmosis merged commit 9aa0f13 into 3.x-dev Oct 1, 2018
@diosmosis diosmosis deleted the userapi branch October 1, 2018 23:05
InfinityVoid pushed a commit to InfinityVoid/matomo that referenced this pull request Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error message in various places when invalid parameters are used
3 participants