summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdocs/CHANGELOG1
-rw-r--r--lib/ui.lib.php24
-rw-r--r--ratings.php2
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: