[Player-dev] CR: Make MID player enforce valid URL in new online-music dialog
Rusty Lynch rusty.lynch at intel.comDescription ---------------------------------- Make the dialog for adding new online music not allow urls that do not contain a domain (i.e. 'http://') https://bugs.helixcommunity.org/show_bug.cgi?id=7969 Files Modified ---------------------------------- player/mid/src/utils.py Branches --------------------------------- HEAD only (for now) Index: src/utils.py =================================================================== RCS file: /cvsroot/player/mid/src/utils.py,v retrieving revision 1.4 diff -u -w -r1.4 utils.py --- src/utils.py 20 Mar 2008 03:04:38 -0000 1.4 +++ src/utils.py 26 Mar 2008 21:36:51 -0000 @@ -206,6 +206,9 @@ # p = re.compile(r'^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?') # We require <protocol>://domain, so modify above regexp a little p = re.compile(r'^([^:/?#]+)://[^/?#]*([^?#]*)(\?([^#]*))?(#(.*))?') - if not p.match(url): - return False + try: + if p.match(url) and url.split('://')[1]: return True + except: + pass + return False