Hi,
Here the quick'n dirty script I made to loop through the post and remove the cdata.
Use at your own risk (ie: backup your data before).
#!/usr/bin/env ruby
require 'mysql2'
host = 'localhost'
username = 'mydbusername'
password = 'mydbpassword'
database = 'mydbname'
client = Mysql2::Client.new(:host => host,
:username => username,
:password => password,
:database => database)
posts = client.query("select * from flarum_posts")
posts.each do |p|
content = p['content']
r = /<!-- .+ -->/
if r =~ content
puts " MATCH: #{p['id']}"
new_content = content.gsub(r,'') # remove the cdata
new_content = new_content.gsub("'","''") # escape the quotes
client.query("update flarum_posts set content='#{new_content}' where id=#{p['id']}")
end
end