The like module cannot render the meta tag for page title correctly if there is a quote " character in the title. The same problem may apply to other modules, i haven't checked. The fix is simple:
In file:
fb_social_like.module
change the line:
$data = '<meta property="og:title" content="'. $object -> title. '"/>' ."\n";
to:
$data = '<meta property="og:title" content="'. htmlspecialchars($object -> title). '"/>' ."\n";
htmlspecialchars() will ensure that any HTML entities in the title are rendered correctly.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | title_encoding.patch | 1.07 KB | chia |
| fb_social_like.module.fixed_.zip | 1.86 KB | dimension7 |
Comments
Comment #1
dimension7 commentedComment #2
chia commentedHere a patch to fix this
Comment #3
ferdi commentedcommitted , http://drupal.org/cvs?commit=426192
thanks!
Comment #4
ferdi commentedComment #5
pedrochristopher commentedIt seems this fix corrects some HTML characters but not some others. For instance the ' character is in my tests not fixed. You can click the share button on http://samaritanmag.com/1006/pancake-punchlines-lead-pancakes-penner-la-... and see that the title is not correct.