Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Fixes #12 : use false result check at stmt->fetchObject() to handle username not found data ( auth failure ) #13

Merged
merged 5 commits into from
Jan 16, 2018

Conversation

samsonasik
Copy link
Contributor

@samsonasik samsonasik commented Jan 12, 2018

This fixes a bug that occurs when the user provides an incorrect username (username not found in DB); currently, it generates the error "Trying to get property of non-object".

The error occurs due to incorrectly checking for a false result from a $stmt->execute() call; this should happen against a later $stmt->fetchObject() call instead.

@samsonasik samsonasik changed the title Fixes #12 : use false result check at stmt->fetchObject() to handle not found data ( auth failure ) Fixes #12 : use false result check at stmt->fetchObject() to handle username not found data ( auth failure ) Jan 12, 2018
@samsonasik
Copy link
Contributor Author

samsonasik commented Jan 12, 2018

I've added test that demonstrates the bug, and proves the fix for invalid username ( no username found in db).

@weierophinney weierophinney merged commit bd06cb7 into zendframework:master Jan 16, 2018
weierophinney added a commit that referenced this pull request Jan 16, 2018
Fixes #12 : use false result check at stmt->fetchObject() to handle username not found data ( auth failure )
weierophinney added a commit that referenced this pull request Jan 16, 2018
weierophinney added a commit that referenced this pull request Jan 16, 2018
weierophinney added a commit that referenced this pull request Jan 16, 2018
Forward port #13

Conflicts:
	CHANGELOG.md
@weierophinney
Copy link
Member

Thanks, @samsonasik; nice patch!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants