[Player-dev] CR: Make MID player enforce valid URL in new online-music dialog

[Player-dev] CR: Make MID player enforce valid URL in new online-music dialog

Rusty Lynch rusty.lynch at intel.com
Thu Mar 27 10:45:16 PDT 2008


Description
----------------------------------
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




More information about the Player-dev mailing list
 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

Copyright © 1995-2007 RealNetworks, Inc. All rights reserved. RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.