Support » Plugin: Meta Box - WordPress Custom Fields Framework » 5.1 seems to break HTML in textarea metabox

  • Resolved conartstudio

    (@conartstudio)


    I updated to 5.1 this morning and found a bug. I was updating a post that I created a custom textarea metabox for and only plain text is being saved, HTML text is not being saved. I added HTML into the textarea and after updating the post, the HTML content that was just added in the textarea disappeared. I tried again and same result. I then just entered plain text and that saved fine. It seems that if you add HTML to a textarea metabox in version 5.1 the content will get deleted when you update the post.

    I rolled back to version 5.0 and it is working as usual.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Anh Tran

    (@rilwis)

    Hi @conartstudio ,

    We implemented a sanitization for all inputs. But for textarea, we’re using “wp_kses_post” as the sanitize callback. It accepts HTML as in the post content.

    Do you enter scripts and styles to the textarea? If yes, then you can bypass the sanitization by setting:

    'sanitize_callback' => 'none'

    for the field.

    eddyg93

    (@eddyg93)

    Same thing to me, fortunately I noticed it in time, otherwise you would lose more than 48 hours of work.

    I also had to go back to 5.0 because this problem does not happen.

    conartstudio

    (@conartstudio)

    @eddyg93, use the sanitize callback solution above. Fixes the issue.

    conartstudio

    (@conartstudio)

    @rilwis, thank you!

    eddyg93

    (@eddyg93)

    @conartstudio
    I really don’t know what it is, in fact even looking online I didn’t really understand Anh Tran’s comment, even with the help of a friend who works with wordpress.
    In the end I put the 5.0 and solved the problem.

    Plugin Author Anh Tran

    (@rilwis)

    @eddyg93 Maybe this blog post explains the sanitization better:

    https://metabox.io/meta-box-510/

    Also, this is the documentation regrading this issue:

    https://docs.metabox.io/sanitization/

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.