[Plugin: More Fields] Saved export breaks if select list contains apostrope
-
I set up my fields and then exported them to help troubleshoot an unrelated issue. Once I saved the export, I could not go back in and export another set of fields. I found that if a select list contains an apostrophe (‘), the object can’t be deserialized. When exporting, the code needs to escape this character. Sample excerpt follows:
{s:5:”label”;s:6:”Server”;s:3:”key”;s:6:”server”;s:4:”slug”;s:0:””;s:10:”field_type”;s:6:”select”;s:6:”values”;s:69:”Alpha, Bravo, Charlie, Delta, Echo, Al’co, Br’co, Ch’co, De’co, Ec’co”;
That will break if saved as part of an export to a file. The following will not break:
{s:5:”label”;s:6:”Server”;s:3:”key”;s:6:”server”;s:4:”slug”;s:0:””;s:10:”field_type”;s:6:”select”;s:6:”values”;s:69:”Alpha, Bravo, Charlie, Delta, Echo, Al\’co, Br\’co, Ch\’co, De\’co, Ec\’co”;
I’m not sure what needs to be done with the s:69 character count once escapes are added. I suspect it need not change, but some testing around that would be good.
- The topic ‘[Plugin: More Fields] Saved export breaks if select list contains apostrope’ is closed to new replies.