summaryrefslogtreecommitdiffstats
path: root/lib/class/song.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-01-17 14:38:30 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-01-17 14:38:30 +0000
commit466198e1e89da048a3d861204e13eae911bd13f2 (patch)
tree25b0840136ad2bbd3439c7347159d7371332bd37 /lib/class/song.class.php
parent9f87707043594ec990e1c96fe806c93869387c8d (diff)
downloadampache-466198e1e89da048a3d861204e13eae911bd13f2.tar.gz
ampache-466198e1e89da048a3d861204e13eae911bd13f2.tar.bz2
ampache-466198e1e89da048a3d861204e13eae911bd13f2.zip
fixed force http play
Diffstat (limited to 'lib/class/song.class.php')
-rw-r--r--lib/class/song.class.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index b64f195c..26c218a7 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -826,8 +826,14 @@ class Song {
if (conf('force_http_play') OR !empty($force_http)) {
$port = conf('http_port');
- $web_path = preg_replace("/https/", "http",$web_path);
- $web_path = preg_replace("/:\d+/",":$port",$web_path);
+ if (preg_match("/:\d+/",$web_path)) {
+ $web_path = str_replace("https://", "http://",$web_path);
+ $web_path = preg_replace("/:\d+/",":$port",$web_path);
+ }
+ else {
+ $web_path = str_replace("https://", "http://",$web_path);
+ $web_path = str_replace($_SERVER['HTTP_HOST'],$_SERVER['HTTP_HOST'] . ':' . $port,$web_path);
+ }
}
$url = $web_path . "/play/index.php?song=$song_id&uid=$username$session_string$ds_string&name=/$song_name";