-
Notifications
You must be signed in to change notification settings - Fork 566
Closed
Description
Expected Behavior:
Data is saved, and retrieved as entered
Actual Behavior:
If the following data is entered into a text field:
[{"content":"This is a \"some\" content"}]
What will be saved, and retrieved out of the database when accessed is:
[{"content":"This is a "some" content"}]
Note that slashes have been over-zealously removed. The data should be retrieved as-is without modification.
Steps to reproduce (I have confirmed I can reproduce this issue on the trunk branch):
- Register a standard text field, e.g. as per the example.
$cmb_demo->add_field( array(
'name' => esc_html__( 'Test Text', 'cmb2' ),
'desc' => esc_html__( 'field description (optional)', 'cmb2' ),
'id' => $prefix . 'text',
'type' => 'text',
) );
- Enter the following into the field:
[{"content":"This is a \"some\" content"}]
- Save the entity. Note that what gets stored, and retrieved is:
[{"content":"This is a "some" content"}]
instead of
[{"content":"This is a \"some\" content"}]
Note: While I've reported this as an issue with the "text" type, the original bug I observed was with a custom field, within a repeatable group, so any fix probably needs to be generic across all field types, not just text.
Metadata
Metadata
Assignees
Labels
No labels