summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBartek Przybylski <bart.p.pl@gmail.com>2012-02-04 11:02:13 +0100
committerBartek Przybylski <bart.p.pl@gmail.com>2012-02-04 11:02:13 +0100
commitf1672d7d10477026cfa4f49a8ec7c71e03f3f6ba (patch)
treed5a4b34d62de98bd9da7342be84e38bda9ef72a3 /apps
parent5a106d10361865dfd5cffe8809caee73ff410c4c (diff)
downloadnextcloud-server-f1672d7d10477026cfa4f49a8ec7c71e03f3f6ba.tar.gz
nextcloud-server-f1672d7d10477026cfa4f49a8ec7c71e03f3f6ba.zip
handling special chars in dirnames
Diffstat (limited to 'apps')
-rw-r--r--apps/gallery/ajax/galleryOp.php4
-rw-r--r--apps/gallery/js/albums.js4
-rw-r--r--apps/gallery/lib/album.php1
-rw-r--r--apps/gallery/lib/scanner.php2
4 files changed, 5 insertions, 6 deletions
diff --git a/apps/gallery/ajax/galleryOp.php b/apps/gallery/ajax/galleryOp.php
index 187cd8af292..1233b49052f 100644
--- a/apps/gallery/ajax/galleryOp.php
+++ b/apps/gallery/ajax/galleryOp.php
@@ -104,7 +104,7 @@ if ($_GET['operation']) {
OC_JSON::success();
break;
case 'get_covers':
- handleGetThumbnails($_GET['albumname']);
+ handleGetThumbnails(urldecode($_GET['albumname']));
break;
case 'scan':
handleGalleryScanning();
@@ -113,7 +113,7 @@ if ($_GET['operation']) {
handleFilescan($_GET['cleanup']);
break;
case 'partial_create':
- handlePartialCreate($_GET['path']);
+ handlePartialCreate(urldecode($_GET['path']));
break;
case 'store_settings':
handleStoreSettings($_GET['root'], $_GET['order']);
diff --git a/apps/gallery/js/albums.js b/apps/gallery/js/albums.js
index 01e146a2f12..987412f28e0 100644
--- a/apps/gallery/js/albums.js
+++ b/apps/gallery/js/albums.js
@@ -54,12 +54,12 @@ Albums={
event.preventDefault();
galleryRemove(event.data.name);
});
- $("a.view", local).attr('href','?view='+a.name);
+ $("a.view", local).attr('href','?view='+escape(a.name));
$('h1',local).text(a.name);
$(".gallery_album_cover", local).attr('title',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='+a.name+'")');
+ $(".gallery_album_cover", local).css('background-image','url("ajax/galleryOp.php?operation=get_covers&albumname='+escape(a.name)+'")');
$(".gallery_album_cover", local).mousemove(function(e) {
var albumMetadata = Albums.find(this.title);
diff --git a/apps/gallery/lib/album.php b/apps/gallery/lib/album.php
index 167813a1a31..502237481a9 100644
--- a/apps/gallery/lib/album.php
+++ b/apps/gallery/lib/album.php
@@ -54,7 +54,6 @@ class OC_Gallery_Album {
public static function removeByPath($path, $owner) {
$album = self::find($owner, null, $path);
$album = $album->fetchRow();
- error_log($path . '--' . $album['album_name']);
self::remove($owner, $album['album_name']);
OC_Gallery_Photo::removeByAlbumId($album['album_id']);
// find and remove any gallery which might be stored lower in dir hierarchy
diff --git a/apps/gallery/lib/scanner.php b/apps/gallery/lib/scanner.php
index dfb9edebfea..2af63d8bf0e 100644
--- a/apps/gallery/lib/scanner.php
+++ b/apps/gallery/lib/scanner.php
@@ -106,7 +106,7 @@ class OC_Gallery_Scanner {
if (self::isPhoto($path.$file)) $addpath = TRUE;
}
- if ($addpath) $ret[] = $path;
+ if ($addpath) $ret[] = urlencode($path);
return $ret;
}