summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-04-19 19:18:48 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-04-19 19:18:48 +0000
commit6a8795b049a7566350efb369f4990f4f8189c9f1 (patch)
tree255b12a6d5f2acb61c6c1189702079fd88b6ef53 /lib
parentac62e1a07458facafd255a5e24344e9f60ef38f3 (diff)
downloadampache-6a8795b049a7566350efb369f4990f4f8189c9f1.tar.gz
ampache-6a8795b049a7566350efb369f4990f4f8189c9f1.tar.bz2
ampache-6a8795b049a7566350efb369f4990f4f8189c9f1.zip
no longer passes the sid with the urls if require_session is turned off
Diffstat (limited to 'lib')
-rw-r--r--lib/class/song.class.php43
1 files changed, 23 insertions, 20 deletions
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index 271d96fd..d1a985b4 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -126,37 +126,37 @@ class Song {
$this->type = strtolower($results['1']);
switch ($this->type) {
- case "spx":
- case "ogg":
+ case 'spx':
+ case 'ogg':
$this->mime = "application/x-ogg";
- break;
- case "wma":
- case "asf":
+ break;
+ case 'wma':
+ case 'asf':
$this->mime = "audio/x-ms-wma";
- break;
- case "mp3":
- case "mpeg3":
+ break;
+ case 'mp3':
+ case 'mpeg3':
$this->mime = "audio/mpeg";
- break;
- case "rm":
- case "ra":
+ break;
+ case 'rm':
+ case 'ra':
$this->mime = "audio/x-realaudio";
- break;
- case "flac";
+ break;
+ case 'flac';
$this->mime = "audio/x-flac";
- break;
+ break;
case 'aac':
case 'mp4':
case 'm4a':
$this->mime = "audio/mp4";
- break;
+ break;
case 'mpc':
$this->mime = "audio/x-musepack";
$this->type = "MPC";
- break;
+ break;
default:
$this->mime = "audio/mpeg";
- break;
+ break;
}
} // get_type
@@ -710,7 +710,9 @@ class Song {
/* Define Variables we are going to need */
$username = $GLOBALS['user']->username;
$song_id = $this->id;
- $session = session_id();
+ if (conf('require_session')) {
+ $session_string = "&sid=" . session_id();
+ } // if they are requiring a session
$type = $this->type;
if ($GLOBALS['user']->prefs['play_type'] == 'downsample') {
@@ -719,9 +721,10 @@ class Song {
/* Account for retarded players */
if ($song->type == 'flac') { $type = 'ogg'; }
- $song_name = rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type);
+ $this->format_song();
+ $song_name = rawurlencode($this->f_artist_full . " - " . $this->title . "." . $this->type);
- $url = conf('web_path') . "/play/index.php?song=$song_id&uid=$username&sid=$session$ds_string&name=$song_name";
+ $url = conf('web_path') . "/play/index.php?song=$song_id&uid=$username$session_string$ds_string&name=$song_name";
return $url;