summaryrefslogtreecommitdiffstats
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
parent9f87707043594ec990e1c96fe806c93869387c8d (diff)
downloadampache-466198e1e89da048a3d861204e13eae911bd13f2.tar.gz
ampache-466198e1e89da048a3d861204e13eae911bd13f2.tar.bz2
ampache-466198e1e89da048a3d861204e13eae911bd13f2.zip
fixed force http play
-rwxr-xr-xdocs/CHANGELOG2
-rw-r--r--lib/class/song.class.php10
2 files changed, 10 insertions, 2 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index c3d6f84b..b1e279d7 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,8 @@
--------------------------------------------------------------------------
v.3.3.3
+ - Fixed logic on force http that was causing it not to work under
+ specific configurations
- Fixed a flagged and rated item clean issue with catalogs
- Fixed some minor issues in HttpQ and MPD localplay controllers
- Fixed Album Art search on Catalog add so that it only searches
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";