summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-14 18:31:03 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-14 18:31:03 +0000
commitc22b5025d3e77325923937f293c30d85111f5af9 (patch)
tree872749a25099de6404eafcd49f3b97963d769a84 /lib
parent4d7170217da3a9361d2f7ebb135dea77d5372870 (diff)
downloadampache-c22b5025d3e77325923937f293c30d85111f5af9.tar.gz
ampache-c22b5025d3e77325923937f293c30d85111f5af9.tar.bz2
ampache-c22b5025d3e77325923937f293c30d85111f5af9.zip
fixed redirection after applying a rating to an album
Diffstat (limited to 'lib')
-rw-r--r--lib/ui.lib.php24
1 files changed, 13 insertions, 11 deletions
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;
}