Fixed pattern matching for external and internal page links #2133

Ben requested to merge fix/external-pages-regex-2133 into master


Pattern matching for the /p/ pages is broken on production. To replicate, go and click the iOS link in the footer.

Our system is seeing the URL Seeing that it contains '/p' and thinking that it is an internal page

This happened because the system was looking simply for indexOf('p/')

For this fix I have upgraded that check to a regex check, in a commonly held service.


Steps to test

Ignore the first iPhone link - that is invalid data that for now is trapped in the sandbox. (If there is now only 1 link for iPhone, include it in the test, we may have found the missing schema and fixed).


  1. Not logged in, check the links on the bottom footer, ensure they're all working
  2. Log in, check the links on the newsfeed footer
  3. Check the links on the actual /p/ pages, like
  4. Check the pro footer hasn't been effected

Estimated Regression Scope

The components touched by this are: Footer, register homepage and newsfeed.

I think the worst-case scenario would be a failure in the Regex logic causing another pattern matching issue.

Edited by Ben

Merge request reports