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 Compatibility Issues #4346

Closed
bhubbard opened this issue Jul 8, 2016 · 18 comments
Closed

PHP 7 Compatibility Issues #4346

bhubbard opened this issue Jul 8, 2016 · 18 comments
Labels
[Feature] Markdown General [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Type] Good First Bug

Comments

@bhubbard
Copy link
Contributor

bhubbard commented Jul 8, 2016

I ran the PHP Compatibility Checker Plugin, expected to pass, got the following errors:

FILE: /wp-content/plugins/jetpack/_inc/lib/markdown/extra.php
--------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------------------------
 1739 | ERROR | Using a call-time pass-by-reference is prohibited since php 5.4
 2329 | ERROR | Using a call-time pass-by-reference is prohibited since php 5.4
 2439 | ERROR | Using a call-time pass-by-reference is prohibited since php 5.4
 2499 | ERROR | Using a call-time pass-by-reference is prohibited since php 5.4
 2505 | ERROR | Using a call-time pass-by-reference is prohibited since php 5.4
--------------------------------------------------------------------------------------------------


FILE: /wp-content/plugins/jetpack/class.jetpack.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
 30 | ERROR | Global variable 'HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0 - use php://input instead.
------------------------------------------------------------------------------------------------------------------------------------
@jeherve jeherve added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it General [Feature] Markdown labels Jul 8, 2016
@jeherve
Copy link
Member

jeherve commented Jul 8, 2016

The Markdown errors might be false positives. See this issue in the original Markdown Extra library to find out more:
michelf/php-markdown#163

We could probably switch to php://input though. We already use it in on other places in that file.

@lezama What's your take on this?

@jeherve jeherve added this to the 4.2 milestone Jul 8, 2016
@lezama
Copy link
Contributor

lezama commented Jul 9, 2016

We could probably switch to php://input though. We already use it in on other places in that file.

@lezama What's your take on this?

Probably a good idea, I don't understand how we didn't get complaints from users running PHP7

@jeherve
Copy link
Member

jeherve commented Jul 11, 2016

I don't understand how we didn't get complaints from users running PHP7

I'm not sure. This never generated any warnings or errors for me.

@danielbachhuber
Copy link
Contributor

FYI - HTTP_RAW_POST_DATA is also used in Jetpack_Signature, which seems like it could be a problem.

@jeherve jeherve modified the milestones: 4.3, 4.2 Jul 22, 2016
@richardmuscat richardmuscat modified the milestones: 4.3, 4.3.1 Jul 26, 2016
@samhotchkiss samhotchkiss modified the milestones: 4.3.2, 4.3.1 Sep 2, 2016
@dereksmart dereksmart modified the milestones: 4.3.1, 4.3.2 Sep 6, 2016
@jeherve jeherve modified the milestones: 4.4, 4.3.2 Oct 12, 2016
@jeherve jeherve modified the milestones: Not Currently Planned, 4.4 Nov 16, 2016
@aheckler
Copy link
Member

3056104-t going to have him downgrade to see what happens

@aheckler
Copy link
Member

Downgrading did fix the problem for the user in 3056104-t

@o6asan
Copy link

o6asan commented Mar 23, 2017

I'm the user in 3056104-t.
I still use PHP7.0.x now because 7.0.x gives no error.
Even if I use PHP7.1.x, there is no error when I disabled OPCache. The information about a few incompatibilities on servers using OPCache was brought to me by jeherve.

But, disabling OPCache is not good for my server. Have anyone had any progress on this particular error?

@jeherve
Copy link
Member

jeherve commented Mar 27, 2017

The information about a few incompatibilities on servers using OPCache was brought to me by jeherve.

This should be fixed with #6565. @o6asan Would you mind giving that patch a try and let us know there if it works?

Thanks!

@jeherve
Copy link
Member

jeherve commented Mar 27, 2017

Master issue: #6106

@jeherve jeherve removed this from the Not Currently Planned milestone Mar 27, 2017
@o6asan
Copy link

o6asan commented Mar 28, 2017

@jeherve
Unfortunately, #6565 did not work well for me. I had the same error on the log of PHP7.1.3 with Jetpack4.7.1 and new jetpack-related-posts.php.

@jeherve
Copy link
Member

jeherve commented Mar 28, 2017

@o6asan Thanks for giving it a try. We'll get back to you via email to run some more tests!

@o6asan
Copy link

o6asan commented Apr 12, 2017

@jeherve
Today, I updated PHP to 7.1.4 which includes the fixes of https://bugs.php.net/bug.php?id=74213. I already have Jetpack4.8.2 which merged #6565. Under them, I don't have the error anymore.
I enabled the feature Related Posts and it works well.
Thanks so much.

@navjotjsingh
Copy link

PHP Compatibility plugin is again showing following errors regarding PHP 7 Compatibility.

FILE: /var/www/html/wp-content/plugins/jetpack/modules/markdown/easy-markdown.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------
 654 | ERROR | Global variable '$HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead
 655 | ERROR | Global variable '$HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead
 656 | ERROR | Global variable '$HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead
 660 | ERROR | Global variable '$HTTP_RAW_POST_DATA' is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead
------------------------------------------------------------------------------------------------------------------------------------

@kraftbj
Copy link
Contributor

kraftbj commented Jun 25, 2018

Closing this to focus on #9818 as a final task for general PHP 7 compat.

@kraftbj kraftbj closed this as completed Jun 25, 2018
@zinigor
Copy link
Member

zinigor commented Jun 26, 2018

@navjotjsingh thanks for the report! Just for the record: these are false positives. We can not remove every HTTP_RAW_POST_DATA entry from our code because we need to make sure it's PHP 5.2 compatible. Instead we are making sure we are using it in a way that is backwards compatible. This is why compatibility plugins that do not analyze code, but instead match by substrings will always report these. It's fine, you can ignore these matches.

Edit: actually, disregard the above, #9818 looks valid.

@angelatwin333
Copy link

@o6asan . Sorry to bother you! I couldn't find any other way to reach you, not even through your BBS contact (NetOwl security blocked me from commenting there). Your website is down. I can't access your translation for Hyohaku anymore. Or for any domains titled o6asan. It says ERR_ADDRESS_UNREACHABLE. I didn't save your email address either, and since it was on said website, I couldn't email you either, hence I am contacting you here.

At first I thought the issue was with my server, but I realized it would happen regardless of device, browser of computers. I had a bunch of classmates try it with their respective servers, internet, and devices too-issue's with your website. Would you mind fixing it so I can read Hyohaku please?

Again, sorry for hijacking this forum, I couldn't find any other way of contacting you since BBS and your website is down.

@o6asan
Copy link

o6asan commented Apr 26, 2024

@angelatwin333 ,
Thank you for informing me about my sites down. I had not noticed my web server down until my reading your letter. I fixed it. I think you can reach my sites now.

I apologize to everyone on this forum for our bothering.

@angelatwin333
Copy link

Thank you so, so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Markdown General [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Type] Good First Bug
Projects
None yet
Development

No branches or pull requests