Last active
July 1, 2022 07:28
-
-
Save ghostwriter/bcaba56977f20b14dc5b to your computer and use it in GitHub Desktop.
BattleTale Bug #29 (reproducible bug)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
1. post a link in chat. (ex. https://github.com/) | |
2. post anything with 3 or more "w"s in a row. (ex. www, wowww,wwwwwwwwww) | |
3. use {/geturl} and you'll get the word with the 3 "w" in it and not the url. | |
Fix: Validate url. | |
*/ | |
var url:String = "http://www.google.com"; | |
var regex:RegExp = /^http(s)?:\/\/((\d+\.\d+\.\d+\.\d+)|(([\w-]+\.)+([a-z,A-Z][\w-]*)))(:[1-9][0-9]*)?(\/([\w-.\/:%+@&=]+[\w- .\/?:%+@&=]*)?)?(#(.*))?$/i; | |
trace(regex.test(url)); // returns true if valid url is found |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment