maximeschoeni / sublanguage

Multilanguage plugin for wordpress
42 stars 13 forks source link

fix malformed post content in main language post when saving a sublanguage #9

Closed achronos0 closed 7 years ago

achronos0 commented 7 years ago

In Sublanguage_admin::insert_post, the main language post data is loaded from db and restored to post array so WP will save the original main language content.

However, this replaced post data is not escaped (wp_slash/wp_unslash). Since WP expects to receive escaped data back, when it later calls wp_unslash, the original content is damaged. (This is especially bad if the post content isn't HTML but is, say, JSON.)

maximeschoeni commented 7 years ago

Thanks for your help!