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

Cast $count from string to int #5

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Cast $count from string to int #5

wants to merge 4 commits into from

Conversation

dejdav
Copy link

@dejdav dejdav commented Apr 3, 2019

Hi, I noticed that the ResultStatement::fetchColumn() function returns either a string or a boolean but the return value is compared with === 0 in the code which requires the variable to be an integer (as 0 == '0' evaluates to true but 0 === '0' evaluates to false in PHP). Therefore i suggest casting the $count variable from string to int. Otherwise it is impossible to create a new backend user on the client TYPO3 instance because the SQL INSERT statement is never executed. In order to reproduce this issue simply delete the backend user on the client TYPO3 instance and try to log in as that user once again. The T3AM authentication will not work because the backend user is not inserted into the be_users table. I referenced the relevant code line below.

if (0 === $count) {

@dejdav
Copy link
Author

dejdav commented Apr 3, 2019

I would be glad if you could publish a new release that includes this pull request.

@dejdav
Copy link
Author

dejdav commented Apr 10, 2019

Hi, I fixed another issue in commit dcb7898. The callback function ($applicant) takes two parameters but is only called with one parameter in the array_map function. I extracted the $session variable from the callback function and put it into a use statement to fix the issue.

Copy link
Contributor

@sbusemann sbusemann left a comment

Choose a reason for hiding this comment

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

@vertexvaar is there a reason, why we did not use the TYPO3 API?

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

Successfully merging this pull request may close these issues.

2 participants