Isn't this corrupting the data in my database?
Summary
can't handle the apostrophe. Which means contractions can't ever be used.
Expected Behaviour
can't SHOULD look like can't, won't SHOULD look like won't.
Actual Behaviour
All rendered, and approved comments are corrupt. Both within the web browser,as well as in the database. EXAMPLE (taken from the database):
Let's look at contractions again. Why can't I use contractions? Why won't they work. Aren't they supposed to work? Isn't this corrupting the data in my database?
ESCAPING the apostrophe (\') doesn't change the end result. It simply makes it worse:
won\'t
HOWEVER, this is not manifest in the admin area.
Context details (if applicable)
- Anchor version: anchor-cms 0.12.1
- Server setup: apache+PHP-5.3
- URL: http://localhost/blogs/
Hi there, what is your database setup? Have you set the right encoding?
This is a bug, even if bsdforge's setup is broken, this is still a problem introduced in bc202b52e08cd48c5cea0508c83bd40fb588a645. A pull request with a fix has been open for a while
@Bibliofile I didn't say it wasn't? I'm was trying to help @bsdforge with their problem
@daviddarnes
Thank you very much for the reply.
I'm using CHARSET=UTF8;
As my underlying OS has supported it well, for some time now, as has
the database && PHP. :-)
This works well for all my other database driven web (sites|apps). Does it not work
well for anchor-cms?
Thank you again, daviddarnes, for all your time, and attention.
--Chris
@daviddarnes
Yes, sorry. What I meant to say was that the configuration isn't the issue here, so I'm not sure what asking about it does to help...
@Bibliofile you can never be sure, we've had many times where it was simply a database issue. It's better to clarify where the problem lies before jumping to conclusions. Asking will give us more information
I mentioned this in #1158. When it comes to displaying data, DON'T use htmlspecialchars(). This is what's ruining the output. Give it a shot and tell us what happens? 😸