Bug #4565
closedInvalid LinkedIn URL on profile
Added by Raffi Khatchadourian about 9 years ago. Updated about 9 years ago.
0%
Description
On http://commons.gc.cuny.edu/members/cstein/, the LinkedIn URL is http://www.linkedin.com/in/www.linkedin.com/in/steinchris/, which is invalid. It should read http://www.linkedin.com/in/steinchris/.
Updated by Boone Gorges about 9 years ago
- Status changed from New to Assigned
- Assignee changed from Boone Gorges to Daniel Jones
- Target version set to 1.8.10
Thanks, Raffi.
Dan, could you look at this? I can't remember whether we normalize URLs on save or on display in bp-social-media-profiles, but in this case we will need a filter that modifies on display. Use regex that looks something like this:
if ( preg_match( '|(https?\://)?(www\.)?linkedin\.com/in/([a-zA-Z0-9\-\.]+)|', $field_value, $matches ) ) { $screen_name = $matches[2]; }
This is totally off the top of my head and completely untested, but it gives you an idea of what to look for (optional http/s, optional www., capture the screenname part of the URL).
Updated by Raffi Khatchadourian about 9 years ago
Boone Gorges wrote:
Thanks, Raffi.
Dan, could you look at this? I can't remember whether we normalize URLs on save or on display in bp-social-media-profiles, but in this case we will need a filter that modifies on display. Use regex that looks something like this:
[...]
This is totally off the top of my head and completely untested, but it gives you an idea of what to look for (optional http/s, optional www., capture the screenname part of the URL).
No problem. Note that LinkedIn URLs can either include http or https.
Updated by Boone Gorges about 9 years ago
No problem. Note that LinkedIn URLs can either include http or https.
I figured - thus the question mark after the s in my regex :)
Updated by Raffi Khatchadourian about 9 years ago
Boone Gorges wrote:
No problem. Note that LinkedIn URLs can either include http or https.
I figured - thus the question mark after the s in my regex :)
Ah! That would teach me to read more carefully before I reply. Sorry about that!
Updated by Boone Gorges about 9 years ago
- Target version changed from 1.8.10 to 1.8.11
Updated by Boone Gorges about 9 years ago
- Target version changed from 1.8.11 to 1.8.12
Updated by Boone Gorges about 9 years ago
- Target version changed from 1.8.12 to 1.8.13
Updated by Boone Gorges about 9 years ago
- Target version changed from 1.8.13 to 1.8.14
Updated by Daniel Jones about 9 years ago
Sorry about this - this was an error created from the last time I monkeyed around with BP Social Media Profiles. It should be fixed now.
https://github.com/cuny-academic-commons/cac/commit/a7dfae87380ff5d6211121d6614b2eed3771dddb
https://github.com/cuny-academic-commons/cac/commit/5f93e930820f89936514647ae378a55099b9512f
Updated by Boone Gorges about 9 years ago
- Status changed from Assigned to Resolved
Thanks, Dan. These fixes look good.
It's pretty annoying that bp-social-media-profiles caches the concatenated URLs in the 'bp_smp_data' meta field. This caching means that changes like the one you've made here will only be applied when the user resaves the field. I assume I originally wrote it like this for performance reasons, but in retrospect, this was a bad idea :) I'm going to mark the current ticket resolved, and open a new one to look at implementing dynamic URL concatenation.
Moved to the 1.8.x branch in https://github.com/cuny-academic-commons/cac/commit/8559ad9c1f29244c0b4b702b2215ff2c64961f85, https://github.com/cuny-academic-commons/cac/commit/bef2000c3dbcec62910baf9f9f99cc1649c5be1d