We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Disallowed Key Characters on Facebook Links

News and General

lazypaddy's avatar
lazypaddy
34 posts
6 years ago
lazypaddy's avatar lazypaddy

I found an issue that was caused by a link to an article I have, when it was called from a Facebook link. Facebook adds click ID’s to it’s shared links, but the Input.php _clean_input_keys function does not like the ? at the beginning of the GET parameter. I’m guessing this would also be a problem if you were using the GET method for any reason as well? I modified the Input.php from:

if ( ! preg_match("/^[a-z0-9:_\/ \-".EMOJI_REGEX."]+$/iu", $str))

to:

if ( ! preg_match("/^[a-z0-9:_\/ \-?".EMOJI_REGEX."]+$/iu", $str))

This is an example of the URL that Facebook links to: http://www.mysite.com/news/some-article?fbclid=IwAR3rqfixHrmY4cEdraGshLsctsKdHv1oUyj9nhdWsSw7DDE6y38ZNVcTT_w

I’m running EE 5.2.1 on Nginx

       
Derek Jones's avatar
Derek Jones
7,561 posts
about 6 years ago
Derek Jones's avatar Derek Jones

Do you have a URL rewrite that is already turning your URL into a query string? e.g. index.php?/foo/bar

       
lazypaddy's avatar
lazypaddy
34 posts
about 6 years ago
lazypaddy's avatar lazypaddy

Hey Derek. Yes I have a rewrite rule to remove the index.php rewrite ^(.)index.php?/(.)$ $1$2 permanent;

I found this in one of the forums to work with Nginx

       
Derek Jones's avatar
Derek Jones
7,561 posts
about 6 years ago
Derek Jones's avatar Derek Jones

Ok, so do you see what that’s doing to your URL? You’ve essentially got two query strings. https://example.com/index.php?/news/some-article?fbclid=...

You might be able to rewrite the incoming query string to use &? Worth noting though that this will soon be a moot point.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.