diff --git a/.htaccess b/.htaccess index 34d4c719c8d..bd2f42d6658 100644 --- a/.htaccess +++ b/.htaccess @@ -2,6 +2,7 @@ ErrorDocument 404 /core/templates/404.php php_value upload_max_filesize 512M php_value post_max_size 512M +php_value memory_limit 512M SetEnv htaccessWorking true diff --git a/apps/gallery/ajax/getAlbums.php b/apps/gallery/ajax/getAlbums.php index 60d3d42866d..98d92c5f31a 100644 --- a/apps/gallery/ajax/getAlbums.php +++ b/apps/gallery/ajax/getAlbums.php @@ -4,12 +4,12 @@ OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('gallery'); $a = array(); -$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ?'); +$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE uid_owner LIKE ?'); $result = $stmt->execute(array(OC_User::getUser())); while ($r = $result->fetchRow()) { $album_name = $r['album_name']; - $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE `album_id` = ?'); + $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE album_id = ?'); $tmp_res = $stmt->execute(array($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'); } diff --git a/apps/gallery/lib_scanner.php b/apps/gallery/lib_scanner.php index 871c1c38c5f..f72d54777a7 100644 --- a/apps/gallery/lib_scanner.php +++ b/apps/gallery/lib_scanner.php @@ -36,21 +36,21 @@ class OC_GALLERY_SCANNER { } $current_album['imagesCount'] = count($current_album['images']); $albums[] = $current_album; - $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ? AND `album_name` = ?'); + $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE uid_owner LIKE ? AND album_name LIKE ?'); $result = $stmt->execute(array(OC_User::getUser(), $current_album['name'])); if ($result->numRows() == 0 && count($current_album['images'])) { - $stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_albums (`uid_owner`, `album_name`) VALUES (?, ?)'); + $stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_albums (uid_owner, album_name) VALUES (?, ?)'); $stmt->execute(array(OC_User::getUser(), $current_album['name'])); } - $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ? AND `album_name` = ?'); + $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE uid_owner LIKE ? AND album_name LIKE ?'); $result = $stmt->execute(array(OC_User::getUser(), $current_album['name'])); - $albumId = $result->fetchRow(); - $albumId = $albumId['album_id']; + $albumId = $result->fetchAll(); + $albumId = $albumId[0]['album_id']; foreach ($current_album['images'] as $img) { - $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE `album_id` = ? AND `file_path` = ?'); + $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE album_id = ? AND file_path LIKE ?'); $result = $stmt->execute(array($albumId, $img)); if ($result->numRows() == 0) { - $stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_photos (`album_id`, `file_path`) VALUES (?, ?)'); + $stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_photos (album_id, file_path) VALUES (?, ?)'); $stmt->execute(array($albumId, $img)); } }