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

PHP 7.4 Deprecations #5891

Merged
merged 7 commits into from Jan 8, 2020
Merged

Conversation

jdarwood007
Copy link
Member

This will need some testing because it changes a lot of curly braces usage.

This will fix #5888 when merged

@jdarwood007
Copy link
Member Author

jdarwood007 commented Dec 14, 2019

SMF 2.0 has a lot of these as well.
Also I used this to locate and replace the curly braces:
Search: $([A-Za-z0-9_]+){$([A-Za-z0-9]+)}
Replace: $\1[$\2]

Also searched for and found a few more: $([A-Za-z0-9_]+){

… graphics in PHP, that images failed to load. This is because of two reasons.

1. The folder name must match the same file name with the .gdf
2. The files in the folder are all upper case.
@ghost
Copy link

ghost commented Dec 15, 2019

Another thing :

Trying to access array offset on value of type bool

/Sources/Subs-Attachments.php (Line 516)

@ghost
Copy link

ghost commented Dec 18, 2019

if (isset($context['valid_image_types'][$size[2]]))

No idea how to re-rewrite it in a PHP 7.4 compatible way.

Also I'm running this PR on my forum.

@jdarwood007
Copy link
Member Author

I won't have time till the weekend to look at that but where is that? Thats valid code and not deprecated.

@ghost
Copy link

ghost commented Dec 20, 2019

I won't have time till the weekend to look at that but where is that? Thats valid code and not deprecated.

/Sources/Subs-Attachments.php (Line 516)

With the following PHP error generated :

Trying to access array offset on value of type bool

… for PHP 7.4 or higher.

Sometimes getimagesize can return false, handle that
@ghost
Copy link

ghost commented Dec 30, 2019

One more :

/Sources/ManageErrors.php (Line 168)
Trying to access array offset on value of type null

@jdarwood007
Copy link
Member Author

This was already fixed in another PR. Update your stuff.

As well merge this PR into your code if your testing PHP 7.4. It should be compatible.

@ghost
Copy link

ghost commented Jan 2, 2020

main branch + this, is that what was required ?

Done anyway, only seeing approve_query message now. (php error)

@Sesquipedalian
Copy link
Member

Is this ready to merge, @jdarwood007?

@albertlast
Copy link
Collaborator

For porpuse of testing would be this pr very important,
got many depraction "notice".

@albertlast
Copy link
Collaborator

Run this command

forfiles /s /p F:\github\SMF2.1\ /m *.php /c "cmd /c D:\Programme\wamp64\bin\php\php7.4.1\php.exe -l @file" > 7.4.check.txt

result is that no syntax error was found.

When i do vs the main i found many depracted notice

@jdarwood007
Copy link
Member Author

@Sesquipedalian It is other than the possible issue reported by the deleted account. I haven't verified it. But this could merge knowing that and give us time to test it more.

@mobasuite
Copy link

Type of error: Undefined
8: Undefined variable: approve_query https://mobasuite.com/forum/index.php?action=search2
/home/lolupdat/public_html/forum/Sources/Search.php (Line 1715)

@albertlast
Copy link
Collaborator

this was not touched by this pr

@mobasuite
Copy link

@albertlast

True, just notifying.

@MissAllSunday
Copy link
Contributor

Will go ahead and merge, we still have time to do more testing

@MissAllSunday MissAllSunday merged commit 984fdc4 into SimpleMachines:release-2.1 Jan 8, 2020
@jdarwood007 jdarwood007 deleted the php74 branch January 18, 2020 21:51
@jdarwood007 jdarwood007 restored the php74 branch October 15, 2020 23:08
@jdarwood007 jdarwood007 deleted the php74 branch October 15, 2020 23:08
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.

Tons of errors with PHP 7.4
5 participants