summaryrefslogtreecommitdiffstats
path: root/lib/class/radio.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-04-30 20:38:43 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-04-30 20:38:43 +0000
commit45075159e6e9c5b9ecf7559ee829f88bd5b62f73 (patch)
tree5e32f4be8b64e50be173aa0e51dca01eec473d4e /lib/class/radio.class.php
parent8e0d90e488702fdfb489a8ecc209f44c61b19096 (diff)
downloadampache-45075159e6e9c5b9ecf7559ee829f88bd5b62f73.tar.gz
ampache-45075159e6e9c5b9ecf7559ee829f88bd5b62f73.tar.bz2
ampache-45075159e6e9c5b9ecf7559ee829f88bd5b62f73.zip
allow additional stream url types
Diffstat (limited to 'lib/class/radio.class.php')
-rw-r--r--lib/class/radio.class.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/class/radio.class.php b/lib/class/radio.class.php
index 4bbd3a51..33154583 100644
--- a/lib/class/radio.class.php
+++ b/lib/class/radio.class.php
@@ -79,15 +79,22 @@ class Radio extends database_object implements media {
// Verify the incoming data
if (!$data['id']) {
+ // FIXME: Untranslated
Error::add('general','Missing ID');
}
if (!$data['name']) {
+ // FIXME: Untranslated
Error::add('general','Name Required');
}
- if (!preg_match("/^https?:\/\/.+/",$data['url'])) {
- Error::add('general','Invalid URL must be https:// or http://');
+ $allowed_array = array('https','http','mms','mmsh','mmsu','mmst','rtsp');
+
+ $elements = explode(":",$data['url']);
+
+ if (!in_array($elements['0'],$allowed_array)) {
+ // FIXME: Untranslated
+ Error::add('general','Invalid URL must be mms:// , https:// or http://');
}
if (Error::occurred()) {
@@ -119,16 +126,22 @@ class Radio extends database_object implements media {
// Make sure we've got a name
if (!strlen($data['name'])) {
+ // FIXME: Untranslated
Error::add('name','Name Required');
}
- if (!preg_match("/^https?:\/\/.+/",$data['url'])) {
+ $allowed_array = array('https','http','mms','mmsh','mmsu','mmst','rtsp');
+
+ $elements = explode(":",$data['url']);
+
+ if (!in_array($elements['0'],$allowed_array)) {
Error::add('url','Invalid URL must be http:// or https://');
}
// Make sure it's a real catalog
$catalog = new Catalog($data['catalog']);
if (!$catalog->name) {
+ // FIXME: Untranslated
Error::add('catalog','Invalid Catalog');
}