anchor-cms icon indicating copy to clipboard operation
anchor-cms copied to clipboard

Isn't this corrupting the data in my database?

Open bsdforge opened this issue 9 years ago • 7 comments

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/

bsdforge avatar Dec 27 '16 15:12 bsdforge

Hi there, what is your database setup? Have you set the right encoding?

daviddarnes avatar Dec 27 '16 22:12 daviddarnes

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 avatar Dec 27 '16 23:12 Bibliofile

@Bibliofile I didn't say it wasn't? I'm was trying to help @bsdforge with their problem

daviddarnes avatar Dec 27 '16 23:12 daviddarnes

@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

bsdforge avatar Dec 28 '16 01:12 bsdforge

@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 avatar Dec 28 '16 01:12 Bibliofile

@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

daviddarnes avatar Dec 29 '16 11:12 daviddarnes

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? 😸

TheBrenny avatar Feb 05 '17 12:02 TheBrenny