-
-
Notifications
You must be signed in to change notification settings - Fork 506
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
Fixes strpos for php 7.3 #1915
Fixes strpos for php 7.3 #1915
Conversation
Adding |
Just leaving this here to test later:
|
lib/ImageHelper.php
Outdated
@@ -328,7 +328,7 @@ protected static function process_delete_generated_files( $filename, $ext, $dir, | |||
*/ | |||
public static function get_server_location( $url ) { | |||
// if we're already an absolute dir, just return | |||
if ( 0 === strpos($url, ABSPATH) ) { | |||
if ( 0 === strpos($url, chr(ABSPATH)) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this chr()
should be here either?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saw that too - pushed fix already. Thanks.
Codecov Report
@@ Coverage Diff @@
## master #1915 +/- ##
============================================
- Coverage 95.01% 93.65% -1.36%
- Complexity 1553 1554 +1
============================================
Files 48 48
Lines 3669 3672 +3
============================================
- Hits 3486 3439 -47
- Misses 183 233 +50
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1915 +/- ##
============================================
- Coverage 95.01% 94.98% -0.03%
- Complexity 1554 1555 +1
============================================
Files 48 48
Lines 3669 3672 +3
============================================
+ Hits 3486 3488 +2
- Misses 183 184 +1
Continue to review full report at Codecov.
|
@jarednova I'm looking at the Travis test results and don't quite understand all the errors. I think that the problem is mostly caused by WP 4.7.9 + PHP 7.3 not the fix itself. Do you have any idea how to fix those bugs? |
@palmiak according to this post on WordPress and PHP 7.3, they aimed for full 7.3 support in the next release, which at that time would have been 5.0. Because 4.7.x gets us to +80% in WP version support I'd like to take an honest whack at this one and see what happens if we go up to 4.7.12 for the 4.7 version we test against. Let's see what that does .... |
@jarednova 4.7.12 didn't changed anything 😞 We can assume that 4.7.* won't be compatible with 7.3. Can we remove just the tests for 4.7 + php 7.3 because they'll always give us error. |
Yeah, it appears the WordPress gods have not smiled upon us. I'd like to still test against a "lower" WP version so I just upped that to 4.8.x to see if that makes Travis happy |
Ended up going back down to WP 4.7.12 but excluding PHP 7.3 for that combo. All tests are good now! |
Ticket: #1899
Issue
Problem with php 7.3 and strpos - described in ticket.
Solution
As stated in PHP docs:
so I added the
chr
function.Impact
None.
Usage Changes
None
Considerations
Testing