Results 1 to 5 of 5

Thread: Added YouTube / GitHub / Steam to user profile

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts

    Added YouTube / GitHub / Steam to user profile

    Hey all,

    you can now add your YouTube / GitHub / Steam profile links to your user account. I had to add some regexes to prevent the input against XSS attacks, so this is what I came up with:

    Code:
    ^(http|https)://(www.)?(youtube.com|youtu.be)/((c|channel|user)/)?(\+?)[a-zA-Z0-9_\-]+(/)?
    
    http://youtube.com/YourGooglePlusName
    http://youtube.com/+YourGooglePlusName
    http://youtu.be/+YourGooglePlusName
    https://youtube.com/c/KilltubeOrg
    http://youtube.com/c/KilltubeOrg/
    https://www.youtube.com/c/KilltubeOrg
    https://www.youtube.com/channel/UCVuQk8dOOnP3NATrK_N4yHQ
    
    
    ^(http|https)://(www.)?steamcommunity.com/(id|profiles)/[a-zA-Z0-9_\-]+(/)?
    
    https://steamcommunity.com/id/kungfoo_man123/
    http://steamcommunity.com/id/kungfoo_man123/
    https://www.steamcommunity.com/id/kungfoo_man123
    http://www.steamcommunity.com/id/kungfoo_man123/
    http://steamcommunity.com/profiles/NUMBERS_GO_HERE
    
    ^(http|https)://(www.)?github.com/[a-zA-Z0-9_\-]+(/)?
    
    https://github.com/kungfooman/
    http://www.github.com/kungfooman-asd
    Great site for testing: http://www.phpliveregex.com/

    If any valid link might not work, please tell me.

    Are the any other sites which you wanna add to your profile?

    Random ideas welcome aswell.

    Edit #1: Added youtu.be, G+, and Steam /profiles/
    timescale 0.01

  2. The Following 5 Users Say Thank You to kung foo man For This Useful Post:

    guiismiti (21st June 2016),serthy (21st June 2016),voron00 (21st June 2016),Whiskas (21st June 2016),YuriJurek (21st June 2016)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •