• Resolved Faye

    (@fayewilliams)


    I was trying to update an old post but it would not save. The error message was:

    Updating failed. The response is not a valid JSON response.

    I have some example source code on my post and the line causing this issue is this one:

    FILE *f = fopen(“/proc/cpuinfo”,”w”);

    I managed to work around this by editing the post in the classic editor, where it updates with no issue. It also updates with no issue in Gutenberg if I remove the above line from the post. I’m guessing it’s tripping some kind of security check, but since I write example code in some of my posts, I thought I would share this in case anyone else runs into the same problem.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • It also updates with no issue in Gutenberg if I remove the above line from the post. I’m guessing it’s tripping some kind of security check, but since I write example code in some of my posts, I thought I would share this in case anyone else runs into the same problem.

    I’m unable to reproduce this.

    Test rig: Fresh WordPress 6.6.2 site with the default Twenty Twenty-Four theme and no plugin installed.

    I’m able to publish AND update the post with the full code using the Code block… without any issues.

    Here’s my test post: https://hopzipper.s3-tastewp.com/2024/09/13/testing-code/

    So it must be something specific to your local environment.

    Thread Starter Faye

    (@fayewilliams)

    Thank you for checking this for me. I guess it’s specific to my set up – I will see if I can work out what’s causing it.

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