Closed madsad87 closed 4 years ago
Thank you for this helpful report, @madsad87. We'll look into a fix this week.
Seems to relate to this ticket in WP core: https://core.trac.wordpress.org/ticket/48955
WP 5.3.1 changes cause potential backwards compatibility breakage with kses
Changing wp_kses
to wp_kses_post_deep
in includes/class-agentpress-listings.php
fixes it:
-$property_details = array_map( 'wp_kses', array( wp_unslash( $_POST['ap'] ) ), array( $this->allowed_tags ) );
+$property_details = array_map( 'wp_kses_post_deep', array( wp_unslash( $_POST['ap'] ) ), array( $this->allowed_tags ) );
But this will need further testing, and we also need to check other usages of wp_kses
under WP 5.3.1.
Edit: we can't just switch to wp_kses_post_deep
here because we can't pass it the $allowed_html
param.
Also noting that the issue appears to be that the field is reverted to the original state (the edit is lost), rather than the field clearing. (i.e. This bug does not appear to destroy original data, only the edit. It has the effect of clearing the field if it had nothing in to begin with, though.)
I have a fix in a pull request here: https://github.com/studiopress/agentpress-listings/pull/48
I'll work with our team to schedule testing and release.
Describe the bug In 1.3.2 and 1.3.3, while on WP Core 5.3.1 content entered into the Property Details input boxes:
To Reproduce Steps to reproduce the behavior:
Expected behavior The modified fields will be cleared after saving.
Video Replication https://www.loom.com/share/ea0ce018108942268f06c3ccf11afbb1
Screenshot
Version
Device and browser information
Reported at https://wordpress.org/support/topic/agentpress-listings-plugin-error-when-upgrading-wordpress-5-3-1/