diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-01-14 18:31:03 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-01-14 18:31:03 +0000 |
commit | c22b5025d3e77325923937f293c30d85111f5af9 (patch) | |
tree | 872749a25099de6404eafcd49f3b97963d769a84 | |
parent | 4d7170217da3a9361d2f7ebb135dea77d5372870 (diff) | |
download | ampache-c22b5025d3e77325923937f293c30d85111f5af9.tar.gz ampache-c22b5025d3e77325923937f293c30d85111f5af9.tar.bz2 ampache-c22b5025d3e77325923937f293c30d85111f5af9.zip |
fixed redirection after applying a rating to an album
-rwxr-xr-x | docs/CHANGELOG | 1 | ||||
-rw-r--r-- | lib/ui.lib.php | 24 | ||||
-rw-r--r-- | ratings.php | 2 |
3 files changed, 15 insertions, 12 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 972dd500..4cd69627 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,7 @@ -------------------------------------------------------------------------- v.3.3.2-Beta2 + - Fixed redirection after applying a rating to an album - Fixed a few typos in the xmlrpc code and playlists and fixed the weird skipping when seeking using some players (Thx Sven) - Fixed a problem with the Image Resize code which wasn't correctly diff --git a/lib/ui.lib.php b/lib/ui.lib.php index 0d708a01..24b84ad5 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -259,22 +259,24 @@ function show_users () { /** * return_referer - * returns the script part of the - * referer address passed by the web browser - * this is not %100 accurate + * returns the script part of the referer address passed by the web browser + * this is not %100 accurate. Also because this is not passed by us we need + * to clean it up, take the filename then check for a /admin/ and dump the rest */ function return_referer() { - $web_path = substr(conf('web_path'),0,strlen(conf('web_path'))-1-strlen($_SERVER['SERVER_PORT'])) . "/"; - $next = str_replace($web_path,"",$_SERVER['HTTP_REFERER']); + $referer = $_SERVER['HTTP_REFERER']; - // If there is more than one :// we know it's fudged - // and just return the index - if (substr_count($next,"://") > 1) { - return "index.php"; + $file = basename($referer); + + /* Strip off the filename */ + $referer = substr($referer,0,strlen($referer)-strlen($file)); + + if (substr($referer,strlen($referer)-6,6) == 'admin/') { + $file = 'admin/' . $file; } - return $next; + return $file; } // return_referer @@ -790,7 +792,7 @@ function img_resize($image,$size,$type){ /* First check for php-gd */ $info = gd_info(); - + if ($type == 'jpg' AND !$info['JPG Support']) { return false; } diff --git a/ratings.php b/ratings.php index 9ced9b95..09154fe2 100644 --- a/ratings.php +++ b/ratings.php @@ -30,7 +30,7 @@ switch ($action) { case 'set_rating': $rating = new Rating($_REQUEST['object_id'],$_REQUEST['rating_type']); $rating->set_rating($_REQUEST['rating']); - show_confirmation(_("Rating Updated"),_("Your rating for this object has been updated"),"/index.php"); + show_confirmation(_("Rating Updated"),_("Your rating for this object has been updated"),return_referer()); break; default: |