Details
Description
Add an extra field when defining a text type user profile field that contains link information to be used when data is displayed in a user's profile. Use a "$" wildcard to be replaced with the user data.
eg Admin sets up link as "http://google.com/search?q=$"
User enters data into this field such as "rabbit"
Then the relevant field on their profile page will be rendered as <a href="http://google.com/search?q=rabbit" target="_blank">rabbit</a>
Issue Links
| This issue will help resolve: | ||||
| MDLSITE-709 | The Twitter ID profile field on Moodle.org should really link to the Twitter profile |
|
|
|
Code commited to head.
Changed placeholder to $$ as $ is actually a valid URL character - $$ is unlikely to appear. But will that clash with anything else? Filters?
Data that's included in the link is cleaned via format_text( ... , FORMAT_MOODLE) and then urlencode(). AFAIK that should sufficiently get rid of any potential nasty code that could be entered but someone else may like to comment on that.