Search code examples
imageurlfacebook-sharer

safe_image.php changes picture url


When using FB/sharer/sharer.php Im running into problems with my TYPO3 installations as no picture are found. Or better, pictures are found but safe_image.php does not use the correct URL when trying to download them.

In Firebug I noticed FB does following:

safe_image.php?d=XYZ&url=http%3A%2F%2Fwww.my-domain.com%2Fen%2Ffileadmin%2FmyPicture.jpg

which fails because the real path is

safe_image.php?d=XYZ&url=http%3A%2F%2Fwww.my-domain.com%2Ffileadmin%2FmyPicture.jpg

Any idea why there is an /en added? The website has multiple languages (changed by domain.com/en or domain.com/de) but all images could be found under domain.com/fileadmin/...

When using og meta tags it works nice, but we want the user to choose the picture he would like to share.


Solution

  • Facebooks is not able to use relative links with base tag. Which is bad.

    Solution is to use absolute URLs (config.absRefPrefix).

    Related bug tracker issue: http://bugs.typo3.org/view.php?id=18121