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

Support PHP 7.3 and 7.4 #17

Closed
bobbingwide opened this issue Feb 7, 2017 · 2 comments
Closed

Support PHP 7.3 and 7.4 #17

bobbingwide opened this issue Feb 7, 2017 · 2 comments
Assignees

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Feb 7, 2017

Changes in PHP 7.1 mean that some logic which worked without problems under PHP 7 and earlier now issue Notices, Warnings Errors and even Fatal errors.

In the code for the [bw_post] and [bw_page] shortcodes we get Warning: Illegal string offset 'post_type' from the following code construct.

function bw_post( $atts=null, $content=null, $tag=null ) {
  $atts['post_type'] = bw_array_get_from( $atts, "post_type,0", "post" ); 

The code assumes that $atts is passed as an array or can be handled as an array.
When no parameters are set on the shortcode then $atts is passed as null.
The warning is issued from the assignment.

Many WordPress shortcodes avoid this issue by using shortcode_atts(), which casts the $atts parameter to an array. We might be able to find a solution by changing bw_shortcode_event, in oik.

@bobbingwide bobbingwide self-assigned this Feb 7, 2017
@bobbingwide bobbingwide changed the title Support PHP 7.1 Support PHP 7.1 thru 7.4 Dec 2, 2019
@bobbingwide bobbingwide changed the title Support PHP 7.1 thru 7.4 Support PHP 7.3 and 7.4 Dec 2, 2019
@bobbingwide
Copy link
Owner Author

Well, PHP 7.1's out of support now so let's just make it 7.3 and 7.4

Message issued with PHP 7.4
Notice: Trying to access array offset on value of type null
in C:\apache\htdocs\wordpress\wp-content\plugins\oik-bob-bing-wide\shortcodes\oik-csv.php
on line 153

@bobbingwide
Copy link
Owner Author

V1.34.0 has now been released to oik-plugins.com and tested with PHP 7.3 and PHP 7.4. This can now be closed.

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

No branches or pull requests

1 participant