I have a simple open graph functionality on my facebook app and I post some dynamic text on facebook. Here is my code:
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# APP: http://ogp.me/ns/fb/APP#">
<meta property="fb:app_id" content="00000000000000" />
<meta property="og:type" content="XXX:XXX" />
<meta property="og:url" content="http://example.com" />
<meta property="og:title" content="<?php echo $_GET['title']; ?>" />
<meta property="og:description" content=" " />
<meta property="og:image" content="<?php echo $_GET['image']; ?>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
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?
<?php echo htmlentities($_GET['title'], ENT_QUOTES); ?>
should work?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With