Skip to content
Advertisement

how to solve double quotes issue in facebook og title property

I have a simple open graph functionality on my facebook app and I post some dynamic text on facebook. Here is my code:

JavaScript

The problem is that when there are double quotes inside $_GET[‘title’] variable only the part before that quote is sent to facebook. I know why this happens but can’t think of any solution to this problem. Any ideas?

Advertisement

Answer

<?php echo htmlentities($_GET['title'], ENT_QUOTES); ?> should work?

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement