aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBartek Przybylski <bart.p.pl@gmail.com>2012-02-25 20:37:51 +0100
committerBartek Przybylski <bart.p.pl@gmail.com>2012-02-25 20:38:22 +0100
commit8fe5251029c9e3c711660abcb58c7e60f6b88f97 (patch)
treefbb3797fc8018c6fc1c03dcfaa5619c1ab9c604a /apps
parent4f627c428eb64fae307ea293e8093e345d742edc (diff)
downloadnextcloud-server-8fe5251029c9e3c711660abcb58c7e60f6b88f97.tar.gz
nextcloud-server-8fe5251029c9e3c711660abcb58c7e60f6b88f97.zip
unicode chars in gallery name fix
Diffstat (limited to 'apps')
-rw-r--r--apps/gallery/ajax/galleryOp.php3
-rw-r--r--apps/gallery/ajax/getAlbums.php2
-rw-r--r--apps/gallery/js/albums.js6
3 files changed, 6 insertions, 5 deletions
diff --git a/apps/gallery/ajax/galleryOp.php b/apps/gallery/ajax/galleryOp.php
index 5ac6d295108..f07814056a3 100644
--- a/apps/gallery/ajax/galleryOp.php
+++ b/apps/gallery/ajax/galleryOp.php
@@ -41,7 +41,8 @@ function handleRemove($name) {
function handleGetThumbnails($albumname) {
OC_Response::enableCaching(3600 * 24); // 24 hour
- $thumbnail = OC::$CONFIG_DATADIRECTORY.'/../gallery/'.$albumname.'.png';
+ error_log(htmlentities($albumname));
+ $thumbnail = OC::$CONFIG_DATADIRECTORY.'/../gallery/'.urldecode($albumname).'.png';
header('Content-Type: '.OC_Image::getMimeTypeForFile($thumbnail));
OC_Response::sendFile($thumbnail);
}
diff --git a/apps/gallery/ajax/getAlbums.php b/apps/gallery/ajax/getAlbums.php
index 9e9c6ef496c..be87af2abd3 100644
--- a/apps/gallery/ajax/getAlbums.php
+++ b/apps/gallery/ajax/getAlbums.php
@@ -33,7 +33,7 @@ while ($r = $result->fetchRow()) {
$album_name = $r['album_name'];
$tmp_res = OC_Gallery_Photo::find($r['album_id']);
- $a[] = array('name' => $album_name, 'numOfItems' => min($tmp_res->numRows(), 10), 'bgPath' => OC::$WEBROOT.'/data/'.OC_User::getUser().'/gallery/'.$album_name.'.png');
+ $a[] = array('name' => utf8_encode($album_name), 'numOfItems' => min($tmp_res->numRows(), 10), 'bgPath' => OC::$WEBROOT.'/data/'.OC_User::getUser().'/gallery/'.$album_name.'.png');
}
OC_JSON::success(array('albums'=>$a));
diff --git a/apps/gallery/js/albums.js b/apps/gallery/js/albums.js
index 987412f28e0..adecd24cc75 100644
--- a/apps/gallery/js/albums.js
+++ b/apps/gallery/js/albums.js
@@ -54,9 +54,9 @@ Albums={
event.preventDefault();
galleryRemove(event.data.name);
});
- $("a.view", local).attr('href','?view='+escape(a.name));
- $('h1',local).text(a.name);
- $(".gallery_album_cover", local).attr('title',a.name);
+ $("a.view", local).attr('href','?view='+decodeURIComponent(escape(a.name)));
+ $('h1',local).text(decodeURIComponent(escape(a.name)));
+ $(".gallery_album_cover", local).attr('title',decodeURIComponent(escape(a.name)));
$(".gallery_album_cover", local).css('background-repeat', 'no-repeat');
$(".gallery_album_cover", local).css('background-position', '0');
$(".gallery_album_cover", local).css('background-image','url("ajax/galleryOp.php?operation=get_covers&albumname='+escape(a.name)+'")');