Breaks any REST API request using array items
-
Since WP 5.3.1 update we have had many reports of our API not working in some cases. I traced this back to Ninja Forms which when active shows PHP warnings in the REST API response, these unfortunately for some users are even showing with WP_DEBUG set to false.
The root cause is in your plugin file: /includes/MergeTags/Other.php line 54
$value = wp_kses_post( $value );
You are not checking if the value is an array first. Any i’m not sure you even need to run this on the API requests?
To replicate:
1. Turn on WP_DEBUG to true (not needed in some cases)
2. Have Ninja Forms installed and active
3. Visit a API url with a array value eg: /wp-json/?test[]=123Result:
<b>Warning</b>: preg_match() expects parameter 2 to be string, array givenPlease fix and release this ASAP.
Thanks,
Stiofan
- The topic ‘Breaks any REST API request using array items’ is closed to new replies.