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

Made it working with PHP 8 #22

Merged
merged 5 commits into from
Jan 21, 2023
Merged

Conversation

markussoeth
Copy link
Contributor

Patch for Issue #19

changed "each" to "foreach" to make it work with php 8
changed "each" to "foreach" to work with php 8
@FlashTVR
Copy link
Member

Thank you very much @markussoeth! Have you tested to make sure it continue to work under PHP7 and older installations of PHPBB?

@FlashTVR FlashTVR self-assigned this Jan 20, 2023
@markussoeth
Copy link
Contributor Author

Tried to get rid of the php 7.1 Test error. Had 2 whitespaces in the code. sorry

@markussoeth
Copy link
Contributor Author

It still worked for me under PHP 7 since the "foreach" function is available in PHP since PHP 4.
But I made a new pull request. Sorry, had two whitespace in the code. I changed that.

Testing with older phpbb installations I did not.
First: the changes only effects the php behavior not the phpbb behavior.
Second: the people should upgrade their installation to actually versions, even for security reasons. Or use a older version of this extension. Also older phpbb installations would not run under php8 so no need to test it there.

@FlashTVR FlashTVR merged commit 3799203 into TheVilleOrg:master Jan 21, 2023
@xchwarze
Copy link

@markussoeth @FlashTVR

I haven't deployed this version in my server yet, but seeing the diff of the change, I was wondering if this is the right way to do it:

[$id, ] = array_shift($action);

@markussoeth
Copy link
Contributor Author

I haven't deployed this version in my server yet, but seeing the diff of the change, I was wondering if this is the right way to do it:

[$id, ] = array_shift($action);

I don't know.
It works with the code I provided :-)
Give it a try and you will see.

But for me it seems to be a different between
each — Return the current key and value pair from an array and advance the array cursor
array_shift — Shift an element off the beginning of array

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

Successfully merging this pull request may close these issues.

3 participants