diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-31 05:03:50 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-31 05:03:50 +0000 |
commit | 5a923b14c919e4c0a8ae5577df93b860526aa052 (patch) | |
tree | 1359d48e716f5236d249ce3f3822d73cb849132e /lib/class/song.class.php | |
parent | c53ca35a0d401b1ccb8b8c805f0bc7a643bd8aad (diff) | |
download | ampache-5a923b14c919e4c0a8ae5577df93b860526aa052.tar.gz ampache-5a923b14c919e4c0a8ae5577df93b860526aa052.tar.bz2 ampache-5a923b14c919e4c0a8ae5577df93b860526aa052.zip |
sync to trunk
Diffstat (limited to 'lib/class/song.class.php')
-rw-r--r-- | lib/class/song.class.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/class/song.class.php b/lib/class/song.class.php index e9e92de6..b4541cf5 100644 --- a/lib/class/song.class.php +++ b/lib/class/song.class.php @@ -828,14 +828,10 @@ class Song extends database_object { $web_path = Config::get('web_path'); + if (Config::get('force_http_play') OR !empty($force_http)) { - $port = Config::get('http_port'); - if (preg_match("/:\d+/",$web_path)) { - $web_path = str_replace("https://", "http://",$web_path); - } - else { - $web_path = str_replace("https://", "http://",$web_path); - } + $port = Config::get('http_port') ? ':' . Config::get('http_port') : ''; + $web_path = str_replace("https://" . $_SERVER['HTTP_HOST'], "http://" . $_SERVER['SERVER_NAME'] . $port,$web_path); } $url = $web_path . "/play/index.php?song=$song_id&uid=$user_id$session_string$ds_string&name=/$song_name"; |