heiseonline / shariff-backend-php

👮 PHP backend for Shariff. Shariff enables website users to share their favorite content without compromising their privacy.
http://ct.de/-2467514
133 stars 44 forks source link

Facebook has problems with anchors and umlauts #26

Closed ikabod closed 9 years ago

ikabod commented 9 years ago

If an url has an anchor attached (e. g. "#mytarget") or contains an umlaut facebook does not work. So all anchors should be removed form an url bevor requesting the counter of facebook. And may be umlauts can be converted too. I actually replaces all umlautes in my urls manually.

Test without anchor (facebook counter is displayed): http://www.marchert.info/brd/dokumente/datenschutzhinweise.html

Test with anchor (facebook counter is not displayed): http://www.marchert.info/brd/dokumente/datenschutzhinweise.html#social

Edit: The umlaut problem exists with all buttons.

liayn commented 9 years ago

Is it safe to drop the anchors? I don't think so. You should rather set the right url to share.

ikabod commented 9 years ago

Why should it not be safe?

I have now added a quick and dirt solution to the facebook.php in the backend. Works for me fine.

The alternative would be to write the fix for the included sharrif div, because in a CMS you can not set data-urls manually.

liayn commented 9 years ago

Depends on the CMS. ;-)

liayn commented 9 years ago

A different anchor could mean different content. For instance if a tab-selection depends on the anchor.

compeak commented 9 years ago

You can use

as a workaround.

Please talk to the author of your third-party integration if it does not support these methods.

Sanitizing or canonicalizing URLs for specific services is not a task shariff should handle.