From 51ec68a6231c577baa0890dbf8b4b91fe9c10ed0 Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Mon, 9 Sep 2013 21:06:48 +0200 Subject: Concatenate string in SQL instead of PHP --- apps/files/appinfo/update.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php index 3503678e7c7..d8886328d8f 100644 --- a/apps/files/appinfo/update.php +++ b/apps/files/appinfo/update.php @@ -3,17 +3,17 @@ // fix webdav properties,add namespace in front of the property, update for OC4.5 $installedVersion=OCP\Config::getAppValue('files', 'installed_version'); if (version_compare($installedVersion, '1.1.6', '<')) { - $query = OC_DB::prepare( 'SELECT `propertyname`, `propertypath`, `userid` FROM `*PREFIX*properties`' ); - $result = $query->execute(); - $updateQuery = OC_DB::prepare('UPDATE `*PREFIX*properties`' - .' SET `propertyname` = ?' - .' WHERE `userid` = ?' - .' AND `propertypath` = ?'); - while( $row = $result->fetchRow()) { - if ( $row['propertyname'][0] != '{' ) { - $updateQuery->execute(array('{DAV:}' + $row['propertyname'], $row['userid'], $row['propertypath'])); - } + // SQL92 string concatenation is ||, some of the DBMS don't know that + if (OC_Config::getValue('dbtype') === 'mysql') { + $concat = "concat('{DAV:}', `propertyname`)"; + } else if (OC_Config::getValue('dbtype') === 'mssql') { + $concat = "'{DAV:}' + `propertyname`"; + } else { + $concat = "'{DAV:}' || `propertyname`"; } + $query = OC_DB::prepare( "UPDATE `*PREFIX*properties` + SET `propertyname` = $concat + WHERE `propertyname` LIKE '{%'" ); } //update from OC 3 -- cgit v1.2.3 From 72ca0a482b2b998c8f75f4dd3710c9635d8d6ca7 Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Thu, 12 Sep 2013 12:11:36 +0200 Subject: use doctrine to construct concat expression --- apps/files/appinfo/update.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php index d8886328d8f..7ae09114653 100644 --- a/apps/files/appinfo/update.php +++ b/apps/files/appinfo/update.php @@ -3,14 +3,7 @@ // fix webdav properties,add namespace in front of the property, update for OC4.5 $installedVersion=OCP\Config::getAppValue('files', 'installed_version'); if (version_compare($installedVersion, '1.1.6', '<')) { - // SQL92 string concatenation is ||, some of the DBMS don't know that - if (OC_Config::getValue('dbtype') === 'mysql') { - $concat = "concat('{DAV:}', `propertyname`)"; - } else if (OC_Config::getValue('dbtype') === 'mssql') { - $concat = "'{DAV:}' + `propertyname`"; - } else { - $concat = "'{DAV:}' || `propertyname`"; - } + $concat = OC_DB::getConnection()->getDatabasePlatform()->getConcatExpression( "'{DAV:}'", "`propertyname`" ); $query = OC_DB::prepare( "UPDATE `*PREFIX*properties` SET `propertyname` = $concat WHERE `propertyname` LIKE '{%'" ); -- cgit v1.2.3 From 9ae829497a3e3a4ef535e9ed18f59233c0a4aa35 Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Fri, 1 Nov 2013 15:45:33 +0100 Subject: cleanup and actually execute the query --- apps/files/appinfo/update.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php index 7ae09114653..f920f842166 100644 --- a/apps/files/appinfo/update.php +++ b/apps/files/appinfo/update.php @@ -3,10 +3,14 @@ // fix webdav properties,add namespace in front of the property, update for OC4.5 $installedVersion=OCP\Config::getAppValue('files', 'installed_version'); if (version_compare($installedVersion, '1.1.6', '<')) { - $concat = OC_DB::getConnection()->getDatabasePlatform()->getConcatExpression( "'{DAV:}'", "`propertyname`" ); - $query = OC_DB::prepare( "UPDATE `*PREFIX*properties` - SET `propertyname` = $concat - WHERE `propertyname` LIKE '{%'" ); + $concat = OC_DB::getConnection()->getDatabasePlatform()-> + getConcatExpression( '\'{DAV:}\'', '`propertyname`' ); + $query = OC_DB::prepare(' + UPDATE `*PREFIX*properties` + SET `propertyname` = ' . $concat . ' + WHERE `propertyname` NOT LIKE \'{%\' + '); + $query->execute(); } //update from OC 3 -- cgit v1.2.3 From d5397d813cd731b5bf8ac4b7c193ac39d704af6e Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 13 Feb 2014 20:20:00 +0100 Subject: Do not send file list for select all on Download/delete - When all files are selected, do not send the whole file list - Download will trigger download for the parent folder, also works with root - Delete will send "allfiles" to the server that will find the file list or the passed directory by itself --- apps/files/ajax/delete.php | 15 ++++++- apps/files/js/filelist.js | 74 +++++++++++++++++++++++++--------- apps/files/js/files.js | 23 ++++++----- apps/files/tests/js/fileactionsSpec.js | 2 +- apps/files/tests/js/filelistSpec.js | 13 ++++-- apps/files_sharing/js/public.js | 30 +++++++++++--- lib/private/files.php | 9 ++++- 7 files changed, 126 insertions(+), 40 deletions(-) diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php index c69f5a8860c..69f859daa97 100644 --- a/apps/files/ajax/delete.php +++ b/apps/files/ajax/delete.php @@ -9,8 +9,21 @@ OCP\JSON::callCheck(); // Get data $dir = stripslashes($_POST["dir"]); $files = isset($_POST["file"]) ? $_POST["file"] : $_POST["files"]; +$allFiles = isset($_POST["allfiles"]) ? $_POST["allfiles"] : $_POST["allfiles"]; +if ($allFiles === 'true') { + $allFiles = true; +} -$files = json_decode($files); +// delete all files in dir ? +if ($allFiles) { + $files = array(); + $fileList = \OC\Files\Filesystem::getDirectoryContent($dir); + foreach ($fileList as $fileInfo) { + $files[] = $fileInfo['name']; + } +} else { + $files = json_decode($files); +} $filesWithError = ''; $success = true; diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index a855d6cbe59..d6cffde05de 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -582,30 +582,49 @@ window.FileList={ }}); } }, - do_delete:function(files) { - if (files.substr) { + do_delete:function(files, dir) { + var params; + if (files && files.substr) { files=[files]; } - for (var i=0; i 0) { - return $(tr).find('a.name').attr('href') + '&download'; + if ($.isArray(filename)) { + filename = JSON.stringify(filename); + } + var path = dir || FileList.getCurrentDirectory(); + var params = { + service: 'files', + t: $('#sharingToken').val(), + path: path, + download: null + }; + if (filename) { + params.files = filename; } - return null; + return OC.filePath('', '', 'public.php') + '?' + OC.buildQueryString(params); }; } diff --git a/lib/private/files.php b/lib/private/files.php index 24fca4a5df3..5bbc2e960d7 100644 --- a/lib/private/files.php +++ b/lib/private/files.php @@ -103,7 +103,12 @@ class OC_Files { if ($xsendfile) { $filename = OC_Helper::moveToNoClean($filename); } - $name = $files . '.zip'; + // downloading root ? + if ($files === '') { + $name = 'download.zip'; + } else { + $name = $files . '.zip'; + } set_time_limit($executionTime); } else { $zip = false; @@ -198,6 +203,8 @@ class OC_Files { $dirname=basename($dir); $zip->addEmptyDir($internalDir.$dirname); $internalDir.=$dirname.='/'; + // prevent absolute dirs + $internalDir = ltrim($internalDir, '/'); $files=OC_Files::getDirectoryContent($dir); foreach($files as $file) { $filename=$file['name']; -- cgit v1.2.3 From 94b3296a71c5950f70919836bc12f0066016b705 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 17 Feb 2014 18:26:29 +0100 Subject: Trashbin select all now doesn't send file list - Fixed "delete" and "restore" actions to not send the file list when all files are selected - When some files are selected, sends the current dir - Removed "dirListing" attribute as the backend is able to compute the value based on the current dir --- apps/files_trashbin/ajax/delete.php | 16 ++-- apps/files_trashbin/ajax/undelete.php | 31 ++++++-- apps/files_trashbin/js/trash.js | 141 +++++++++++++++++++--------------- 3 files changed, 109 insertions(+), 79 deletions(-) diff --git a/apps/files_trashbin/ajax/delete.php b/apps/files_trashbin/ajax/delete.php index 75d481768ad..ebabc5bc7a2 100644 --- a/apps/files_trashbin/ajax/delete.php +++ b/apps/files_trashbin/ajax/delete.php @@ -2,42 +2,38 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::callCheck(); +$folder = isset($_POST['dir']) ? $_POST['dir'] : '/'; // "empty trash" command if (isset($_POST['allfiles']) and $_POST['allfiles'] === 'true'){ $deleteAll = true; - $folder = isset($_POST['dir']) ? $_POST['dir'] : '/'; if ($folder === '/' || $folder === '') { OCA\Files_Trashbin\Trashbin::deleteAll(); $list = array(); } else { - $dirname = dirname($folder); - if ( $dirname !== '/' && $dirname !== '.' ) { - $dirlisting = '1'; - } else { - $dirlisting = '0'; - } $list[] = $folder; + $folder = dirname($folder); } } else { $deleteAll = false; $files = $_POST['files']; - $dirlisting = $_POST['dirlisting']; $list = json_decode($files); } + +$folder = rtrim($folder, '/') . '/'; $error = array(); $success = array(); $i = 0; foreach ($list as $file) { - if ( $dirlisting === '0') { + if ($folder === '/') { $file = ltrim($file, '/'); $delimiter = strrpos($file, '.d'); $filename = substr($file, 0, $delimiter); $timestamp = substr($file, $delimiter+2); } else { - $filename = $file; + $filename = $folder . '/' . $file; $timestamp = null; } diff --git a/apps/files_trashbin/ajax/undelete.php b/apps/files_trashbin/ajax/undelete.php index 876ad269a70..9c3ccba7ed8 100644 --- a/apps/files_trashbin/ajax/undelete.php +++ b/apps/files_trashbin/ajax/undelete.php @@ -4,15 +4,36 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::callCheck(); $files = $_POST['files']; -$dirlisting = $_POST['dirlisting']; -$list = json_decode($files); +$dir = '/'; +if (isset($_POST['dir'])) { + $dir = rtrim($_POST['dir'], '/'). '/'; +} +$allFiles = false; +if (isset($_POST['allfiles']) and $_POST['allfiles'] === 'true') { + $allFiles = true; + $list = array(); + $dirListing = true; + if ($dir === '' || $dir === '/') { + $dirListing = false; + } + foreach (OCA\Files_Trashbin\Helper::getTrashFiles($dir) as $file) { + $fileName = $file['name']; + if (!$dirListing) { + $fileName .= '.d' . $file['timestamp']; + } + $list[] = $fileName; + } +} else { + $list = json_decode($files); +} $error = array(); $success = array(); $i = 0; foreach ($list as $file) { - if ( $dirlisting === '0') { + $path = $dir . '/' . $file; + if ($dir === '/') { $file = ltrim($file, '/'); $delimiter = strrpos($file, '.d'); $filename = substr($file, 0, $delimiter); @@ -23,9 +44,9 @@ foreach ($list as $file) { $timestamp = null; } - if ( !OCA\Files_Trashbin\Trashbin::restore($file, $filename, $timestamp) ) { + if ( !OCA\Files_Trashbin\Trashbin::restore($path, $filename, $timestamp) ) { $error[] = $filename; - OC_Log::write('trashbin','can\'t restore ' . $filename, OC_Log::ERROR); + OC_Log::write('trashbin', 'can\'t restore ' . $filename, OC_Log::ERROR); } else { $success[$i]['filename'] = $file; $success[$i]['timestamp'] = $timestamp; diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js index 46d8b56308c..6aade210505 100644 --- a/apps/files_trashbin/js/trash.js +++ b/apps/files_trashbin/js/trash.js @@ -1,5 +1,29 @@ +/* + * Copyright (c) 2014 + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ + +/* global OC, t, FileList, FileActions */ $(document).ready(function() { + function removeCallback(result) { + if (result.status !== 'success') { + OC.dialogs.alert(result.data.message, t('core', 'Error')); + } + + var files = result.data.success; + for (var i = 0; i < files.length; i++) { + FileList.findFileEl(OC.basename(files[i].filename)).remove(); + } + FileList.updateFileSummary(); + FileList.updateEmptyContent(); + enableActions(); + } if (typeof FileActions !== 'undefined') { FileActions.register('all', 'Restore', OC.PERMISSION_READ, OC.imagePath('core', 'actions/history'), function(filename) { @@ -7,22 +31,12 @@ $(document).ready(function() { var deleteAction = tr.children("td.date").children(".action.delete"); deleteAction.removeClass('delete-icon').addClass('progress-icon'); disableActions(); - $.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'), - {files: JSON.stringify([$('#dir').val() + '/' + filename]), dirlisting: tr.attr('data-dirlisting')}, - function(result) { - for (var i = 0; i < result.data.success.length; i++) { - var row = document.getElementById(result.data.success[i].filename); - row.parentNode.removeChild(row); - } - if (result.status !== 'success') { - OC.dialogs.alert(result.data.message, t('core', 'Error')); - } - enableActions(); - FileList.updateFileSummary(); - FileList.updateEmptyContent(); - } + $.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'), { + files: JSON.stringify([filename]), + dir: FileList.getCurrentDirectory() + }, + removeCallback ); - }); }; @@ -34,22 +48,12 @@ $(document).ready(function() { var deleteAction = tr.children("td.date").children(".action.delete"); deleteAction.removeClass('delete-icon').addClass('progress-icon'); disableActions(); - $.post(OC.filePath('files_trashbin', 'ajax', 'delete.php'), - {files: JSON.stringify([$('#dir').val() + '/' +filename]), dirlisting: tr.attr('data-dirlisting')}, - function(result) { - for (var i = 0; i < result.data.success.length; i++) { - var row = document.getElementById(result.data.success[i].filename); - row.parentNode.removeChild(row); - } - if (result.status !== 'success') { - OC.dialogs.alert(result.data.message, t('core', 'Error')); - } - enableActions(); - FileList.updateFileSummary(); - FileList.updateEmptyContent(); - } + $.post(OC.filePath('files_trashbin', 'ajax', 'delete.php'), { + files: JSON.stringify([filename]), + dir: FileList.getCurrentDirectory() + }, + removeCallback ); - }); // Sets the select_all checkbox behaviour : @@ -68,29 +72,45 @@ $(document).ready(function() { $('.undelete').click('click', function(event) { event.preventDefault(); - var files = getSelectedFiles('file'); - var fileslist = JSON.stringify(files); - var dirlisting = getSelectedFiles('dirlisting')[0]; + var allFiles = $('#select_all').is(':checked'); + var files = []; + var params = {}; disableActions(); - for (var i = 0; i < files.length; i++) { - var deleteAction = FileList.findFileEl(files[i]).children("td.date").children(".action.delete"); - deleteAction.removeClass('delete-icon').addClass('progress-icon'); + if (allFiles) { + FileList.showMask(); + params = { + allfiles: true, + dir: FileList.getCurrentDirectory() + }; + } + else { + files = getSelectedFiles('name'); + for (var i = 0; i < files.length; i++) { + var deleteAction = FileList.findFileEl(files[i]).children("td.date").children(".action.delete"); + deleteAction.removeClass('delete-icon').addClass('progress-icon'); + } + params = { + files: JSON.stringify(files), + dir: FileList.getCurrentDirectory() + }; } $.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'), - {files: fileslist, dirlisting: dirlisting}, - function(result) { - for (var i = 0; i < result.data.success.length; i++) { - var row = document.getElementById(result.data.success[i].filename); - row.parentNode.removeChild(row); - } + params, + function(result) { + if (allFiles) { if (result.status !== 'success') { OC.dialogs.alert(result.data.message, t('core', 'Error')); } + FileList.hideMask(); + // simply remove all files + FileList.update(''); enableActions(); - FileList.updateFileSummary(); - FileList.updateEmptyContent(); } + else { + removeCallback(result); + } + } ); }); @@ -101,17 +121,17 @@ $(document).ready(function() { var params = {}; if (allFiles) { params = { - allfiles: true, - dir: $('#dir').val() + allfiles: true, + dir: FileList.getCurrentDirectory() }; } else { - files = getSelectedFiles('file'); + files = getSelectedFiles('name'); params = { files: JSON.stringify(files), - dirlisting: getSelectedFiles('dirlisting')[0] + dir: FileList.getCurrentDirectory() }; - }; + } disableActions(); if (allFiles) { @@ -128,22 +148,17 @@ $(document).ready(function() { params, function(result) { if (allFiles) { + if (result.status !== 'success') { + OC.dialogs.alert(result.data.message, t('core', 'Error')); + } FileList.hideMask(); // simply remove all files - $('#fileList').empty(); + FileList.update(''); + enableActions(); } else { - for (var i = 0; i < result.data.success.length; i++) { - var row = document.getElementById(result.data.success[i].filename); - row.parentNode.removeChild(row); - } + removeCallback(result); } - if (result.status !== 'success') { - OC.dialogs.alert(result.data.message, t('core', 'Error')); - } - enableActions(); - FileList.updateFileSummary(); - FileList.updateEmptyContent(); } ); @@ -208,11 +223,9 @@ function getSelectedFiles(property){ var files=[]; elements.each(function(i,element){ var file={ - name:$(element).attr('data-filename'), - file:$('#dir').val() + "/" + $(element).attr('data-file'), + name:$(element).attr('data-file'), timestamp:$(element).attr('data-timestamp'), - type:$(element).attr('data-type'), - dirlisting:$(element).attr('data-dirlisting') + type:$(element).attr('data-type') }; if(property){ files.push(file[property]); -- cgit v1.2.3 From dc6f1d875d7c6f86b07aba8b6f1119083279cd30 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Tue, 18 Feb 2014 12:32:57 +0100 Subject: An admin should not be able to add remote and public services on its own. This should only be possible programmatically. This change is due the fact that an admin may not be expected to execute arbitrary code in every environment. --- core/ajax/appconfig.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/core/ajax/appconfig.php b/core/ajax/appconfig.php index 4f26dedc797..6629d8a664b 100644 --- a/core/ajax/appconfig.php +++ b/core/ajax/appconfig.php @@ -9,28 +9,40 @@ OC_Util::checkAdminUser(); OCP\JSON::callCheck(); $action=isset($_POST['action'])?$_POST['action']:$_GET['action']; +$app=OC_App::cleanAppId(isset($_POST['app'])?$_POST['app']:$_GET['app']); + +// An admin should not be able to add remote and public services +// on its own. This should only be possible programmatically. +// This change is due the fact that an admin may not be expected +// to execute arbitrary code in every environment. +if($app === 'core' && (substr($_POST['key'],0,7) === 'remote_' || substr($_POST['key'],0,7) === 'public_')) { + OC_JSON::error(array('data' => array('message' => 'Unexpected error!'))); + return; +} + $result=false; switch($action) { case 'getValue': - $result=OC_Appconfig::getValue($_GET['app'], $_GET['key'], $_GET['defaultValue']); + $result=OC_Appconfig::getValue($app, $_GET['key'], $_GET['defaultValue']); break; case 'setValue': - $result=OC_Appconfig::setValue($_POST['app'], $_POST['key'], $_POST['value']); + $result=OC_Appconfig::setValue($app, $_POST['key'], $_POST['value']); break; case 'getApps': $result=OC_Appconfig::getApps(); break; case 'getKeys': - $result=OC_Appconfig::getKeys($_GET['app']); + $result=OC_Appconfig::getKeys($app); break; case 'hasKey': - $result=OC_Appconfig::hasKey($_GET['app'], $_GET['key']); + $result=OC_Appconfig::hasKey($app, $_GET['key']); break; case 'deleteKey': - $result=OC_Appconfig::deleteKey($_POST['app'], $_POST['key']); + $result=OC_Appconfig::deleteKey($app, $_POST['key']); break; case 'deleteApp': - $result=OC_Appconfig::deleteApp($_POST['app']); + $result=OC_Appconfig::deleteApp($app); break; } OC_JSON::success(array('data'=>$result)); + -- cgit v1.2.3 From 1352c63dca25b04594cbdfeb8c832351997a1d14 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Tue, 18 Feb 2014 12:47:05 +0100 Subject: Check whether the Key is set --- core/ajax/appconfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ajax/appconfig.php b/core/ajax/appconfig.php index 6629d8a664b..1d066d9169a 100644 --- a/core/ajax/appconfig.php +++ b/core/ajax/appconfig.php @@ -15,7 +15,7 @@ $app=OC_App::cleanAppId(isset($_POST['app'])?$_POST['app']:$_GET['app']); // on its own. This should only be possible programmatically. // This change is due the fact that an admin may not be expected // to execute arbitrary code in every environment. -if($app === 'core' && (substr($_POST['key'],0,7) === 'remote_' || substr($_POST['key'],0,7) === 'public_')) { +if($app === 'core' && isset($_POST['key']) &&(substr($_POST['key'],0,7) === 'remote_' || substr($_POST['key'],0,7) === 'public_')) { OC_JSON::error(array('data' => array('message' => 'Unexpected error!'))); return; } -- cgit v1.2.3 From c19cacb29f263558f052ccd8d78033d63326589e Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Tue, 18 Feb 2014 14:12:49 +0100 Subject: Check whether the app is set --- core/ajax/appconfig.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/ajax/appconfig.php b/core/ajax/appconfig.php index 1d066d9169a..05b7572c6d7 100644 --- a/core/ajax/appconfig.php +++ b/core/ajax/appconfig.php @@ -9,7 +9,10 @@ OC_Util::checkAdminUser(); OCP\JSON::callCheck(); $action=isset($_POST['action'])?$_POST['action']:$_GET['action']; -$app=OC_App::cleanAppId(isset($_POST['app'])?$_POST['app']:$_GET['app']); + +if(isset($_POST['app']) || isset($_GET['app'])) { + $app=OC_App::cleanAppId(isset($_POST['app'])?$_POST['app']:$_GET['app']); +} // An admin should not be able to add remote and public services // on its own. This should only be possible programmatically. -- cgit v1.2.3 From 2166683e3b5810bfeca2540a038e212fb8ca75ed Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 18 Feb 2014 16:31:40 +0100 Subject: Allow setting the frequency of which the file watcher checks for updates --- lib/private/files/cache/watcher.php | 46 ++++++++++++++++++++++++++----------- tests/lib/files/view.php | 3 +++ 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/lib/private/files/cache/watcher.php b/lib/private/files/cache/watcher.php index 251ecbe7071..48aa6f853ce 100644 --- a/lib/private/files/cache/watcher.php +++ b/lib/private/files/cache/watcher.php @@ -12,6 +12,14 @@ namespace OC\Files\Cache; * check the storage backends for updates and change the cache accordingly */ class Watcher { + const CHECK_NEVER = 0; // never check the underlying filesystem for updates + const CHECK_ONCE = 1; // check the underlying filesystem for updates once every request for each file + const CHECK_ALWAYS = 2; // always check the underlying filesystem for updates + + protected $watchPolicy = self::CHECK_ONCE; + + protected $checkedPaths = array(); + /** * @var \OC\Files\Storage\Storage $storage */ @@ -23,7 +31,7 @@ class Watcher { protected $cache; /** - * @var Scanner $scanner; + * @var Scanner $scanner ; */ protected $scanner; @@ -36,6 +44,13 @@ class Watcher { $this->scanner = $storage->getScanner(); } + /** + * @param int $policy either \OC\Files\Cache\Watcher::UPDATE_NEVER, \OC\Files\Cache\Watcher::UPDATE_ONCE, \OC\Files\Cache\Watcher::UPDATE_ALWAYS + */ + public function setPolicy($policy) { + $this->watchPolicy = $policy; + } + /** * check $path for updates * @@ -43,20 +58,25 @@ class Watcher { * @return boolean | array true if path was updated, otherwise the cached data is returned */ public function checkUpdate($path) { - $cachedEntry = $this->cache->get($path); - if ($this->storage->hasUpdated($path, $cachedEntry['storage_mtime'])) { - if ($this->storage->is_dir($path)) { - $this->scanner->scan($path, Scanner::SCAN_SHALLOW); - } else { - $this->scanner->scanFile($path); - } - if ($cachedEntry['mimetype'] === 'httpd/unix-directory') { - $this->cleanFolder($path); + if ($this->watchPolicy === self::CHECK_ALWAYS or ($this->watchPolicy === self::CHECK_ONCE and array_search($path, $this->checkedPaths) === false)) { + $cachedEntry = $this->cache->get($path); + $this->checkedPaths[] = $path; + if ($this->storage->hasUpdated($path, $cachedEntry['storage_mtime'])) { + if ($this->storage->is_dir($path)) { + $this->scanner->scan($path, Scanner::SCAN_SHALLOW); + } else { + $this->scanner->scanFile($path); + } + if ($cachedEntry['mimetype'] === 'httpd/unix-directory') { + $this->cleanFolder($path); + } + $this->cache->correctFolderSize($path); + return true; } - $this->cache->correctFolderSize($path); - return true; + return $cachedEntry; + } else { + return false; } - return $cachedEntry; } /** diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php index 72a2f854cb2..371d1ed1798 100644 --- a/tests/lib/files/view.php +++ b/tests/lib/files/view.php @@ -7,6 +7,8 @@ namespace Test\Files; +use OC\Files\Cache\Watcher; + class TemporaryNoTouch extends \OC\Files\Storage\Temporary { public function touch($path, $mtime = null) { return false; @@ -249,6 +251,7 @@ class View extends \PHPUnit_Framework_TestCase { function testWatcher() { $storage1 = $this->getTestStorage(); \OC\Files\Filesystem::mount($storage1, array(), '/'); + $storage1->getWatcher()->setPolicy(Watcher::CHECK_ALWAYS); $rootView = new \OC\Files\View(''); -- cgit v1.2.3 From 797e0a614cc44e627a54dfd39ce4047d176ebd9b Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 10 Jan 2014 16:14:37 +0100 Subject: Added extra checks for invalid file chars in newfile.php and newfolder.php - added PHP utility function to check for file name validity - fixes issue where a user can create a file called ".." from the files UI - added extra checks to make sure newfile.php and newfolder.php also check for invalid characters --- apps/files/ajax/newfile.php | 14 +++++++++---- apps/files/ajax/newfolder.php | 4 ++-- lib/private/util.php | 21 +++++++++++++++++++ lib/public/constants.php | 3 +++ lib/public/util.php | 9 ++++++++ tests/lib/util.php | 48 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 93 insertions(+), 6 deletions(-) diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php index 1853098c507..0187b200759 100644 --- a/apps/files/ajax/newfile.php +++ b/apps/files/ajax/newfile.php @@ -50,16 +50,22 @@ $l10n = \OC_L10n::get('files'); $result = array( 'success' => false, 'data' => NULL - ); +); +$trimmedFileName = trim($filename); -if(trim($filename) === '') { +if($trimmedFileName === '') { $result['data'] = array('message' => (string)$l10n->t('File name cannot be empty.')); OCP\JSON::error($result); exit(); } +if($trimmedFileName === '.' || $trimmedFileName === '..') { + $result['data'] = array('message' => (string)$l10n->t('"%s" is an invalid file name.', $trimmedFileName)); + OCP\JSON::error($result); + exit(); +} -if(strpos($filename, '/') !== false) { - $result['data'] = array('message' => (string)$l10n->t('File name must not contain "/". Please choose a different name.')); +if(!OCP\Util::isValidFileName($filename)) { + $result['data'] = array('message' => (string)$l10n->t("Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed.")); OCP\JSON::error($result); exit(); } diff --git a/apps/files/ajax/newfolder.php b/apps/files/ajax/newfolder.php index 4cfcae3090d..b2b4fb27f74 100644 --- a/apps/files/ajax/newfolder.php +++ b/apps/files/ajax/newfolder.php @@ -23,8 +23,8 @@ if(trim($foldername) === '') { exit(); } -if(strpos($foldername, '/') !== false) { - $result['data'] = array('message' => $l10n->t('Folder name must not contain "/". Please choose a different name.')); +if(!OCP\Util::isValidFileName($foldername)) { + $result['data'] = array('message' => (string)$l10n->t("Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed.")); OCP\JSON::error($result); exit(); } diff --git a/lib/private/util.php b/lib/private/util.php index 0585749d615..bdc762d4bef 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -1149,4 +1149,25 @@ class OC_Util { } return $version; } + + /** + * Returns whether the given file name is valid + * @param $file string file name to check + * @return bool true if the file name is valid, false otherwise + */ + public static function isValidFileName($file) { + $trimmed = trim($file); + if ($trimmed === '') { + return false; + } + if ($trimmed === '.' || $trimmed === '..') { + return false; + } + foreach (str_split($trimmed) as $char) { + if (strpos(\OCP\FILENAME_INVALID_CHARS, $char) !== false) { + return false; + } + } + return true; + } } diff --git a/lib/public/constants.php b/lib/public/constants.php index 1495c620dc9..350646a0ac0 100644 --- a/lib/public/constants.php +++ b/lib/public/constants.php @@ -35,3 +35,6 @@ const PERMISSION_UPDATE = 2; const PERMISSION_DELETE = 8; const PERMISSION_SHARE = 16; const PERMISSION_ALL = 31; + +const FILENAME_INVALID_CHARS = "\\/<>:\"|?*\n"; + diff --git a/lib/public/util.php b/lib/public/util.php index 570283e2a8a..585c5d22634 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -486,4 +486,13 @@ class Util { public static function uploadLimit() { return \OC_Helper::uploadLimit(); } + + /** + * Returns whether the given file name is valid + * @param $file string file name to check + * @return bool true if the file name is valid, false otherwise + */ + public static function isValidFileName($file) { + return \OC_Util::isValidFileName($file); + } } diff --git a/tests/lib/util.php b/tests/lib/util.php index bfe68f5f680..ee336aa1118 100644 --- a/tests/lib/util.php +++ b/tests/lib/util.php @@ -170,4 +170,52 @@ class Test_Util extends PHPUnit_Framework_TestCase { array('442aa682de2a64db1e010f50e60fd9c9', 'local::C:\Users\ADMINI~1\AppData\Local\Temp\2/442aa682de2a64db1e010f50e60fd9c9/') ); } + + /** + * @dataProvider filenameValidationProvider + */ + public function testFilenameValidation($file, $valid) { + // private API + $this->assertEquals($valid, \OC_Util::isValidFileName($file)); + // public API + $this->assertEquals($valid, \OCP\Util::isValidFileName($file)); + } + + public function filenameValidationProvider() { + return array( + // valid names + array('boringname', true), + array('something.with.extension', true), + array('now with spaces', true), + array('.a', true), + array('..a', true), + array('.dotfile', true), + array('single\'quote', true), + array(' spaces before', true), + array('spaces after ', true), + array('allowed chars including the crazy ones $%&_-^@!,()[]{}=;#', true), + array('汉字也能用', true), + array('und Ümläüte sind auch willkommen', true), + // disallowed names + array('', false), + array(' ', false), + array('.', false), + array('..', false), + array('back\\slash', false), + array('sl/ash', false), + array('ltgt', false), + array('col:on', false), + array('double"quote', false), + array('pi|pe', false), + array('dont?ask?questions?', false), + array('super*star', false), + array('new\nline', false), + // better disallow these to avoid unexpected trimming to have side effects + array(' ..', false), + array('.. ', false), + array('. ', false), + array(' .', false), + ); + } } -- cgit v1.2.3 From bd71a1b7b66f02b3630da44e24b48e29f3d02f17 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 13 Jan 2014 13:14:05 +0100 Subject: Added file name check in webdav connector - added file name check for the put, rename and setNames() methods which throw a "Bad Request" whenever invalid characters are used - replaced \OC\Filesystem usage with $this->getFS() to be able to write unit tests --- lib/private/connector/sabre/file.php | 10 ++++++-- lib/private/connector/sabre/node.php | 9 +++++-- lib/private/connector/sabre/objecttree.php | 5 ++++ tests/lib/connector/sabre/file.php | 40 ++++++++++++++++++++++++++++++ tests/lib/connector/sabre/objecttree.php | 16 ++++++++++++ 5 files changed, 76 insertions(+), 4 deletions(-) diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php index ed27cef440d..db0726e135c 100644 --- a/lib/private/connector/sabre/file.php +++ b/lib/private/connector/sabre/file.php @@ -58,6 +58,11 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D throw new \Sabre_DAV_Exception_ServiceUnavailable(); } + $fileName = basename($this->path); + if (!\OCP\Util::isValidFileName($fileName)) { + throw new \Sabre_DAV_Exception_BadRequest(); + } + // chunked handling if (isset($_SERVER['HTTP_OC_CHUNKED'])) { return $this->createFileChunked($data); @@ -142,15 +147,16 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D * @throws Sabre_DAV_Exception_Forbidden */ public function delete() { + $fs = $this->getFS(); if ($this->path === 'Shared') { throw new \Sabre_DAV_Exception_Forbidden(); } - if (!\OC\Files\Filesystem::isDeletable($this->path)) { + if (!$fs->isDeletable($this->path)) { throw new \Sabre_DAV_Exception_Forbidden(); } - \OC\Files\Filesystem::unlink($this->path); + $fs->unlink($this->path); // remove properties $this->removeProperties(); diff --git a/lib/private/connector/sabre/node.php b/lib/private/connector/sabre/node.php index 993aa73faeb..bf7a04f5b13 100644 --- a/lib/private/connector/sabre/node.php +++ b/lib/private/connector/sabre/node.php @@ -85,19 +85,24 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr * @return void */ public function setName($name) { + $fs = $this->getFS(); // rename is only allowed if the update privilege is granted - if (!\OC\Files\Filesystem::isUpdatable($this->path)) { + if (!$fs->isUpdatable($this->path)) { throw new \Sabre_DAV_Exception_Forbidden(); } list($parentPath, ) = Sabre_DAV_URLUtil::splitPath($this->path); list(, $newName) = Sabre_DAV_URLUtil::splitPath($name); + if (!\OCP\Util::isValidFileName($newName)) { + throw new \Sabre_DAV_Exception_BadRequest(); + } + $newPath = $parentPath . '/' . $newName; $oldPath = $this->path; - \OC\Files\Filesystem::rename($this->path, $newPath); + $fs->rename($this->path, $newPath); $this->path = $newPath; diff --git a/lib/private/connector/sabre/objecttree.php b/lib/private/connector/sabre/objecttree.php index d1e179af2ec..d2fa425b22c 100644 --- a/lib/private/connector/sabre/objecttree.php +++ b/lib/private/connector/sabre/objecttree.php @@ -105,6 +105,11 @@ class ObjectTree extends \Sabre_DAV_ObjectTree { } } + $fileName = basename($destinationPath); + if (!\OCP\Util::isValidFileName($fileName)) { + throw new \Sabre_DAV_Exception_BadRequest(); + } + $renameOkay = $fs->rename($sourcePath, $destinationPath); if (!$renameOkay) { throw new \Sabre_DAV_Exception_Forbidden(''); diff --git a/tests/lib/connector/sabre/file.php b/tests/lib/connector/sabre/file.php index e1fed0384c6..50b8711a90d 100644 --- a/tests/lib/connector/sabre/file.php +++ b/tests/lib/connector/sabre/file.php @@ -35,6 +35,46 @@ class Test_OC_Connector_Sabre_File extends PHPUnit_Framework_TestCase { $etag = $file->put('test data'); } + /** + * @expectedException Sabre_DAV_Exception_BadRequest + */ + public function testSimplePutInvalidChars() { + // setup + $file = new OC_Connector_Sabre_File('/super*star.txt'); + $file->fileView = $this->getMock('\OC\Files\View', array('file_put_contents'), array(), '', FALSE); + $file->fileView->expects($this->any())->method('file_put_contents')->withAnyParameters()->will($this->returnValue(false)); + + // action + $etag = $file->put('test data'); + } + + /** + * Test setting name with setName() + */ + public function testSetName() { + // setup + $file = new OC_Connector_Sabre_File('/test.txt'); + $file->fileView = $this->getMock('\OC\Files\View', array('isUpdatable'), array(), '', FALSE); + $file->fileView->expects($this->any())->method('isUpdatable')->withAnyParameters()->will($this->returnValue(true)); + $etag = $file->put('test data'); + $file->setName('/renamed.txt'); + $this->assertTrue($file->fileView->file_exists('/renamed.txt')); + // clean up + $file->delete(); + } + + /** + * Test setting name with setName() with invalid chars + * @expectedException Sabre_DAV_Exception_BadRequest + */ + public function testSetNameInvalidChars() { + // setup + $file = new OC_Connector_Sabre_File('/test.txt'); + $file->fileView = $this->getMock('\OC\Files\View', array('isUpdatable'), array(), '', FALSE); + $file->fileView->expects($this->any())->method('isUpdatable')->withAnyParameters()->will($this->returnValue(true)); + $file->setName('/super*star.txt'); + } + /** * @expectedException Sabre_DAV_Exception_Forbidden */ diff --git a/tests/lib/connector/sabre/objecttree.php b/tests/lib/connector/sabre/objecttree.php index e32f2365f95..fb50c736edd 100644 --- a/tests/lib/connector/sabre/objecttree.php +++ b/tests/lib/connector/sabre/objecttree.php @@ -52,6 +52,20 @@ class ObjectTree extends PHPUnit_Framework_TestCase { $this->assertTrue(true); } + /** + * @dataProvider moveFailedInvalidCharsProvider + * @expectedException Sabre_DAV_Exception_BadRequest + */ + public function testMoveFailedInvalidChars($source, $dest, $updatables, $deletables) { + $this->moveTest($source, $dest, $updatables, $deletables); + } + + function moveFailedInvalidCharsProvider() { + return array( + array('a/b', 'a/c*', array('a' => false, 'a/b' => true, 'a/c*' => false), array()), + ); + } + function moveFailedProvider() { return array( array('a/b', 'a/c', array('a' => false, 'a/b' => false, 'a/c' => false), array()), @@ -66,6 +80,8 @@ class ObjectTree extends PHPUnit_Framework_TestCase { return array( array('a/b', 'a/c', array('a' => false, 'a/b' => true, 'a/c' => false), array()), array('a/b', 'b/b', array('a' => true, 'a/b' => true, 'b' => true, 'b/b' => false), array('a/b' => true)), + // older files with special chars can still be renamed to valid names + array('a/b*', 'b/b', array('a' => true, 'a/b*' => true, 'b' => true, 'b/b' => false), array('a/b*' => true)), ); } -- cgit v1.2.3 From adaee6a5a19a4b0050d189736bd4e6183fee9cf0 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Wed, 19 Feb 2014 09:31:54 +0100 Subject: Scrutinizer Auto-Fixes This patch was automatically generated as part of the following inspection: https://scrutinizer-ci.com/g/owncloud/core/inspections/cdfecc4e-a37e-4233-8025-f0d7252a8720 Enabled analysis tools: - PHP Analyzer - JSHint - PHP Copy/Paste Detector - PHP PDepend --- apps/files_encryption/lib/helper.php | 2 +- apps/files_external/lib/google.php | 2 +- apps/files_external/lib/streamwrapper.php | 1 + apps/files_external/lib/webdav.php | 3 +++ apps/files_sharing/lib/cache.php | 2 +- apps/files_sharing/lib/sharedstorage.php | 1 + apps/files_versions/lib/versions.php | 4 ++-- apps/user_ldap/lib/access.php | 12 ++++++++-- apps/user_ldap/lib/connection.php | 3 +++ apps/user_ldap/lib/proxy.php | 8 +++++++ apps/user_ldap/lib/wizard.php | 8 +++---- apps/user_ldap/user_ldap.php | 3 +-- core/command/db/generatechangescript.php | 1 - core/command/status.php | 2 -- core/command/upgrade.php | 2 -- core/command/user/report.php | 2 -- lib/private/app.php | 2 ++ lib/private/appconfig.php | 7 ++++-- lib/private/appframework/app.php | 1 - .../dependencyinjection/dicontainer.php | 1 - lib/private/appframework/http/redirectresponse.php | 4 ++-- .../middleware/middlewaredispatcher.php | 1 - .../middleware/security/securitymiddleware.php | 2 +- lib/private/archive.php | 1 - lib/private/archive/tar.php | 6 +++++ lib/private/archive/zip.php | 4 +++- lib/private/arrayparser.php | 3 +++ lib/private/backgroundjob.php | 2 +- lib/private/backgroundjob/joblist.php | 2 +- lib/private/cache/usercache.php | 2 +- lib/private/config.php | 4 ++-- .../sabre/aborteduploaddetectionplugin.php | 2 +- lib/private/connector/sabre/quotaplugin.php | 1 + lib/private/db.php | 3 ++- lib/private/db/mdb2schemawriter.php | 6 +++++ lib/private/filechunking.php | 2 +- lib/private/fileproxy.php | 1 + lib/private/files.php | 3 +++ lib/private/files/cache/updater.php | 2 -- lib/private/files/fileinfo.php | 4 ++++ lib/private/files/filesystem.php | 3 +++ lib/private/files/node/folder.php | 1 - lib/private/files/node/node.php | 2 -- lib/private/files/node/root.php | 1 - lib/private/files/storage/loader.php | 3 +++ lib/private/files/storage/mappedlocal.php | 6 +++++ lib/private/files/utils/scanner.php | 3 +++ lib/private/geo.php | 4 ++++ lib/private/group.php | 2 +- lib/private/group/dummy.php | 2 +- lib/private/image.php | 9 ++++---- lib/private/installer.php | 27 +--------------------- lib/private/l10n.php | 3 +++ lib/private/legacy/appconfig.php | 2 ++ lib/private/legacy/preferences.php | 2 +- lib/private/migrate.php | 3 ++- lib/private/migration/content.php | 8 +++---- lib/private/migration/provider.php | 2 +- lib/private/ocs.php | 5 +--- lib/private/preferences.php | 2 +- lib/private/request.php | 2 +- lib/private/share/searchresultsorter.php | 4 ++-- lib/private/template/base.php | 4 ++++ lib/private/template/templatefilelocator.php | 1 + lib/private/user.php | 2 ++ lib/private/user/database.php | 2 +- lib/private/util.php | 5 ++-- lib/public/appframework/controller.php | 4 ++-- lib/public/backgroundjob.php | 4 ++-- lib/public/backgroundjob/ijob.php | 1 + lib/public/backgroundjob/ijoblist.php | 7 +++++- lib/public/contacts/imanager.php | 4 ++-- lib/public/files.php | 1 - lib/public/iappconfig.php | 2 ++ lib/public/iconfig.php | 2 +- lib/public/itags.php | 4 ++-- lib/public/share.php | 13 +++++++++++ tests/lib/api.php | 8 +++++++ tests/lib/appframework/http/DispatcherTest.php | 5 +++- tests/lib/appframework/http/ResponseTest.php | 4 ++-- .../middleware/MiddlewareDispatcherTest.php | 3 +++ .../middleware/security/SecurityMiddlewareTest.php | 11 +++++++++ tests/lib/appframework/routing/RoutingTest.php | 13 +++++++++++ tests/lib/dbschema.php | 6 +++++ tests/lib/errorHandler.php | 4 ++++ tests/lib/files/cache/homecache.php | 4 ++++ tests/lib/files/etagtest.php | 3 +++ tests/lib/files/node/integration.php | 3 --- tests/lib/files/node/root.php | 1 - tests/lib/files/storage/home.php | 4 ++++ tests/lib/files/storage/wrapper/quota.php | 3 +++ tests/lib/files/stream/quota.php | 4 ++++ tests/lib/group/backend.php | 4 ++-- tests/lib/group/database.php | 4 ++-- tests/lib/group/group.php | 2 +- tests/lib/migrate.php | 1 + tests/lib/ocs/privatedata.php | 1 + tests/lib/share/share.php | 7 ++++++ tests/lib/template/resourcelocator.php | 5 ++++ tests/lib/user.php | 2 -- tests/testcleanuplistener.php | 3 +++ 101 files changed, 260 insertions(+), 119 deletions(-) diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php index 5ec09629d62..ef3775875f0 100755 --- a/apps/files_encryption/lib/helper.php +++ b/apps/files_encryption/lib/helper.php @@ -425,7 +425,7 @@ class Helper { /** * @brief glob uses different pattern than regular expressions, escape glob pattern only * @param string $path unescaped path - * @return escaped path + * @return string path */ public static function escapeGlobPattern($path) { return preg_replace('/(\*|\?|\[)/', '[$1]', $path); diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php index 064c1e20a93..35457f68528 100644 --- a/apps/files_external/lib/google.php +++ b/apps/files_external/lib/google.php @@ -67,7 +67,7 @@ class Google extends \OC\Files\Storage\Common { /** * Get the Google_DriveFile object for the specified path * @param string $path - * @return Google_DriveFile|false + * @return string */ private function getDriveFile($path) { // Remove leading and trailing slashes diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php index 3e3dc3e3af5..44bd9a0161a 100644 --- a/apps/files_external/lib/streamwrapper.php +++ b/apps/files_external/lib/streamwrapper.php @@ -11,6 +11,7 @@ namespace OC\Files\Storage; abstract class StreamWrapper extends Common { /** + * @param string $path * @return string|null */ abstract public function constructUrl($path); diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php index c64b2d8b73a..7611316a26a 100644 --- a/apps/files_external/lib/webdav.php +++ b/apps/files_external/lib/webdav.php @@ -336,6 +336,9 @@ class DAV extends \OC\Files\Storage\Common{ } } + /** + * @param string $path + */ public function cleanPath($path) { $path = \OC\Files\Filesystem::normalizePath($path); // remove leading slash diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index 7d63e7a4fe3..aadc54e4a7f 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -396,7 +396,7 @@ class Shared_Cache extends Cache { * use the one with the highest id gives the best result with the background scanner, since that is most * likely the folder where we stopped scanning previously * - * @return string|bool the path of the folder or false when no folder matched + * @return boolean the path of the folder or false when no folder matched */ public function getIncomplete() { return false; diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index ebd16f081ba..b922654e5ec 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -41,6 +41,7 @@ class Shared extends \OC\Files\Storage\Common { /** * @brief Get the source file path, permissions, and owner for a shared file * @param string Shared target file path + * @param string $target * @return Returns array with the keys path, permissions, and owner or false if not found */ public function getFile($target) { diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index fc0bf3bfad0..2bd9c15bae4 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -336,7 +336,7 @@ class Storage { * @brief deletes used space for files versions in db if user was deleted * * @param type $uid id of deleted user - * @return result of db delete operation + * @return \OC_DB_StatementWrapper of db delete operation */ public static function deleteUser($uid) { $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_versions` WHERE `user`=?'); @@ -420,8 +420,8 @@ class Storage { /** * @brief get list of files we want to expire - * @param integer $currentTime timestamp of current time * @param array $versions list of versions + * @param integer $time * @return array containing the list of to deleted versions and the size of them */ protected static function getExpireList($time, $versions) { diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 8a8d8aa5e3a..6795aecafee 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -164,6 +164,7 @@ class Access extends LDAPUtility { /** * gives back the database table for the query + * @param boolean $isUser */ private function getMapTable($isUser) { if($isUser) { @@ -644,6 +645,8 @@ class Access extends LDAPUtility { * @brief executes an LDAP search, optimized for Users * @param $filter the LDAP filter for the search * @param $attr optional, when a certain attribute shall be filtered out + * @param integer $limit + * @param integer $offset * @returns array with the search result * * Executes an LDAP search @@ -661,8 +664,10 @@ class Access extends LDAPUtility { /** * @brief executes an LDAP search, optimized for Groups - * @param $filter the LDAP filter for the search + * @param string $filter the LDAP filter for the search * @param $attr optional, when a certain attribute shall be filtered out + * @param integer $limit + * @param integer $offset * @returns array with the search result * * Executes an LDAP search @@ -757,7 +762,7 @@ class Access extends LDAPUtility { /** * @brief executes an LDAP search, but counts the results only - * @param $filter the LDAP filter for the search + * @param string $filter the LDAP filter for the search * @param $base an array containing the LDAP subtree(s) that shall be searched * @param $attr optional, array, one or more attributes that shall be * retrieved. Results will according to the order in the array. @@ -1006,6 +1011,9 @@ class Access extends LDAPUtility { return $this->combineFilterWithOr($filter); } + /** + * @param string $password + */ public function areCredentialsValid($name, $password) { $name = $this->DNasBaseParameter($name); $testConnection = clone $this->connection; diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php index 19870550163..b2075748a3b 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/connection.php @@ -159,6 +159,9 @@ class Connection extends LDAPUtility { return unserialize(base64_decode($this->cache->get($key))); } + /** + * @param string $key + */ public function isCached($key) { if(!$this->configured) { $this->readConfiguration(); diff --git a/apps/user_ldap/lib/proxy.php b/apps/user_ldap/lib/proxy.php index b68910ff97f..b27233bcd19 100644 --- a/apps/user_ldap/lib/proxy.php +++ b/apps/user_ldap/lib/proxy.php @@ -56,8 +56,13 @@ abstract class Proxy { /** * @param boolean $passOnWhen + * @param string $method */ abstract protected function callOnLastSeenOn($id, $method, $parameters, $passOnWhen); + + /** + * @param string $method + */ abstract protected function walkBackends($id, $method, $parameters); /** @@ -95,6 +100,9 @@ abstract class Proxy { return unserialize(base64_decode($this->cache->get($key))); } + /** + * @param string $key + */ public function isCached($key) { $key = $this->getCacheKey($key); return $this->cache->hasKey($key); diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php index 5079642d954..e79090febc1 100644 --- a/apps/user_ldap/lib/wizard.php +++ b/apps/user_ldap/lib/wizard.php @@ -865,8 +865,8 @@ class Wizard extends LDAPUtility { /** * @brief does a cumulativeSearch on LDAP to get different values of a * specified attribute - * @param $filters array, the filters that shall be used in the search - * @param $attr the attribute of which a list of values shall be returned + * @param string[] $filters array, the filters that shall be used in the search + * @param string $attr the attribute of which a list of values shall be returned * @param $lfw bool, whether the last filter is a wildcard which shall not * be processed if there were already findings, defaults to true * @param string $maxF string. if not null, this variable will have the filter that @@ -933,8 +933,8 @@ class Wizard extends LDAPUtility { * @brief determines if and which $attr are available on the LDAP server * @param string[] $objectclasses the objectclasses to use as search filter * @param string $attr the attribute to look for - * @param $dbkey the dbkey of the setting the feature is connected to - * @param $confkey the confkey counterpart for the $dbkey as used in the + * @param string $dbkey the dbkey of the setting the feature is connected to + * @param string $confkey the confkey counterpart for the $dbkey as used in the * Configuration class * @param $po boolean, whether the objectClass with most result entries * shall be pre-selected via the result diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php index 1088dafab71..4a147cf9884 100644 --- a/apps/user_ldap/user_ldap.php +++ b/apps/user_ldap/user_ldap.php @@ -25,7 +25,6 @@ namespace OCA\user_ldap; -use OCA\user_ldap\lib\ILDAPWrapper; use OCA\user_ldap\lib\BackendUtility; class USER_LDAP extends BackendUtility implements \OCP\UserInterface { @@ -139,7 +138,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { * @brief reads the image from LDAP that shall be used as Avatar * @param $uid string, the ownCloud user name * @param $dn string, the user DN - * @return image data (provided by LDAP) | false + * @return string data (provided by LDAP) | false */ private function getAvatarImage($uid, $dn) { $attributes = array('jpegPhoto', 'thumbnailPhoto'); diff --git a/core/command/db/generatechangescript.php b/core/command/db/generatechangescript.php index f971124cfdc..a4d710aa974 100644 --- a/core/command/db/generatechangescript.php +++ b/core/command/db/generatechangescript.php @@ -11,7 +11,6 @@ namespace OC\Core\Command\Db; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class GenerateChangeScript extends Command { diff --git a/core/command/status.php b/core/command/status.php index ea9825b0f61..6bc1dba44aa 100644 --- a/core/command/status.php +++ b/core/command/status.php @@ -9,9 +9,7 @@ namespace OC\Core\Command; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class Status extends Command { diff --git a/core/command/upgrade.php b/core/command/upgrade.php index 1d105b67a06..128d27aa3db 100644 --- a/core/command/upgrade.php +++ b/core/command/upgrade.php @@ -10,9 +10,7 @@ namespace OC\Core\Command; use OC\Updater; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class Upgrade extends Command { diff --git a/core/command/user/report.php b/core/command/user/report.php index f95ba251bcc..70c5a8566b7 100644 --- a/core/command/user/report.php +++ b/core/command/user/report.php @@ -9,10 +9,8 @@ namespace OC\Core\Command\User; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Helper\TableHelper; class Report extends Command { protected function configure() { diff --git a/lib/private/app.php b/lib/private/app.php index e60a8a4e0b1..47f983cce35 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -640,6 +640,8 @@ class OC_App{ /** * register an admin form to be shown + * @param string $app + * @param string $page */ public static function registerAdmin($app, $page) { self::$adminForms[]= $app.'/'.$page.'.php'; diff --git a/lib/private/appconfig.php b/lib/private/appconfig.php index a32c1126c7b..cdaaebb87e5 100644 --- a/lib/private/appconfig.php +++ b/lib/private/appconfig.php @@ -69,6 +69,9 @@ class AppConfig implements \OCP\IAppConfig { return $this->cache[$app]; } + /** + * @param string $app + */ private function getAppValues($app) { $appCache = $this->getAppCache($app); if (array_search($app, $this->appsLoaded) === false) { @@ -184,7 +187,7 @@ class AppConfig implements \OCP\IAppConfig { * @brief Deletes a key * @param string $app app * @param string $key key - * @return bool + * @return boolean|null */ public function deleteKey($app, $key) { $where = array( @@ -200,7 +203,7 @@ class AppConfig implements \OCP\IAppConfig { /** * @brief Remove app from appconfig * @param string $app app - * @return bool + * @return boolean|null * * Removes all keys in appconfig belonging to the app. */ diff --git a/lib/private/appframework/app.php b/lib/private/appframework/app.php index b835188661a..3b13194862d 100644 --- a/lib/private/appframework/app.php +++ b/lib/private/appframework/app.php @@ -25,7 +25,6 @@ namespace OC\AppFramework; use OC\AppFramework\DependencyInjection\DIContainer; -use OCP\AppFramework\IAppContainer; /** diff --git a/lib/private/appframework/dependencyinjection/dicontainer.php b/lib/private/appframework/dependencyinjection/dicontainer.php index b6ccf60db4b..4821ecaf67b 100644 --- a/lib/private/appframework/dependencyinjection/dicontainer.php +++ b/lib/private/appframework/dependencyinjection/dicontainer.php @@ -34,7 +34,6 @@ use OC\AppFramework\Utility\SimpleContainer; use OC\AppFramework\Utility\TimeFactory; use OCP\AppFramework\IApi; use OCP\AppFramework\IAppContainer; -use OCP\AppFramework\IMiddleWare; use OCP\AppFramework\Middleware; use OCP\IServerContainer; diff --git a/lib/private/appframework/http/redirectresponse.php b/lib/private/appframework/http/redirectresponse.php index 5c4e1c06dc3..05353349065 100644 --- a/lib/private/appframework/http/redirectresponse.php +++ b/lib/private/appframework/http/redirectresponse.php @@ -24,8 +24,8 @@ namespace OC\AppFramework\Http; -use OCP\AppFramework\Http\Response, - OCP\AppFramework\Http; +use OCP\AppFramework\Http\Response; +use OCP\AppFramework\Http; /** diff --git a/lib/private/appframework/middleware/middlewaredispatcher.php b/lib/private/appframework/middleware/middlewaredispatcher.php index 598743e523f..2a715598fc4 100644 --- a/lib/private/appframework/middleware/middlewaredispatcher.php +++ b/lib/private/appframework/middleware/middlewaredispatcher.php @@ -26,7 +26,6 @@ namespace OC\AppFramework\Middleware; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Response; -use OCP\AppFramework\MiddleWare; /** * This class is used to store and run all the middleware in correct order diff --git a/lib/private/appframework/middleware/security/securitymiddleware.php b/lib/private/appframework/middleware/security/securitymiddleware.php index c3143754823..bb02d565fa4 100644 --- a/lib/private/appframework/middleware/security/securitymiddleware.php +++ b/lib/private/appframework/middleware/security/securitymiddleware.php @@ -66,7 +66,7 @@ class SecurityMiddleware extends Middleware { * This runs all the security checks before a method call. The * security checks are determined by inspecting the controller method * annotations - * @param string/Controller $controller the controllername or string + * @param string $controller the controllername or string * @param string $methodName the name of the method * @throws SecurityException when a security check fails */ diff --git a/lib/private/archive.php b/lib/private/archive.php index a18f8d3ffbd..6f51066ddf8 100644 --- a/lib/private/archive.php +++ b/lib/private/archive.php @@ -88,7 +88,6 @@ abstract class OC_Archive{ abstract function extractFile($path, $dest); /** * extract the archive - * @param string $path * @param string $dest * @return bool */ diff --git a/lib/private/archive/tar.php b/lib/private/archive/tar.php index 5538e027ab4..cbdb565ba35 100644 --- a/lib/private/archive/tar.php +++ b/lib/private/archive/tar.php @@ -22,6 +22,9 @@ class OC_Archive_TAR extends OC_Archive{ private $tar=null; private $path; + /** + * @param string $source + */ function __construct($source) { $types=array(null, 'gz', 'bz'); $this->path=$source; @@ -122,6 +125,9 @@ class OC_Archive_TAR extends OC_Archive{ return true; } + /** + * @param string $file + */ private function getHeader($file) { if ( ! $this->cachedHeaders ) { $this->cachedHeaders = $this->tar->listContent(); diff --git a/lib/private/archive/zip.php b/lib/private/archive/zip.php index cd5479299a1..fa5630d7665 100644 --- a/lib/private/archive/zip.php +++ b/lib/private/archive/zip.php @@ -13,6 +13,9 @@ class OC_Archive_ZIP extends OC_Archive{ private $zip=null; private $path; + /** + * @param string $source + */ function __construct($source) { $this->path=$source; $this->zip=new ZipArchive(); @@ -125,7 +128,6 @@ class OC_Archive_ZIP extends OC_Archive{ } /** * extract the archive - * @param string $path * @param string $dest * @return bool */ diff --git a/lib/private/arrayparser.php b/lib/private/arrayparser.php index c4ad1264fbb..d353e486577 100644 --- a/lib/private/arrayparser.php +++ b/lib/private/arrayparser.php @@ -39,6 +39,9 @@ class ArrayParser { return $this->parse($string); } + /** + * @param string $string + */ function stripPHPTags($string) { $string = trim($string); if (substr($string, 0, 5) === 'addChild('name', $column->getName()); switch($column->getType()) { @@ -114,6 +117,9 @@ class OC_DB_MDB2SchemaWriter { } } + /** + * @param SimpleXMLElement $xml + */ private static function saveIndex($index, $xml) { $xml->addChild('name', $index->getName()); if ($index->isPrimary()) { diff --git a/lib/private/filechunking.php b/lib/private/filechunking.php index 09b30af48b2..be7f4e14a11 100644 --- a/lib/private/filechunking.php +++ b/lib/private/filechunking.php @@ -41,7 +41,7 @@ class OC_FileChunking { * Stores the given $data under the given $key - the number of stored bytes is returned * * @param string $index - * @param $data + * @param resource $data * @return int */ public function store($index, $data) { diff --git a/lib/private/fileproxy.php b/lib/private/fileproxy.php index 62187e1ec74..88976c1b8e5 100644 --- a/lib/private/fileproxy.php +++ b/lib/private/fileproxy.php @@ -110,6 +110,7 @@ class OC_FileProxy{ /** * @param string $operation + * @param string|boolean $path * * @return string */ diff --git a/lib/private/files.php b/lib/private/files.php index 4a6b9d8ca0e..6a6916537d4 100644 --- a/lib/private/files.php +++ b/lib/private/files.php @@ -32,6 +32,9 @@ class OC_Files { return \OC\Files\Filesystem::getFileInfo($path, $includeMountPoints); } + /** + * @param string $path + */ static public function getDirectoryContent($path){ return \OC\Files\Filesystem::getDirectoryContent($path); } diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php index e4114e572fe..7a45b9e9e96 100644 --- a/lib/private/files/cache/updater.php +++ b/lib/private/files/cache/updater.php @@ -8,8 +8,6 @@ namespace OC\Files\Cache; -use OCP\Util; - /** * listen to filesystem hooks and change the cache accordingly */ diff --git a/lib/private/files/fileinfo.php b/lib/private/files/fileinfo.php index c77571cd2a7..2dbdd80a26b 100644 --- a/lib/private/files/fileinfo.php +++ b/lib/private/files/fileinfo.php @@ -29,6 +29,10 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { */ private $internalPath; + /** + * @param string|boolean $path + * @param Storage\Storage $storage + */ public function __construct($path, $storage, $internalPath, $data) { $this->path = $path; $this->storage = $storage; diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php index d1ebad3490c..0face6aa3bb 100644 --- a/lib/private/files/filesystem.php +++ b/lib/private/files/filesystem.php @@ -668,6 +668,9 @@ class Filesystem { return self::$defaultInstance->search($query); } + /** + * @param string $query + */ static public function searchByMime($query) { return self::$defaultInstance->searchByMime($query); } diff --git a/lib/private/files/node/folder.php b/lib/private/files/node/folder.php index 923f53821b2..d9e0ddc2d61 100644 --- a/lib/private/files/node/folder.php +++ b/lib/private/files/node/folder.php @@ -9,7 +9,6 @@ namespace OC\Files\Node; use OC\Files\Cache\Cache; -use OC\Files\Cache\Scanner; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; diff --git a/lib/private/files/node/node.php b/lib/private/files/node/node.php index 643a587dfc2..bc075911749 100644 --- a/lib/private/files/node/node.php +++ b/lib/private/files/node/node.php @@ -8,8 +8,6 @@ namespace OC\Files\Node; -use OC\Files\Cache\Cache; -use OC\Files\Cache\Scanner; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; diff --git a/lib/private/files/node/root.php b/lib/private/files/node/root.php index a22a2aaf4e9..70135285b0d 100644 --- a/lib/private/files/node/root.php +++ b/lib/private/files/node/root.php @@ -9,7 +9,6 @@ namespace OC\Files\Node; use OC\Files\Cache\Cache; -use OC\Files\Cache\Scanner; use OC\Files\Mount\Manager; use OC\Files\Mount\Mount; use OCP\Files\NotFoundException; diff --git a/lib/private/files/storage/loader.php b/lib/private/files/storage/loader.php index 734131261c8..966234cb04d 100644 --- a/lib/private/files/storage/loader.php +++ b/lib/private/files/storage/loader.php @@ -33,6 +33,9 @@ class Loader { return $this->wrap($mountPoint, new $class($arguments)); } + /** + * @param string|boolean $mountPoint + */ public function wrap($mountPoint, $storage) { foreach ($this->storageWrappers as $wrapper) { $storage = $wrapper($mountPoint, $storage); diff --git a/lib/private/files/storage/mappedlocal.php b/lib/private/files/storage/mappedlocal.php index c8b22cfb39f..1bab3489a28 100644 --- a/lib/private/files/storage/mappedlocal.php +++ b/lib/private/files/storage/mappedlocal.php @@ -326,12 +326,18 @@ class MappedLocal extends \OC\Files\Storage\Common{ return $this->filemtime($path)>$time; } + /** + * @param string $path + */ private function buildPath($path, $create=true) { $path = $this->stripLeading($path); $fullPath = $this->datadir.$path; return $this->mapper->logicToPhysical($fullPath, $create); } + /** + * @param string $path + */ private function cleanMapper($path, $isLogicPath=true, $recursive=true) { $fullPath = $path; if ($isLogicPath) { diff --git a/lib/private/files/utils/scanner.php b/lib/private/files/utils/scanner.php index 558bc60cf06..a802a8fcb8b 100644 --- a/lib/private/files/utils/scanner.php +++ b/lib/private/files/utils/scanner.php @@ -69,6 +69,9 @@ class Scanner extends PublicEmitter { }); } + /** + * @param string $dir + */ public function backgroundScan($dir) { $mounts = $this->getMounts($dir); foreach ($mounts as $mount) { diff --git a/lib/private/geo.php b/lib/private/geo.php index ed01ad0b616..7094d885af6 100644 --- a/lib/private/geo.php +++ b/lib/private/geo.php @@ -12,6 +12,10 @@ class OC_Geo{ * @param (string) $longitude - Longitude * @return (string) $timezone - closest timezone */ + /** + * @param integer $latitude + * @param integer $longitude + */ public static function timezone($latitude, $longitude) { $alltimezones = DateTimeZone::listIdentifiers(); $variances = array(); diff --git a/lib/private/group.php b/lib/private/group.php index 444788c97f1..4c187b538af 100644 --- a/lib/private/group.php +++ b/lib/private/group.php @@ -243,7 +243,7 @@ class OC_Group { /** * @brief get a list of all users in several groups - * @param array $gids + * @param string[] $gids * @param string $search * @param int $limit * @param int $offset diff --git a/lib/private/group/dummy.php b/lib/private/group/dummy.php index 9516fd52ff8..da26e1b910e 100644 --- a/lib/private/group/dummy.php +++ b/lib/private/group/dummy.php @@ -28,7 +28,7 @@ class OC_Group_Dummy extends OC_Group_Backend { private $groups=array(); /** * @brief Try to create a new group - * @param $gid The name of the group to create + * @param string $gid The name of the group to create * @returns true/false * * Trys to create a new group. If the group name already exists, false will diff --git a/lib/private/image.php b/lib/private/image.php index 42afa35ea56..42685ddab5c 100644 --- a/lib/private/image.php +++ b/lib/private/image.php @@ -34,7 +34,7 @@ class OC_Image { /** * @brief Get mime type for an image file. - * @param $filepath The path to a local image file. + * @param string|null $filepath The path to a local image file. * @returns string The mime type if the it could be determined, otherwise an empty string. */ static public function getMimeTypeForFile($filePath) { @@ -163,6 +163,7 @@ class OC_Image { /** * @brief Saves the image. * @returns bool + * @param string $filePath */ public function save($filePath=null) { @@ -704,7 +705,7 @@ class OC_Image { /** * @brief Resizes the image preserving ratio. - * @param integer $maxsize The maximum size of either the width or height. + * @param integer $maxSize The maximum size of either the width or height. * @returns bool */ public function resize($maxSize) { @@ -852,8 +853,8 @@ class OC_Image { /** * @brief Resizes the image to fit within a boundry while preserving ratio. - * @param $maxWidth - * @param $maxHeight + * @param integer $maxWidth + * @param integer $maxHeight * @returns bool */ public function fitIn($maxWidth, $maxHeight) { diff --git a/lib/private/installer.php b/lib/private/installer.php index 1b974c6e5a5..fe7417990c8 100644 --- a/lib/private/installer.php +++ b/lib/private/installer.php @@ -236,30 +236,6 @@ class OC_Installer{ /** * @brief Update an application - * @param array $data with all information - * - * This function installs an app. All information needed are passed in the - * associative array $data. - * The following keys are required: - * - source: string, can be "path" or "http" - * - * One of the following keys is required: - * - path: path to the file containing the app - * - href: link to the downloadable file containing the app - * - * The following keys are optional: - * - pretend: boolean, if set true the system won't do anything - * - noupgrade: boolean, if true appinfo/upgrade.php won't be loaded - * - * This function works as follows - * -# fetching the file - * -# removing the old files - * -# unzipping new file - * -# including appinfo/upgrade.php - * -# setting the installed version - * - * upgrade.php can determine the current installed version of the app using - * "OC_Appconfig::getValue($appid, 'installed_version')" */ public static function updateApp( $app ) { $ocsid=OC_Appconfig::getValue( $app, 'ocsid'); @@ -270,7 +246,6 @@ class OC_Installer{ /** * @brief Check if an update for the app is available - * @param string $name name of the application * @return string|false false or the version number of the update * * The function will check if an update for a version is available @@ -316,7 +291,7 @@ class OC_Installer{ * @brief Removes an app * @param string $name name of the application to remove * @param $options array with options - * @return boolean + * @return boolean|null * * This function removes an app. $options is an associative array. The * following keys are optional:ja diff --git a/lib/private/l10n.php b/lib/private/l10n.php index 1d8152c5844..1ade18ea427 100644 --- a/lib/private/l10n.php +++ b/lib/private/l10n.php @@ -99,6 +99,9 @@ class OC_L10N implements \OCP\IL10N { $this->lang = $lang; } + /** + * @param string $transFile + */ public function load($transFile) { $this->app = true; include $transFile; diff --git a/lib/private/legacy/appconfig.php b/lib/private/legacy/appconfig.php index 46a8068c3b4..b6c3542a673 100644 --- a/lib/private/legacy/appconfig.php +++ b/lib/private/legacy/appconfig.php @@ -118,6 +118,8 @@ class OC_Appconfig { * * @param app * @param key + * @param string|false $app + * @param string|false $key * @return array */ public static function getValues($app, $key) { diff --git a/lib/private/legacy/preferences.php b/lib/private/legacy/preferences.php index a663db7598b..fcde12796ca 100644 --- a/lib/private/legacy/preferences.php +++ b/lib/private/legacy/preferences.php @@ -41,7 +41,7 @@ class OC_Preferences{ /** * @brief Get all apps of a user * @param string $user user - * @return array with app ids + * @return integer[] with app ids * * This function returns a list of all apps of the user that have at least * one entry in the preferences table. diff --git a/lib/private/migrate.php b/lib/private/migrate.php index b930b719289..3fb3e334ea2 100644 --- a/lib/private/migrate.php +++ b/lib/private/migrate.php @@ -431,6 +431,7 @@ class OC_Migrate{ /** * @brief connects to migration.db, or creates if not found * @param $db optional path to migration.db, defaults to user data dir + * @param string $path * @return bool whether the operation was successful */ static private function connectDB( $path=null ) { @@ -460,7 +461,7 @@ class OC_Migrate{ /** * @brief creates the tables in migration.db from an apps database.xml - * @param $appid string id of the app + * @param string $appid string id of the app * @return bool whether the operation was successful */ static private function createAppTables( $appid ) { diff --git a/lib/private/migration/content.php b/lib/private/migration/content.php index e7b6543171a..43eba89b8d5 100644 --- a/lib/private/migration/content.php +++ b/lib/private/migration/content.php @@ -34,9 +34,9 @@ class OC_Migration_Content{ /** * @brief sets up the - * @param $zip ZipArchive object + * @param ZipArchive $zip ZipArchive object * @param $db a database object (required for exporttype user) - * @return bool + * @return boolean|null */ public function __construct( $zip, $db=null ) { @@ -74,7 +74,7 @@ class OC_Migration_Content{ /** * @brief processes the db query - * @param $query the query to process + * @param string $query the query to process * @return string of processed query */ private function processQuery( $query ) { @@ -130,7 +130,7 @@ class OC_Migration_Content{ /** * @brief saves a sql data set into migration.db - * @param $data a sql data set returned from self::prepare()->query() + * @param OC_DB_StatementWrapper $data a sql data set returned from self::prepare()->query() * @param $options array of copyRows options * @return void */ diff --git a/lib/private/migration/provider.php b/lib/private/migration/provider.php index 234ab3351f3..2829a97a776 100644 --- a/lib/private/migration/provider.php +++ b/lib/private/migration/provider.php @@ -30,7 +30,7 @@ abstract class OC_Migration_Provider{ /** * @brief sets the OC_Migration_Content object to $this->content - * @param $content a OC_Migration_Content object + * @param OC_Migration_Content $content a OC_Migration_Content object */ public function setData( $uid, $content, $info=null ) { $this->content = $content; diff --git a/lib/private/ocs.php b/lib/private/ocs.php index 2305b3eccfe..bbe965ce561 100644 --- a/lib/private/ocs.php +++ b/lib/private/ocs.php @@ -23,9 +23,6 @@ * */ -use Symfony\Component\Routing\Exception\ResourceNotFoundException; -use Symfony\Component\Routing\Exception\MethodNotAllowedException; - /** * Class to handle open collaboration services API requests * @@ -38,7 +35,7 @@ class OC_OCS { * @param string $method HTTP method to read the key from * @param string $key Parameter to read * @param string $type Variable type to format data - * @param mixed $default Default value to return if the key is not found + * @param string $default Default value to return if the key is not found * @return string Data or if the key is not found and no default is set it will exit with a 400 Bad request */ public static function readData($method, $key, $type = 'raw', $default = null) { diff --git a/lib/private/preferences.php b/lib/private/preferences.php index 7ebbf7aa970..d45e6e77089 100644 --- a/lib/private/preferences.php +++ b/lib/private/preferences.php @@ -111,7 +111,7 @@ class Preferences { /** * @brief Get all apps of an user * @param string $user user - * @return array with app ids + * @return integer[] with app ids * * This function returns a list of all apps of the user that have at least * one entry in the preferences table. diff --git a/lib/private/request.php b/lib/private/request.php index a7e7bd0ea1d..0fd20b3cc1f 100755 --- a/lib/private/request.php +++ b/lib/private/request.php @@ -192,7 +192,7 @@ class OC_Request { /** * @brief Check if the requestor understands gzip - * @return boolean true for gzip encoding supported + * @return false|string true for gzip encoding supported */ static public function acceptGZip() { if (!isset($_SERVER['HTTP_ACCEPT_ENCODING'])) { diff --git a/lib/private/share/searchresultsorter.php b/lib/private/share/searchresultsorter.php index fbf77179097..76abbf30846 100644 --- a/lib/private/share/searchresultsorter.php +++ b/lib/private/share/searchresultsorter.php @@ -15,8 +15,8 @@ class SearchResultSorter { private $log; /** - * @param $search the search term as was given by the user - * @param $key the array key containing the value that should be compared + * @param string $search the search term as was given by the user + * @param string $key the array key containing the value that should be compared * against * @param $encoding optional, encoding to use, defaults to UTF-8 * @param $log optional, an \OC\Log instance diff --git a/lib/private/template/base.php b/lib/private/template/base.php index e698d855a91..232a29939cc 100644 --- a/lib/private/template/base.php +++ b/lib/private/template/base.php @@ -30,6 +30,8 @@ class Base { /** * @param string $serverroot * @param string|false $app_dir + * @param string $theme + * @param string $app */ protected function getAppTemplateDirs($theme, $app, $serverroot, $app_dir) { // Check if the app is in the app folder or in the root @@ -47,6 +49,7 @@ class Base { /** * @param string $serverroot + * @param string $theme */ protected function getCoreTemplateDirs($theme, $serverroot) { return array( @@ -119,6 +122,7 @@ class Base { /** * @brief doing the actual work + * @param string $file * @return string content * * Includes the template file, fetches its output diff --git a/lib/private/template/templatefilelocator.php b/lib/private/template/templatefilelocator.php index 05cd752cd4f..4676fceb37d 100644 --- a/lib/private/template/templatefilelocator.php +++ b/lib/private/template/templatefilelocator.php @@ -15,6 +15,7 @@ class TemplateFileLocator { /** * @param string[] $dirs + * @param string $form_factor */ public function __construct( $form_factor, $dirs ) { $this->form_factor = $form_factor; diff --git a/lib/private/user.php b/lib/private/user.php index a8e7967783e..86a01f96258 100644 --- a/lib/private/user.php +++ b/lib/private/user.php @@ -516,6 +516,8 @@ class OC_User { * @returns array with all uids * * Get a list of all users. + * @param integer $limit + * @param integer $offset */ public static function getUsers($search = '', $limit = null, $offset = null) { $users = self::getManager()->search($search, $limit, $offset); diff --git a/lib/private/user/database.php b/lib/private/user/database.php index 094a8f2e2a4..15e6643dfb3 100644 --- a/lib/private/user/database.php +++ b/lib/private/user/database.php @@ -256,7 +256,7 @@ class OC_User_Database extends OC_User_Backend { /** * counts the users in the database * - * @return int | bool + * @return false|string | bool */ public function countUsers() { $query = OC_DB::prepare('SELECT COUNT(*) FROM `*PREFIX*users`'); diff --git a/lib/private/util.php b/lib/private/util.php index af39d983f67..829eedce044 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -218,7 +218,7 @@ class OC_Util { * @brief add a javascript file * * @param string $application - * @param mixed $file filename + * @param string|null $file filename * @return void */ public static function addScript( $application, $file = null ) { @@ -237,7 +237,7 @@ class OC_Util { * @brief add a css file * * @param string $application - * @param mixed $file filename + * @param string|null $file filename * @return void */ public static function addStyle( $application, $file = null ) { @@ -570,6 +570,7 @@ class OC_Util { /** * @brief Check if the app is enabled, redirects to home if not + * @param string $app * @return void */ public static function checkAppEnabled($app) { diff --git a/lib/public/appframework/controller.php b/lib/public/appframework/controller.php index dc8da967871..7c2219bd046 100644 --- a/lib/public/appframework/controller.php +++ b/lib/public/appframework/controller.php @@ -68,7 +68,7 @@ abstract class Controller { * 1. URL parameters * 2. POST parameters * 3. GET parameters - * @param mixed $default If the key is not found, this value will be returned + * @param string $default If the key is not found, this value will be returned * @return mixed the content of the array */ public function params($key, $default=null){ @@ -131,7 +131,7 @@ abstract class Controller { * @param array $params the template parameters in key => value structure * @param string $renderAs user renders a full page, blank only your template * admin an entry in the admin settings - * @param array $headers set additional headers in name/value pairs + * @param string[] $headers set additional headers in name/value pairs * @return \OCP\AppFramework\Http\TemplateResponse containing the page */ public function render($templateName, array $params=array(), diff --git a/lib/public/backgroundjob.php b/lib/public/backgroundjob.php index bcd27c1d198..03b94403b47 100644 --- a/lib/public/backgroundjob.php +++ b/lib/public/backgroundjob.php @@ -59,7 +59,7 @@ class BackgroundJob { * sets the background jobs execution type * * @param string $type execution type - * @return boolean|null + * @return false|null * * This method sets the execution type of the background jobs. Possible types * are "none", "ajax", "webcron", "cron" @@ -115,7 +115,7 @@ class BackgroundJob { * @deprecated * Gets one queued task * @param int $id ID of the task - * @return \OC\BackgroundJob\Job|null array + * @return BackgroundJob\IJob array */ public static function findQueuedTask($id) { $jobList = \OC::$server->getJobList(); diff --git a/lib/public/backgroundjob/ijob.php b/lib/public/backgroundjob/ijob.php index 5231e9537a9..eaf11c4f684 100644 --- a/lib/public/backgroundjob/ijob.php +++ b/lib/public/backgroundjob/ijob.php @@ -14,6 +14,7 @@ interface IJob { * * @param \OCP\BackgroundJob\IJobList $jobList The job list that manages the state of this job * @param \OC\Log $logger + * @return void */ public function execute($jobList, $logger = null); diff --git a/lib/public/backgroundjob/ijoblist.php b/lib/public/backgroundjob/ijoblist.php index 72f3fe863da..c9b546605b8 100644 --- a/lib/public/backgroundjob/ijoblist.php +++ b/lib/public/backgroundjob/ijoblist.php @@ -14,14 +14,17 @@ interface IJobList { * * @param \OCP\BackgroundJob\IJob |string $job * @param mixed $argument The argument to be passed to $job->run() when the job is exectured + * @param string $job + * @return void */ public function add($job, $argument = null); /** * Remove a job from the list * - * @param \OCP\BackgroundJob\IJob|string $job + * @param IJob $job * @param mixed $argument + * @return void */ public function remove($job, $argument = null); @@ -58,6 +61,7 @@ interface IJobList { * set the job that was last ran to the current time * * @param \OCP\BackgroundJob\IJob $job + * @return void */ public function setLastJob($job); @@ -72,6 +76,7 @@ interface IJobList { * set the lastRun of $job to now * * @param \OCP\BackgroundJob\IJob $job + * @return void */ public function setLastRun($job); } diff --git a/lib/public/contacts/imanager.php b/lib/public/contacts/imanager.php index da9bca75525..5b9d64ecc41 100644 --- a/lib/public/contacts/imanager.php +++ b/lib/public/contacts/imanager.php @@ -96,7 +96,7 @@ namespace OCP\Contacts { * This function can be used to delete the contact identified by the given id * * @param object $id the unique identifier to a contact - * @param $address_book_key + * @param $address_book_key * @return bool successful or not */ function delete($id, $address_book_key); @@ -106,7 +106,7 @@ namespace OCP\Contacts { * Otherwise the contact will be updated by replacing the entire data set. * * @param array $properties this array if key-value-pairs defines a contact - * @param $address_book_key string to identify the address book in which the contact shall be created or updated + * @param $address_book_key string to identify the address book in which the contact shall be created or updated * @return array representing the contact just created or updated */ function createOrUpdate($properties, $address_book_key); diff --git a/lib/public/files.php b/lib/public/files.php index 75c52b88fc7..e2d9c81d442 100644 --- a/lib/public/files.php +++ b/lib/public/files.php @@ -37,7 +37,6 @@ namespace OCP; class Files { /** * Recusive deletion of folders - * @param string $path to the folder * @return bool */ static function rmdirr( $dir ) { diff --git a/lib/public/iappconfig.php b/lib/public/iappconfig.php index 3b6484c09d5..1f31898bf2c 100644 --- a/lib/public/iappconfig.php +++ b/lib/public/iappconfig.php @@ -57,6 +57,7 @@ interface IAppConfig { * * @param app * @param key + * @param string $key * @return array */ public function getValues($app, $key); @@ -68,6 +69,7 @@ interface IAppConfig { * @param string $value value * * Sets a value. If the key did not exist before it will be created. + * @return void */ public function setValue($app, $key, $value); diff --git a/lib/public/iconfig.php b/lib/public/iconfig.php index 8944e660780..0ebbd9f5a71 100644 --- a/lib/public/iconfig.php +++ b/lib/public/iconfig.php @@ -47,7 +47,7 @@ interface IConfig { * Looks up a system wide defined value * * @param string $key the key of the value, under which it was saved - * @param mixed $default the default value to be returned if the value isn't set + * @param string $default the default value to be returned if the value isn't set * @return string the saved value */ public function getSystemValue($key, $default = ''); diff --git a/lib/public/itags.php b/lib/public/itags.php index 7965d4152f9..f8ebaa668f1 100644 --- a/lib/public/itags.php +++ b/lib/public/itags.php @@ -147,7 +147,7 @@ interface ITags { * Creates a tag/object relation. * * @param int $objid The id of the object - * @param int|string $tag The id or name of the tag + * @param string $tag The id or name of the tag * @return boolean Returns false on database error. */ public function tagAs($objid, $tag); @@ -156,7 +156,7 @@ interface ITags { * Delete single tag/object relation from the db * * @param int $objid The id of the object - * @param int|string $tag The id or name of the tag + * @param string $tag The id or name of the tag * @return boolean */ public function unTag($objid, $tag); diff --git a/lib/public/share.php b/lib/public/share.php index f6c44a8322b..ebc555dba5f 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -78,6 +78,9 @@ class Share { * @param string Backend class * @param string (optional) Depends on item type * @param array (optional) List of supported file extensions if this item type depends on files + * @param string $itemType + * @param string $class + * @param string $collectionOf * @return boolean true if backend is registered or false if error */ public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null) { @@ -404,6 +407,7 @@ class Share { * @param mixed Parameters * @param int Number of items to return (optional) Returns all by default * @param bool include collections + * @param string $itemType * @return Return depends on format */ public static function getItemsShared($itemType, $format = self::FORMAT_NONE, $parameters = null, @@ -662,6 +666,8 @@ class Share { * Unshare an item from all users, groups, and remove all links * @param string Item type * @param string Item source + * @param string $itemType + * @param string $itemSource * @return boolean true on success or false on failure */ public static function unshareAll($itemType, $itemSource) { @@ -694,6 +700,8 @@ class Share { * Unshare an item shared with the current user * @param string Item type * @param string Item target + * @param string $itemType + * @param string $itemTarget * @return boolean true on success or false on failure * * Unsharing from self is not allowed for items inside collections @@ -1630,6 +1638,7 @@ class Share { * @param string User that is the owner of shared item * @param string The suggested target originating from a reshare (optional) * @param int The id of the parent group share (optional) + * @param integer $shareType * @return string Item target */ private static function generateTarget($itemType, $itemSource, $shareType, $shareWith, $uidOwner, @@ -1937,6 +1946,8 @@ interface Share_Backend { * Get the source of the item to be stored in the database * @param string Item source * @param string Owner of the item + * @param string $itemSource + * @param string $uidOwner * @return boolean Source * * Return an array if the item is file dependent, the array needs two keys: 'item' and 'file' @@ -1993,6 +2004,8 @@ interface Share_Backend_File_Dependent extends Share_Backend { * Get the file path of the item * @param string Item source * @param string User that is the owner of shared item + * @param string $itemSource + * @param string $uidOwner * @return boolean */ public function getFilePath($itemSource, $uidOwner); diff --git a/tests/lib/api.php b/tests/lib/api.php index 9c4324e63e0..233beebd68a 100644 --- a/tests/lib/api.php +++ b/tests/lib/api.php @@ -9,6 +9,10 @@ class Test_API extends PHPUnit_Framework_TestCase { // Helps build a response variable + + /** + * @param string $message + */ function buildResponse($shipped, $data, $code, $message=null) { return array( 'shipped' => $shipped, @@ -18,6 +22,10 @@ class Test_API extends PHPUnit_Framework_TestCase { } // Validate details of the result + + /** + * @param OC_OCS_Result $result + */ function checkResult($result, $success) { // Check response is of correct type $this->assertInstanceOf('OC_OCS_Result', $result); diff --git a/tests/lib/appframework/http/DispatcherTest.php b/tests/lib/appframework/http/DispatcherTest.php index 6cf0da879ff..9841dcaa1f7 100644 --- a/tests/lib/appframework/http/DispatcherTest.php +++ b/tests/lib/appframework/http/DispatcherTest.php @@ -24,7 +24,6 @@ namespace OC\AppFramework\Http; -use OC\AppFramework\Core\API; use OC\AppFramework\Middleware\MiddlewareDispatcher; use OCP\AppFramework\Http; //require_once(__DIR__ . "/../classloader.php"); @@ -78,6 +77,10 @@ class DispatcherTest extends \PHPUnit_Framework_TestCase { } + /** + * @param string $out + * @param string $httpHeaders + */ private function setMiddlewareExpections($out=null, $httpHeaders=null, $responseHeaders=array(), $ex=false, $catchEx=true) { diff --git a/tests/lib/appframework/http/ResponseTest.php b/tests/lib/appframework/http/ResponseTest.php index 1a38c38c1e7..4f21d77a170 100644 --- a/tests/lib/appframework/http/ResponseTest.php +++ b/tests/lib/appframework/http/ResponseTest.php @@ -25,8 +25,8 @@ namespace OC\AppFramework\Http; -use OCP\AppFramework\Http\Response, - OCP\AppFramework\Http; +use OCP\AppFramework\Http\Response; +use OCP\AppFramework\Http; class ResponseTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php b/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php index 95d42e4eb8e..f16b14150c3 100644 --- a/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php +++ b/tests/lib/appframework/middleware/MiddlewareDispatcherTest.php @@ -50,6 +50,9 @@ class TestMiddleware extends Middleware { private $beforeControllerThrowsEx; + /** + * @param boolean $beforeControllerThrowsEx + */ public function __construct($beforeControllerThrowsEx) { self::$beforeControllerCalled = 0; self::$afterControllerCalled = 0; diff --git a/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php b/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php index dae6135dc54..63c48a62829 100644 --- a/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php +++ b/tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php @@ -58,6 +58,9 @@ class SecurityMiddlewareTest extends \PHPUnit_Framework_TestCase { } + /** + * @param string $method + */ private function checkNavEntry($method){ $api = $this->getAPI(); @@ -79,6 +82,10 @@ class SecurityMiddlewareTest extends \PHPUnit_Framework_TestCase { } + /** + * @param string $method + * @param string $test + */ private function ajaxExceptionStatus($method, $test, $status) { $api = $this->getAPI(); $api->expects($this->any()) @@ -183,6 +190,10 @@ class SecurityMiddlewareTest extends \PHPUnit_Framework_TestCase { } + /** + * @param string $method + * @param string $expects + */ private function securityCheck($method, $expects, $shouldFail=false){ $api = $this->getAPI(); $api->expects($this->once()) diff --git a/tests/lib/appframework/routing/RoutingTest.php b/tests/lib/appframework/routing/RoutingTest.php index a7aa922db12..d0244cf2511 100644 --- a/tests/lib/appframework/routing/RoutingTest.php +++ b/tests/lib/appframework/routing/RoutingTest.php @@ -78,6 +78,13 @@ class RouteConfigTest extends \PHPUnit_Framework_TestCase $this->assertResource($routes, 'admin_accounts', '/admin/accounts', 'AdminAccountsController', 'adminAccountId'); } + /** + * @param string $name + * @param string $verb + * @param string $url + * @param string $controllerName + * @param string $actionName + */ private function assertSimpleRoute($routes, $name, $verb, $url, $controllerName, $actionName) { // route mocks @@ -100,6 +107,12 @@ class RouteConfigTest extends \PHPUnit_Framework_TestCase $config->register(); } + /** + * @param string $resourceName + * @param string $url + * @param string $controllerName + * @param string $paramName + */ private function assertResource($yaml, $resourceName, $url, $controllerName, $paramName) { // router mock diff --git a/tests/lib/dbschema.php b/tests/lib/dbschema.php index e8a43538004..11e9fcdf4fa 100644 --- a/tests/lib/dbschema.php +++ b/tests/lib/dbschema.php @@ -111,10 +111,16 @@ class Test_DBSchema extends PHPUnit_Framework_TestCase { } } + /** + * @param string $table + */ public function assertTableExist($table) { $this->assertTrue($this->tableExist($table), 'Table ' . $table . ' does not exist'); } + /** + * @param string $table + */ public function assertTableNotExist($table) { $type=OC_Config::getValue( "dbtype", "sqlite" ); if( $type == 'sqlite' || $type == 'sqlite3' ) { diff --git a/tests/lib/errorHandler.php b/tests/lib/errorHandler.php index 68b87deccb6..32396eafbea 100644 --- a/tests/lib/errorHandler.php +++ b/tests/lib/errorHandler.php @@ -56,6 +56,10 @@ class Test_ErrorHandler extends \PHPUnit_Framework_TestCase { * @brief dummy class to access protected methods of \OC\Log\ErrorHandler */ class TestableErrorHandler extends \OC\Log\ErrorHandler { + + /** + * @param string $msg + */ public static function testRemovePassword($msg) { return self::removePassword($msg); } diff --git a/tests/lib/files/cache/homecache.php b/tests/lib/files/cache/homecache.php index 87fd0dba4c6..dbcf6e9caa0 100644 --- a/tests/lib/files/cache/homecache.php +++ b/tests/lib/files/cache/homecache.php @@ -19,6 +19,10 @@ class DummyUser extends \OC\User\User { */ private $uid; + /** + * @param string $uid + * @param string $home + */ public function __construct($uid, $home) { $this->home = $home; $this->uid = $uid; diff --git a/tests/lib/files/etagtest.php b/tests/lib/files/etagtest.php index 6c41413c4df..ce05adb188a 100644 --- a/tests/lib/files/etagtest.php +++ b/tests/lib/files/etagtest.php @@ -68,6 +68,9 @@ class EtagTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($originalEtags, $this->getEtags($files)); } + /** + * @param string[] $files + */ private function getEtags($files) { $etags = array(); foreach ($files as $file) { diff --git a/tests/lib/files/node/integration.php b/tests/lib/files/node/integration.php index 14e1d05853d..319f2f9f5f7 100644 --- a/tests/lib/files/node/integration.php +++ b/tests/lib/files/node/integration.php @@ -9,10 +9,7 @@ namespace Test\Files\Node; use OC\Files\Cache\Cache; -use OC\Files\Mount\Manager; use OC\Files\Node\Root; -use OCP\Files\NotFoundException; -use OCP\Files\NotPermittedException; use OC\Files\Storage\Temporary; use OC\Files\View; use OC\User\User; diff --git a/tests/lib/files/node/root.php b/tests/lib/files/node/root.php index 97eaf7f7162..27f1a937826 100644 --- a/tests/lib/files/node/root.php +++ b/tests/lib/files/node/root.php @@ -8,7 +8,6 @@ namespace Test\Files\Node; -use OC\Files\Cache\Cache; use OCP\Files\NotPermittedException; use OC\Files\Mount\Manager; diff --git a/tests/lib/files/storage/home.php b/tests/lib/files/storage/home.php index 885291e4404..51315a2a556 100644 --- a/tests/lib/files/storage/home.php +++ b/tests/lib/files/storage/home.php @@ -29,6 +29,10 @@ class DummyUser extends User { private $uid; + /** + * @param string $uid + * @param string $home + */ public function __construct($uid, $home) { $this->uid = $uid; $this->home = $home; diff --git a/tests/lib/files/storage/wrapper/quota.php b/tests/lib/files/storage/wrapper/quota.php index 87bafb64d41..e1b880255fb 100644 --- a/tests/lib/files/storage/wrapper/quota.php +++ b/tests/lib/files/storage/wrapper/quota.php @@ -27,6 +27,9 @@ class Quota extends \Test\Files\Storage\Storage { \OC_Helper::rmdirr($this->tmpDir); } + /** + * @param integer $limit + */ protected function getLimitedStorage($limit) { $storage = new \OC\Files\Storage\Local(array('datadir' => $this->tmpDir)); $storage->getScanner()->scan(''); diff --git a/tests/lib/files/stream/quota.php b/tests/lib/files/stream/quota.php index b11f0ac74c0..d5edace544d 100644 --- a/tests/lib/files/stream/quota.php +++ b/tests/lib/files/stream/quota.php @@ -13,6 +13,10 @@ class Quota extends \PHPUnit_Framework_TestCase { \OC\Files\Stream\Quota::clear(); } + /** + * @param string $mode + * @param integer $limit + */ protected function getStream($mode, $limit) { $source = fopen('php://temp', $mode); return \OC\Files\Stream\Quota::wrap($source, $limit); diff --git a/tests/lib/group/backend.php b/tests/lib/group/backend.php index d308232a78b..2c563ae9ac9 100644 --- a/tests/lib/group/backend.php +++ b/tests/lib/group/backend.php @@ -29,7 +29,7 @@ abstract class Test_Group_Backend extends PHPUnit_Framework_TestCase { /** * get a new unique group name * test cases can override this in order to clean up created groups - * @return array + * @return string */ public function getGroupName() { return uniqid('test_'); @@ -38,7 +38,7 @@ abstract class Test_Group_Backend extends PHPUnit_Framework_TestCase { /** * get a new unique user name * test cases can override this in order to clean up created user - * @return array + * @return string */ public function getUserName() { return uniqid('test_'); diff --git a/tests/lib/group/database.php b/tests/lib/group/database.php index 5278c26f4df..3e05c656061 100644 --- a/tests/lib/group/database.php +++ b/tests/lib/group/database.php @@ -26,7 +26,7 @@ class Test_Group_Database extends Test_Group_Backend { /** * get a new unique group name * test cases can override this in order to clean up created groups - * @return array + * @return string */ public function getGroupName() { $name=uniqid('test_'); @@ -37,7 +37,7 @@ class Test_Group_Database extends Test_Group_Backend { /** * get a new unique user name * test cases can override this in order to clean up created user - * @return array + * @return string */ public function getUserName() { return uniqid('test_'); diff --git a/tests/lib/group/group.php b/tests/lib/group/group.php index f1fda3b9288..3982c00e45f 100644 --- a/tests/lib/group/group.php +++ b/tests/lib/group/group.php @@ -13,7 +13,7 @@ use OC\User\User; class Group extends \PHPUnit_Framework_TestCase { /** - * @return \PHPUnit_Framework_MockObject_MockObject | \OC\User\Manager + * @return \OC\User\Manager | \OC\User\Manager */ protected function getUserManager() { $userManager = $this->getMock('\OC\User\Manager'); diff --git a/tests/lib/migrate.php b/tests/lib/migrate.php index 39a9bfc8d5a..d438a7a692e 100644 --- a/tests/lib/migrate.php +++ b/tests/lib/migrate.php @@ -31,6 +31,7 @@ class Test_Migrate extends PHPUnit_Framework_TestCase { * @brief checks for existence of export_info.json and file folder * @param string $exportedUser the user that was exported * @param string $path the path to the .zip export + * @param string $exportedBy */ public function validateUserExport($exportedBy, $exportedUser, $path) { $this->assertTrue(file_exists($path)); diff --git a/tests/lib/ocs/privatedata.php b/tests/lib/ocs/privatedata.php index ea8413734f1..498ab718621 100644 --- a/tests/lib/ocs/privatedata.php +++ b/tests/lib/ocs/privatedata.php @@ -131,6 +131,7 @@ class Test_OC_OCS_Privatedata extends PHPUnit_Framework_TestCase /** * @param \OC_OCS_Result $result + * @param integer $expectedArraySize */ public function assertOcsResult($expectedArraySize, $result) { $this->assertEquals(100, $result->getStatusCode()); diff --git a/tests/lib/share/share.php b/tests/lib/share/share.php index d6acee6c924..a89f100d97a 100644 --- a/tests/lib/share/share.php +++ b/tests/lib/share/share.php @@ -151,6 +151,10 @@ class Test_Share extends PHPUnit_Framework_TestCase { ); } + /** + * @param string $sharer + * @param string $receiver + */ protected function shareUserTestFileWithUser($sharer, $receiver) { OC_User::setUserId($sharer); $this->assertTrue( @@ -558,6 +562,9 @@ class Test_Share extends PHPUnit_Framework_TestCase { ); } + /** + * @param boolean|string $token + */ protected function getShareByValidToken($token) { $row = OCP\Share::getShareByToken($token); $this->assertInternalType( diff --git a/tests/lib/template/resourcelocator.php b/tests/lib/template/resourcelocator.php index d80d222e2c9..619560643fe 100644 --- a/tests/lib/template/resourcelocator.php +++ b/tests/lib/template/resourcelocator.php @@ -7,6 +7,11 @@ */ class Test_ResourceLocator extends PHPUnit_Framework_TestCase { + + /** + * @param string $theme + * @param string $form_factor + */ public function getResourceLocator( $theme, $form_factor, $core_map, $party_map, $appsroots ) { return $this->getMockForAbstractClass('OC\Template\ResourceLocator', array( $theme, $form_factor, $core_map, $party_map, $appsroots ), diff --git a/tests/lib/user.php b/tests/lib/user.php index fdf9e7a08e0..e2c3282a19f 100644 --- a/tests/lib/user.php +++ b/tests/lib/user.php @@ -9,8 +9,6 @@ namespace Test; -use OC\Hooks\PublicEmitter; - class User extends \PHPUnit_Framework_TestCase { /** * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend diff --git a/tests/testcleanuplistener.php b/tests/testcleanuplistener.php index a969ece6dd5..299a589ef4e 100644 --- a/tests/testcleanuplistener.php +++ b/tests/testcleanuplistener.php @@ -57,6 +57,9 @@ class TestCleanupListener implements PHPUnit_Framework_TestListener { return $this->verbosity === 'detail'; } + /** + * @param string $dir + */ private function unlinkDir($dir) { if ($dh = @opendir($dir)) { while (($file = readdir($dh)) !== false) { -- cgit v1.2.3 From eea1abae2076825789f4b2abd2e476b93004714d Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 19 Feb 2014 09:52:32 +0100 Subject: add unit tests for watcher policies --- tests/lib/files/cache/watcher.php | 56 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/tests/lib/files/cache/watcher.php b/tests/lib/files/cache/watcher.php index 1920c276907..7f4f3c5ee98 100644 --- a/tests/lib/files/cache/watcher.php +++ b/tests/lib/files/cache/watcher.php @@ -11,7 +11,7 @@ namespace Test\Files\Cache; class Watcher extends \PHPUnit_Framework_TestCase { /** - * @var \OC\Files\Storage\Storage[] $storages; + * @var \OC\Files\Storage\Storage[] $storages */ private $storages = array(); @@ -105,6 +105,60 @@ class Watcher extends \PHPUnit_Framework_TestCase { $this->assertTrue($cache->inCache('foo.txt/bar.txt')); } + public function testPolicyNever() { + $storage = $this->getTestStorage(); + $cache = $storage->getCache(); + $updater = $storage->getWatcher(); + + //set the mtime to the past so it can detect an mtime change + $cache->put('foo.txt', array('storage_mtime' => 10)); + + $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_NEVER); + + $storage->file_put_contents('foo.txt', 'q'); + $this->assertFalse($updater->checkUpdate('foo.txt')); + + $cache->put('foo.txt', array('storage_mtime' => 20)); + $storage->file_put_contents('foo.txt', 'w'); + $this->assertFalse($updater->checkUpdate('foo.txt')); + } + + public function testPolicyOnce() { + $storage = $this->getTestStorage(); + $cache = $storage->getCache(); + $updater = $storage->getWatcher(); + + //set the mtime to the past so it can detect an mtime change + $cache->put('foo.txt', array('storage_mtime' => 10)); + + $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ONCE); + + $storage->file_put_contents('foo.txt', 'q'); + $this->assertTrue($updater->checkUpdate('foo.txt')); + + $cache->put('foo.txt', array('storage_mtime' => 20)); + $storage->file_put_contents('foo.txt', 'w'); + $this->assertFalse($updater->checkUpdate('foo.txt')); + } + + public function testPolicyAlways() { + $storage = $this->getTestStorage(); + $cache = $storage->getCache(); + $updater = $storage->getWatcher(); + + //set the mtime to the past so it can detect an mtime change + $cache->put('foo.txt', array('storage_mtime' => 10)); + + $updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ALWAYS); + + $storage->file_put_contents('foo.txt', 'q'); + $this->assertTrue($updater->checkUpdate('foo.txt')); + + $cache->put('foo.txt', array('storage_mtime' => 20)); + $storage->file_put_contents('foo.txt', 'w'); + $this->assertTrue($updater->checkUpdate('foo.txt')); + } + /** * @param bool $scan * @return \OC\Files\Storage\Storage -- cgit v1.2.3 From 8caf77f7c96846d696a308a6300c128ec08fc97e Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 19 Feb 2014 10:02:44 +0100 Subject: fix 3rdparty submodule --- 3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty b/3rdparty index 7c2c94c904c..c7b4cdbcc1f 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit 7c2c94c904c2721763e97d5bafd115f863080a60 +Subproject commit c7b4cdbcc1faa56df2489a5753b457627f460c07 -- cgit v1.2.3 From c196e59e882357948ea8b2877d5153614f5143a1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 19 Feb 2014 10:25:52 +0100 Subject: Add event parameter to keyup event Fix issue #7277 --- settings/js/personal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/js/personal.js b/settings/js/personal.js index 3b876467756..ef261b50bbc 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -163,7 +163,7 @@ $(document).ready(function(){ }); - $('#email').keyup(function(){ + $('#email').keyup(function(event){ if ($('#email').val() !== '' ){ // if this is the enter key changeEmailAddress() is already invoked // so it doesn't need to be triggered again -- cgit v1.2.3 From f944707a15b4819f7a67263e26b41fe4abe942ab Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 19 Feb 2014 11:50:17 +0100 Subject: fix wrong removes --- lib/private/installer.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/private/installer.php b/lib/private/installer.php index fe7417990c8..11633a4d4a1 100644 --- a/lib/private/installer.php +++ b/lib/private/installer.php @@ -154,7 +154,7 @@ class OC_Installer{ }else{ $version = trim($info['version']); } - + if($version<>trim($data['appdata']['version'])) { OC_Helper::rmdirr($extractDir); throw new \Exception($l->t("App can't be installed because the version in info.xml/version is not the same as the version reported from the app store")); @@ -236,6 +236,29 @@ class OC_Installer{ /** * @brief Update an application + * + * This function installs an app. All information needed are passed in the + * associative array $data. + * The following keys are required: + * - source: string, can be "path" or "http" + * + * One of the following keys is required: + * - path: path to the file containing the app + * - href: link to the downloadable file containing the app + * + * The following keys are optional: + * - pretend: boolean, if set true the system won't do anything + * - noupgrade: boolean, if true appinfo/upgrade.php won't be loaded + * + * This function works as follows + * -# fetching the file + * -# removing the old files + * -# unzipping new file + * -# including appinfo/upgrade.php + * -# setting the installed version + * + * upgrade.php can determine the current installed version of the app using + * "OC_Appconfig::getValue($appid, 'installed_version')" */ public static function updateApp( $app ) { $ocsid=OC_Appconfig::getValue( $app, 'ocsid'); -- cgit v1.2.3 From c0328b4f0f12f54635e2ea2dccf6c356d8f479cc Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Wed, 19 Feb 2014 13:13:01 +0100 Subject: LDAP: improve compilation of filters --- apps/user_ldap/lib/access.php | 11 +++++++++++ apps/user_ldap/user_ldap.php | 3 +++ 2 files changed, 14 insertions(+) diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 6795aecafee..b7e4023dd73 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -921,6 +921,17 @@ class Access extends LDAPUtility { return $name; } + /** + * @brief escapes (user provided) parts for LDAP filter + * @param String $input, the provided value + * @returns the escaped string + */ + public function escapeFilterPart($input) { + $search = array('*', '\\', '(', ')'); + $replace = array('\\*', '\\\\', '\\(', '\\)'); + return str_replace($search, $replace, $input); + } + /** * @brief combines the input filters with AND * @param $filters array, the filters to connect diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php index 4a147cf9884..757de6b60f4 100644 --- a/apps/user_ldap/user_ldap.php +++ b/apps/user_ldap/user_ldap.php @@ -163,6 +163,8 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { * Check if the password is correct without logging in the user */ public function checkPassword($uid, $password) { + $uid = $this->access->escapeFilterPart($uid); + //find out dn of the user name $filter = \OCP\Util::mb_str_replace( '%uid', $uid, $this->access->connection->ldapLoginFilter, 'UTF-8'); @@ -203,6 +205,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface { * Get a list of all users. */ public function getUsers($search = '', $limit = 10, $offset = 0) { + $search = $this->access->escapeFilterPart($search); $cachekey = 'getUsers-'.$search.'-'.$limit.'-'.$offset; //check if users are cached, if so return -- cgit v1.2.3 From 2d5b3899a68adb496d6e20e93352395ba7b5dd2e Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 19 Feb 2014 15:38:00 +0100 Subject: Hardening: Remove dangerous characters + Subdirectory Check If an user is able to create folders in /core/l10n/ he is able to execute arbitrary code. Therefore I've added an `issubdirectory` check and removed all potential dangerous characters from `$lang`. --- lib/private/l10n.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/l10n.php b/lib/private/l10n.php index 1ade18ea427..ad979a92870 100644 --- a/lib/private/l10n.php +++ b/lib/private/l10n.php @@ -118,7 +118,7 @@ class OC_L10N implements \OCP\IL10N { return; } $app = OC_App::cleanAppId($this->app); - $lang = $this->lang; + $lang = str_replace(array('\0', '/', '\\', '..'), '', $this->lang); $this->app = true; // Find the right language if(is_null($lang) || $lang == '') { @@ -163,7 +163,7 @@ class OC_L10N implements \OCP\IL10N { } } - if(file_exists(OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php')) { + if(file_exists(OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php') && OC_Helper::issubdirectory(OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php', OC::$SERVERROOT.'/core/l10n/')) { // Include the file, save the data from $CONFIG include OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php'; if(isset($LOCALIZATIONS) && is_array($LOCALIZATIONS)) { -- cgit v1.2.3 From b2b35cd3358113db95651d705251eda290b40ba7 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 31 Jan 2014 16:06:11 +0100 Subject: Fixed ext storage webdav path encoding - Some WebDAV servers like lighttpd need paths in URLs to be properly encoded - Added error log output when curl connection failed - Added check for 'resourcetype' in case the WebDAV server doesn't support/return it - Fixed touch() to return false if the server doesn't implement PROPPATCH - Added optional delay in WebDAV unit tests to use when testing against lighttpd's WebDAV --- apps/files_external/lib/webdav.php | 63 +++++++++++++++++++++++++++--------- apps/files_external/tests/config.php | 6 +++- apps/files_external/tests/webdav.php | 3 ++ tests/lib/files/storage/storage.php | 19 +++++++++++ 4 files changed, 74 insertions(+), 17 deletions(-) diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php index 7611316a26a..9afe73aebd7 100644 --- a/apps/files_external/lib/webdav.php +++ b/apps/files_external/lib/webdav.php @@ -99,7 +99,9 @@ class DAV extends \OC\Files\Storage\Common{ public function rmdir($path) { $this->init(); - $path=$this->cleanPath($path); + $path=$this->cleanPath($path) . '/'; + // FIXME: some WebDAV impl return 403 when trying to DELETE + // a non-empty folder return $this->simpleResponse('DELETE', $path, null, 204); } @@ -107,7 +109,7 @@ class DAV extends \OC\Files\Storage\Common{ $this->init(); $path=$this->cleanPath($path); try { - $response=$this->client->propfind($path, array(), 1); + $response=$this->client->propfind($this->encodePath($path), array(), 1); $id=md5('webdav'.$this->root.$path); $content = array(); $files=array_keys($response); @@ -127,8 +129,11 @@ class DAV extends \OC\Files\Storage\Common{ $this->init(); $path=$this->cleanPath($path); try { - $response=$this->client->propfind($path, array('{DAV:}resourcetype')); - $responseType=$response["{DAV:}resourcetype"]->resourceType; + $response=$this->client->propfind($this->encodePath($path), array('{DAV:}resourcetype')); + $responseType = array(); + if (isset($response["{DAV:}resourcetype"])) { + $responseType=$response["{DAV:}resourcetype"]->resourceType; + } return (count($responseType)>0 and $responseType[0]=="{DAV:}collection")?'dir':'file'; } catch(\Exception $e) { error_log($e->getMessage()); @@ -141,7 +146,7 @@ class DAV extends \OC\Files\Storage\Common{ $this->init(); $path=$this->cleanPath($path); try { - $this->client->propfind($path, array('{DAV:}resourcetype')); + $this->client->propfind($this->encodePath($path), array('{DAV:}resourcetype')); return true;//no 404 exception } catch(\Exception $e) { return false; @@ -166,7 +171,7 @@ class DAV extends \OC\Files\Storage\Common{ $curl = curl_init(); $fp = fopen('php://temp', 'r+'); curl_setopt($curl, CURLOPT_USERPWD, $this->user.':'.$this->password); - curl_setopt($curl, CURLOPT_URL, $this->createBaseUri().str_replace(' ', '%20', $path)); + curl_setopt($curl, CURLOPT_URL, $this->createBaseUri().$this->encodePath($path)); curl_setopt($curl, CURLOPT_FILE, $fp); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); if ($this->secure === true) { @@ -178,6 +183,10 @@ class DAV extends \OC\Files\Storage\Common{ } curl_exec ($curl); + $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + if ($statusCode !== 200) { + \OCP\Util::writeLog("webdav client", 'curl GET ' . curl_getinfo($curl, CURLINFO_EFFECTIVE_URL) . ' returned status code ' . $statusCode, \OCP\Util::ERROR); + } curl_close ($curl); rewind($fp); return $fp; @@ -220,7 +229,7 @@ class DAV extends \OC\Files\Storage\Common{ $this->init(); $path=$this->cleanPath($path); try { - $response=$this->client->propfind($path, array('{DAV:}quota-available-bytes')); + $response=$this->client->propfind($this->encodePath($path), array('{DAV:}quota-available-bytes')); if (isset($response['{DAV:}quota-available-bytes'])) { return (int)$response['{DAV:}quota-available-bytes']; } else { @@ -240,7 +249,12 @@ class DAV extends \OC\Files\Storage\Common{ // if file exists, update the mtime, else create a new empty file if ($this->file_exists($path)) { - $this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime)); + try { + $this->client->proppatch($this->encodePath($path), array('{DAV:}lastmodified' => $mtime)); + } + catch (\Sabre_DAV_Exception_NotImplemented $e) { + return false; + } } else { $this->file_put_contents($path, ''); } @@ -276,13 +290,17 @@ class DAV extends \OC\Files\Storage\Common{ } } curl_exec ($curl); + $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + if ($statusCode !== 200) { + \OCP\Util::writeLog("webdav client", 'curl GET ' . curl_getinfo($curl, CURLINFO_EFFECTIVE_URL) . ' returned status code ' . $statusCode, \OCP\Util::ERROR); + } curl_close ($curl); } public function rename($path1, $path2) { $this->init(); - $path1=$this->cleanPath($path1); - $path2=$this->createBaseUri().$this->cleanPath($path2); + $path1 = $this->encodePath($this->cleanPath($path1)); + $path2 = $this->createBaseUri().$this->encodePath($this->cleanPath($path2)); try { $this->client->request('MOVE', $path1, null, array('Destination'=>$path2)); return true; @@ -293,8 +311,8 @@ class DAV extends \OC\Files\Storage\Common{ public function copy($path1, $path2) { $this->init(); - $path1=$this->cleanPath($path1); - $path2=$this->createBaseUri().$this->cleanPath($path2); + $path1 = $this->encodePath($this->cleanPath($path1)); + $path2 = $this->createBaseUri().$this->encodePath($this->cleanPath($path2)); try { $this->client->request('COPY', $path1, null, array('Destination'=>$path2)); return true; @@ -307,7 +325,7 @@ class DAV extends \OC\Files\Storage\Common{ $this->init(); $path=$this->cleanPath($path); try { - $response=$this->client->propfind($path, array('{DAV:}getlastmodified', '{DAV:}getcontentlength')); + $response = $this->client->propfind($this->encodePath($path), array('{DAV:}getlastmodified', '{DAV:}getcontentlength')); return array( 'mtime'=>strtotime($response['{DAV:}getlastmodified']), 'size'=>(int)isset($response['{DAV:}getcontentlength']) ? $response['{DAV:}getcontentlength'] : 0, @@ -321,8 +339,11 @@ class DAV extends \OC\Files\Storage\Common{ $this->init(); $path=$this->cleanPath($path); try { - $response=$this->client->propfind($path, array('{DAV:}getcontenttype', '{DAV:}resourcetype')); - $responseType=$response["{DAV:}resourcetype"]->resourceType; + $response=$this->client->propfind($this->encodePath($path), array('{DAV:}getcontenttype', '{DAV:}resourcetype')); + $responseType = array(); + if (isset($response["{DAV:}resourcetype"])) { + $responseType=$response["{DAV:}resourcetype"]->resourceType; + } $type=(count($responseType)>0 and $responseType[0]=="{DAV:}collection")?'dir':'file'; if ($type=='dir') { return 'httpd/unix-directory'; @@ -345,6 +366,16 @@ class DAV extends \OC\Files\Storage\Common{ return substr($path, 1); } + /** + * URL encodes the given path but keeps the slashes + * @param string $path to encode + * @return string encoded path + */ + private function encodePath($path) { + // slashes need to stay + return str_replace('%2F', '/', rawurlencode($path)); + } + /** * @param string $method * @param string $path @@ -353,7 +384,7 @@ class DAV extends \OC\Files\Storage\Common{ private function simpleResponse($method, $path, $body, $expected) { $path=$this->cleanPath($path); try { - $response=$this->client->request($method, $path, $body); + $response=$this->client->request($method, $this->encodePath($path), $body); return $response['statusCode']==$expected; } catch(\Exception $e) { return false; diff --git a/apps/files_external/tests/config.php b/apps/files_external/tests/config.php index e296bfcb5b2..767c0adf58e 100644 --- a/apps/files_external/tests/config.php +++ b/apps/files_external/tests/config.php @@ -21,7 +21,11 @@ return array( 'host'=>'localhost', 'user'=>'test', 'password'=>'test', - 'root'=>'/owncloud/files/webdav.php', + 'root'=>'', + // wait delay in seconds after write operations + // (only in tests) + // set to higher value for lighttpd webdav + 'wait'=> 0 ), 'owncloud'=>array( 'run'=>true, diff --git a/apps/files_external/tests/webdav.php b/apps/files_external/tests/webdav.php index 1f9b767eca6..74e905ccc89 100644 --- a/apps/files_external/tests/webdav.php +++ b/apps/files_external/tests/webdav.php @@ -18,6 +18,9 @@ class DAV extends Storage { if ( ! is_array($this->config) or ! isset($this->config['webdav']) or ! $this->config['webdav']['run']) { $this->markTestSkipped('WebDAV backend not configured'); } + if (isset($this->config['webdav']['wait'])) { + $this->waitDelay = $this->config['webdav']['wait']; + } $this->config['webdav']['root'] .= '/' . $id; //make sure we have an new empty folder to work in $this->instance = new \OC\Files\Storage\DAV($this->config['webdav']); $this->instance->mkdir('/'); diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index 182c014d999..f9291758606 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -27,6 +27,17 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { * @var \OC\Files\Storage\Storage instance */ protected $instance; + protected $waitDelay = 0; + + /** + * Sleep for the number of seconds specified in the + * $waitDelay attribute + */ + protected function wait() { + if ($this->waitDelay > 0) { + sleep($this->waitDelay); + } + } /** * the root folder of the storage should always exist, be readable and be recognized as a directory @@ -77,6 +88,7 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertFalse($this->instance->mkdir('/'.$directory)); //cant create existing folders $this->assertTrue($this->instance->rmdir('/'.$directory)); + $this->wait(); $this->assertFalse($this->instance->file_exists('/'.$directory)); $this->assertFalse($this->instance->rmdir('/'.$directory)); //cant remove non existing folders @@ -97,6 +109,8 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { array('folder'), array(' folder'), array('folder '), + array('folder with space'), + array('spéciäl földer'), ); } /** @@ -144,6 +158,7 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertEquals($this->instance->file_get_contents('/source.txt'), $this->instance->file_get_contents('/target.txt')); $this->instance->rename('/source.txt', '/target2.txt'); + $this->wait(); $this->assertTrue($this->instance->file_exists('/target2.txt')); $this->assertFalse($this->instance->file_exists('/source.txt')); $this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target2.txt')); @@ -225,6 +240,7 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertTrue($this->instance->file_exists('/lorem.txt')); $this->assertTrue($this->instance->unlink('/lorem.txt')); + $this->wait(); $this->assertFalse($this->instance->file_exists('/lorem.txt')); } @@ -259,9 +275,11 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { public function testRecursiveRmdir() { $this->instance->mkdir('folder'); $this->instance->mkdir('folder/bar'); + $this->wait(); $this->instance->file_put_contents('folder/asd.txt', 'foobar'); $this->instance->file_put_contents('folder/bar/foo.txt', 'asd'); $this->assertTrue($this->instance->rmdir('folder')); + $this->wait(); $this->assertFalse($this->instance->file_exists('folder/asd.txt')); $this->assertFalse($this->instance->file_exists('folder/bar/foo.txt')); $this->assertFalse($this->instance->file_exists('folder/bar')); @@ -274,6 +292,7 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->instance->file_put_contents('folder/asd.txt', 'foobar'); $this->instance->file_put_contents('folder/bar/foo.txt', 'asd'); $this->assertTrue($this->instance->unlink('folder')); + $this->wait(); $this->assertFalse($this->instance->file_exists('folder/asd.txt')); $this->assertFalse($this->instance->file_exists('folder/bar/foo.txt')); $this->assertFalse($this->instance->file_exists('folder/bar')); -- cgit v1.2.3 From 9e9a5b9ea1f9b4699cf2d0c621f3f911f3639df9 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 19 Feb 2014 19:08:28 +0100 Subject: Added extra checks for ext storage class --- apps/files_external/lib/config.php | 8 +++++++- apps/files_external/tests/mountconfig.php | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 94dc5fb7ad8..cd3e7f3a4a6 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -277,15 +277,21 @@ class OC_Mount_Config { $mountType, $applicable, $isPersonal = false) { + $backends = self::getBackends(); $mountPoint = OC\Files\Filesystem::normalizePath($mountPoint); if ($mountPoint === '' || $mountPoint === '/' || $mountPoint == '/Shared') { // can't mount at root or "Shared" folder return false; } + + if (!isset($backends[$class])) { + // invalid backend + return false; + } if ($isPersonal) { // Verify that the mount point applies for the current user // Prevent non-admin users from mounting local storage - if ($applicable != OCP\User::getUser() || $class == '\OC\Files\Storage\Local') { + if ($applicable !== OCP\User::getUser() || strtolower($class) === '\oc\files\storage\local') { return false; } $mountPoint = '/'.$applicable.'/files/'.ltrim($mountPoint, '/'); diff --git a/apps/files_external/tests/mountconfig.php b/apps/files_external/tests/mountconfig.php index 941aec680bb..4c61b8961f3 100644 --- a/apps/files_external/tests/mountconfig.php +++ b/apps/files_external/tests/mountconfig.php @@ -48,4 +48,28 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase { $this->assertEquals(false, OC_Mount_Config::addMountPoint('/Shared', $storageClass, array(), $mountType, $applicable, $isPersonal)); } + + public function testAddMountPointSingleUser() { + \OC_User::setUserId('test'); + $mountType = 'user'; + $applicable = 'test'; + $isPersonal = true; + // local + $this->assertEquals(false, OC_Mount_Config::addMountPoint('/ext', '\OC\Files\storage\local', array(), $mountType, $applicable, $isPersonal)); + // non-local + $this->assertEquals(true, OC_Mount_Config::addMountPoint('/ext', '\OC\Files\Storage\SFTP', array(), $mountType, $applicable, $isPersonal)); + + } + + public function testAddMountPointUnexistClass() { + \OC_User::setUserId('test'); + $storageClass = 'Unexist_Storage'; + $mountType = 'user'; + $applicable = 'test'; + $isPersonal = true; + // local + // non-local + $this->assertEquals(false, OC_Mount_Config::addMountPoint('/ext', $storageClass, array(), $mountType, $applicable, $isPersonal)); + + } } -- cgit v1.2.3 From 2fd75d8f1c6de7138f962fa55b6a45d33f8936b2 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Mon, 17 Feb 2014 18:26:52 +0100 Subject: clean up the sharing ajax calls, add mail notification class --- core/ajax/share.php | 112 +++------------------- lib/private/share/mailnotifications.php | 160 ++++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+), 99 deletions(-) create mode 100644 lib/private/share/mailnotifications.php diff --git a/core/ajax/share.php b/core/ajax/share.php index c251f8e7bae..86ee018e388 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -85,93 +85,32 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo } break; case 'informRecipients': - $l = OC_L10N::get('core'); - $shareType = (int) $_POST['shareType']; $itemType = $_POST['itemType']; $itemSource = $_POST['itemSource']; $recipient = $_POST['recipient']; - $ownerDisplayName = \OCP\User::getDisplayName(); - $from = \OCP\Util::getDefaultEmailAddress('sharing-noreply'); - - $noMail = array(); - $recipientList = array(); if($shareType === \OCP\Share::SHARE_TYPE_USER) { $recipientList[] = $recipient; } elseif ($shareType === \OCP\Share::SHARE_TYPE_GROUP) { $recipientList = \OC_Group::usersInGroup($recipient); } - // don't send a mail to the user who shared the file $recipientList = array_diff($recipientList, array(\OCP\User::getUser())); - // send mail to all recipients with an email address - foreach ($recipientList as $recipient) { - //get correct target folder name - $email = OC_Preferences::getValue($recipient, 'settings', 'email', ''); - - if ($email !== '') { - $displayName = \OCP\User::getDisplayName($recipient); - $items = \OCP\Share::getItemSharedWithUser($itemType, $itemSource, $recipient); - $filename = trim($items[0]['file_target'], '/'); - $subject = (string)$l->t('%s shared »%s« with you', array($ownerDisplayName, $filename)); - $expiration = null; - if (isset($items[0]['expiration'])) { - try { - $date = new DateTime($items[0]['expiration']); - $expiration = $l->l('date', $date->getTimestamp()); - } catch (Exception $e) { - \OCP\Util::writeLog('sharing', "Couldn't read date: " . $e->getMessage(), \OCP\Util::ERROR); - } - } - - if ($itemType === 'folder') { - $foldername = "/Shared/" . $filename; - } else { - // if it is a file we can just link to the Shared folder, - // that's the place where the user will find the file - $foldername = "/Shared"; - } - - $link = \OCP\Util::linkToAbsolute('files', 'index.php', array("dir" => $foldername)); - - $content = new OC_Template("core", "mail", ""); - $content->assign('link', $link); - $content->assign('user_displayname', $ownerDisplayName); - $content->assign('filename', $filename); - $content->assign('expiration', $expiration); - $text = $content->fetchPage(); - - $content = new OC_Template("core", "altmail", ""); - $content->assign('link', $link); - $content->assign('user_displayname', $ownerDisplayName); - $content->assign('filename', $filename); - $content->assign('expiration', $expiration); - $alttext = $content->fetchPage(); - - $default_from = OCP\Util::getDefaultEmailAddress('sharing-noreply'); - $from = OCP\Config::getUserValue(\OCP\User::getUser(), 'settings', 'email', $default_from); - - // send it out now - try { - OCP\Util::sendMail($email, $displayName, $subject, $text, $from, $ownerDisplayName, 1, $alttext); - } catch (Exception $exception) { - $noMail[] = \OCP\User::getDisplayName($recipient); - } - } - } + $mailNotification = new OC\Share\MailNotifications(); + $result = $mailNotification->sendInternalShareMail($recipientList, $itemSource, $itemType); \OCP\Share::setSendMailStatus($itemType, $itemSource, $shareType, true); - if (empty($noMail)) { + if (empty($result)) { OCP\JSON::success(); } else { OCP\JSON::error(array( 'data' => array( 'message' => $l->t("Couldn't send mail to following users: %s ", - implode(', ', $noMail) + implode(', ', $result) ) ) )); @@ -187,56 +126,31 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo break; case 'email': - // enable l10n support - $l = OC_L10N::get('core'); // read post variables - $user = OCP\USER::getUser(); - $displayName = OCP\User::getDisplayName(); - $type = $_POST['itemType']; $link = $_POST['link']; $file = $_POST['file']; $to_address = $_POST['toaddress']; + $mailNotification = new \OC\Share\MailNotifications(); + $expiration = null; if (isset($_POST['expiration']) && $_POST['expiration'] !== '') { try { $date = new DateTime($_POST['expiration']); - $expiration = $l->l('date', $date->getTimestamp()); + $expiration = $date->getTimestamp(); } catch (Exception $e) { \OCP\Util::writeLog('sharing', "Couldn't read date: " . $e->getMessage(), \OCP\Util::ERROR); } } - // setup the email - $subject = (string)$l->t('%s shared »%s« with you', array($displayName, $file)); - - $content = new OC_Template("core", "mail", ""); - $content->assign ('link', $link); - $content->assign ('type', $type); - $content->assign ('user_displayname', $displayName); - $content->assign ('filename', $file); - $content->assign('expiration', $expiration); - $text = $content->fetchPage(); - - $content = new OC_Template("core", "altmail", ""); - $content->assign ('link', $link); - $content->assign ('type', $type); - $content->assign ('user_displayname', $displayName); - $content->assign ('filename', $file); - $content->assign('expiration', $expiration); - $alttext = $content->fetchPage(); - - $default_from = OCP\Util::getDefaultEmailAddress('sharing-noreply'); - $from_address = OCP\Config::getUserValue($user, 'settings', 'email', $default_from ); - - // send it out now - try { - OCP\Util::sendMail($to_address, $to_address, $subject, $text, $from_address, $displayName, 1, $alttext); - OCP\JSON::success(); - } catch (Exception $exception) { - OCP\JSON::error(array('data' => array('message' => OC_Util::sanitizeHTML($exception->getMessage())))); + $result = $mailNotification->sendLinkShareMail($to_address, $file, $link, $expiration); + if($result === true) { + \OCP\JSON::success(); + } else { + \OCP\JSON::error(array('data' => array('message' => OC_Util::sanitizeHTML($result)))); } + break; } } else if (isset($_GET['fetch'])) { diff --git a/lib/private/share/mailnotifications.php b/lib/private/share/mailnotifications.php new file mode 100644 index 00000000000..360376294cc --- /dev/null +++ b/lib/private/share/mailnotifications.php @@ -0,0 +1,160 @@ + +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see . +*/ + +namespace OC\Share; + +class MailNotifications { + + private $senderId; // sender userId + private $from; // sender email address + private $senderDisplayName; + private $l; + + /** + * + * @param string $recipient user id + * @param string $sender user id (if nothing is set we use the currently logged-in user) + */ + public function __construct($sender = null) { + $this->l = \OC_L10N::get('core'); + + $this->senderId = $sender; + + $this->from = \OCP\Util::getDefaultEmailAddress('sharing-noreply'); + if ($this->senderId) { + $this->from = \OCP\Config::getUserValue($this->senderId, 'settings', 'email', $this->from); + $this->senderDisplayName = \OCP\User::getDisplayName($this->senderId); + } else { + $this->senderDisplayName = \OCP\User::getDisplayName(); + } + } + + /** + * @brief inform users if a file was shared with them + * + * @param array $recipientList list of recipients + * @param type $itemSource shared item source + * @param type $itemType shared item type + * @return array list of user to whom the mail send operation failed + */ + public function sendInternalShareMail($recipientList, $itemSource, $itemType) { + + $noMail = array(); + + foreach ($recipientList as $recipient) { + $recipientDisplayName = \OCP\User::getDisplayName($recipient); + $to = \OC_Preferences::getValue($recipient, 'settings', 'email', ''); + + if ($to === '') { + $noMail[] = $recipientDisplayName; + continue; + } + + $items = \OCP\Share::getItemSharedWithUser($itemType, $itemSource, $recipient); + $filename = trim($items[0]['file_target'], '/'); + $subject = (string) $this->l->t('%s shared »%s« with you', array($this->senderDisplayName, $filename)); + $expiration = null; + if (isset($items[0]['expiration'])) { + try { + $date = new DateTime($items[0]['expiration']); + $expiration = $date->getTimestamp(); + } catch (\Exception $e) { + \OCP\Util::writeLog('sharing', "Couldn't read date: " . $e->getMessage(), \OCP\Util::ERROR); + } + } + + if ($itemType === 'folder') { + $foldername = "/Shared/" . $filename; + } else { + // if it is a file we can just link to the Shared folder, + // that's the place where the user will find the file + $foldername = "/Shared"; + } + + $link = \OCP\Util::linkToAbsolute('files', 'index.php', array("dir" => $foldername)); + + list($htmlMail, $alttextMail) = $this->createMailBody($filename, $link, $expiration); + + // send it out now + try { + \OCP\Util::sendMail($to, $recipientDisplayName, $subject, $htmlMail, $this->from, $this->senderDisplayName, 1, $alttextMail); + } catch (\Exception $e) { + \OCP\Util::writeLog('sharing', "Can't send mail to inform the user abaut an internal share: " . $e->getMessage() , \OCP\Util::ERROR); + $noMail[] = $recipientDisplayName; + } + } + + return $noMail; + + } + + /** + * @brief inform recipient about public link share + * + * @param string recipient recipient email address + * @param string $filename the shared file + * @param string $link the public link + * @param int $expiration expiration date (timestamp) + * @return mixed $result true or error message + */ + public function sendLinkShareMail($recipient, $filename, $link, $expiration) { + $subject = (string)$this->l->t('%s shared »%s« with you', array($this->senderDisplayName, $filename)); + list($htmlMail, $alttextMail) = $this->createMailBody($filename, $link, $expiration); + try { + \OCP\Util::sendMail($recipient, $recipient, $subject, $htmlMail, $this->from, $this->senderDisplayName, 1, $alttextMail); + } catch (\Exception $e) { + \OCP\Util::writeLog('sharing', "Can't send mail with public link: " . $e->getMessage(), \OCP\Util::ERROR); + return $e->getMessage(); + } + + return true; + } + + /** + * @brief create mail body for plain text and html mail + * + * @param string $filename the shared file + * @param string $link link to the shared file + * @param int $expiration expiration date (timestamp) + * @return array with the html mail body and the plain text mail body + */ + private function createMailBody($filename, $link, $expiration) { + + $formatedDate = $expiration ? $this->l->l('date', $expiration) : null; + + $html = new \OC_Template("core", "mail", ""); + $html->assign ('link', $link); + $html->assign ('user_displayname', $this->senderDisplayName); + $html->assign ('filename', $filename); + $html->assign('expiration', $formatedDate); + $htmlMail = $html->fetchPage(); + + $alttext = new \OC_Template("core", "altmail", ""); + $alttext->assign ('link', $link); + $alttext->assign ('user_displayname', $this->senderDisplayName); + $alttext->assign ('filename', $filename); + $alttext->assign('expiration', $formatedDate); + $alttextMail = $alttext->fetchPage(); + + return array($htmlMail, $alttextMail); + } + +} -- cgit v1.2.3 From 90f351afa2154208dad29d28f980d5cd0e22f6d4 Mon Sep 17 00:00:00 2001 From: kondou Date: Wed, 19 Feb 2014 21:31:50 +0100 Subject: Optimize some images and strip metadata from png images with optipng in image_optimization.sh --- core/img/actions/add.png | Bin 184 -> 111 bytes core/img/actions/caret-dark.png | Bin 304 -> 199 bytes core/img/actions/caret-dark.svg | 14 +- core/img/actions/caret.png | Bin 269 -> 196 bytes core/img/actions/caret.svg | 6 +- core/img/actions/checkmark-white.png | Bin 286 -> 212 bytes core/img/actions/checkmark-white.svg | 6 +- core/img/actions/checkmark.png | Bin 303 -> 229 bytes core/img/actions/checkmark.svg | 6 +- core/img/actions/clock.png | Bin 367 -> 332 bytes core/img/actions/clock.svg | 2 +- core/img/actions/close.png | Bin 254 -> 181 bytes core/img/actions/delete-hover.png | Bin 295 -> 222 bytes core/img/actions/delete-hover.svg | 12 +- core/img/actions/delete.png | Bin 254 -> 181 bytes core/img/actions/download.png | Bin 236 -> 162 bytes core/img/actions/history.png | Bin 321 -> 249 bytes core/img/actions/info.png | Bin 423 -> 349 bytes core/img/actions/info.svg | 2 +- core/img/actions/lock.png | Bin 295 -> 221 bytes core/img/actions/lock.svg | 2 +- core/img/actions/logout.png | Bin 424 -> 352 bytes core/img/actions/logout.svg | 4 +- core/img/actions/mail.png | Bin 303 -> 229 bytes core/img/actions/more.png | Bin 195 -> 122 bytes core/img/actions/password.png | Bin 248 -> 159 bytes core/img/actions/password.svg | 5 +- core/img/actions/pause-big.png | Bin 166 -> 92 bytes core/img/actions/pause.png | Bin 170 -> 96 bytes core/img/actions/play-add.png | Bin 237 -> 163 bytes core/img/actions/play-add.svg | 6 +- core/img/actions/play-big.png | Bin 210 -> 136 bytes core/img/actions/play-next.png | Bin 224 -> 150 bytes core/img/actions/play-previous.png | Bin 237 -> 163 bytes core/img/actions/play.png | Bin 201 -> 127 bytes core/img/actions/public.png | Bin 412 -> 338 bytes core/img/actions/rename.png | Bin 267 -> 193 bytes core/img/actions/search.png | Bin 420 -> 348 bytes core/img/actions/search.svg | 8 +- core/img/actions/settings.png | Bin 524 -> 452 bytes core/img/actions/settings.svg | 10 +- core/img/actions/share.png | Bin 338 -> 264 bytes core/img/actions/shared.png | Bin 364 -> 290 bytes core/img/actions/shared.svg | 2 +- core/img/actions/sound-off.png | Bin 192 -> 118 bytes core/img/actions/sound.png | Bin 254 -> 180 bytes core/img/actions/star.png | Bin 640 -> 565 bytes core/img/actions/star.svg | 14 +- core/img/actions/starred.png | Bin 566 -> 492 bytes core/img/actions/starred.svg | 14 +- core/img/actions/toggle-filelist.png | Bin 195 -> 122 bytes core/img/actions/toggle-filelist.svg | 14 +- core/img/actions/toggle-pictures.png | Bin 193 -> 120 bytes core/img/actions/toggle-pictures.svg | 10 +- core/img/actions/toggle.png | Bin 391 -> 318 bytes core/img/actions/toggle.svg | 2 +- core/img/actions/triangle-e.png | Bin 174 -> 121 bytes core/img/actions/triangle-n.png | Bin 211 -> 138 bytes core/img/actions/triangle-n.svg | 2 +- core/img/actions/triangle-s.png | Bin 211 -> 138 bytes core/img/actions/triangle-s.svg | 2 +- core/img/actions/upload-white.png | Bin 226 -> 152 bytes core/img/actions/upload.png | Bin 235 -> 161 bytes core/img/actions/user.png | Bin 374 -> 300 bytes core/img/actions/user.svg | 2 +- core/img/actions/view-close.png | Bin 368 -> 295 bytes core/img/actions/view-next.png | Bin 305 -> 232 bytes core/img/actions/view-pause.png | Bin 181 -> 108 bytes core/img/actions/view-pause.svg | 2 +- core/img/actions/view-play.png | Bin 227 -> 154 bytes core/img/actions/view-previous.png | Bin 304 -> 231 bytes core/img/breadcrumb.png | Bin 594 -> 376 bytes core/img/breadcrumb.svg | 12 +- core/img/desktopapp.svg | 7 +- core/img/favicon-touch.png | Bin 3705 -> 3631 bytes core/img/favicon-touch.svg | 4 +- core/img/favicon.png | Bin 875 -> 802 bytes core/img/favicon.svg | 4 +- core/img/filetypes/application-epub+zip.png | Bin 1371 -> 1273 bytes core/img/filetypes/application-epub+zip.svg | 829 +++----------------------- core/img/filetypes/application-pdf.png | Bin 1746 -> 1672 bytes core/img/filetypes/application-pdf.svg | 36 +- core/img/filetypes/application-rss+xml.png | Bin 1098 -> 1024 bytes core/img/filetypes/application-rss+xml.svg | 24 +- core/img/filetypes/application-x-cbr.png | Bin 1205 -> 1113 bytes core/img/filetypes/application-x-cbr.svg | 843 +++------------------------ core/img/filetypes/application.png | Bin 1018 -> 945 bytes core/img/filetypes/application.svg | 40 +- core/img/filetypes/audio.png | Bin 816 -> 743 bytes core/img/filetypes/audio.svg | 32 +- core/img/filetypes/calendar.png | Bin 1333 -> 1226 bytes core/img/filetypes/calendar.svg | 101 ++-- core/img/filetypes/database.png | Bin 1372 -> 1117 bytes core/img/filetypes/database.svg | 63 +- core/img/filetypes/file.png | Bin 374 -> 300 bytes core/img/filetypes/file.svg | 24 +- core/img/filetypes/flash.png | Bin 954 -> 880 bytes core/img/filetypes/flash.svg | 38 +- core/img/filetypes/folder-drag-accept.png | Bin 757 -> 683 bytes core/img/filetypes/folder-drag-accept.svg | 391 ++----------- core/img/filetypes/folder-external.png | Bin 1012 -> 938 bytes core/img/filetypes/folder-external.svg | 62 +- core/img/filetypes/folder-public.png | Bin 1397 -> 1278 bytes core/img/filetypes/folder-public.svg | 62 +- core/img/filetypes/folder-shared.png | Bin 1229 -> 1155 bytes core/img/filetypes/folder-shared.svg | 62 +- core/img/filetypes/folder.png | Bin 709 -> 635 bytes core/img/filetypes/folder.svg | 38 +- core/img/filetypes/font.png | Bin 1697 -> 1623 bytes core/img/filetypes/font.svg | 32 +- core/img/filetypes/image-svg+xml.png | Bin 959 -> 885 bytes core/img/filetypes/image-svg+xml.svg | 46 +- core/img/filetypes/image.png | Bin 976 -> 903 bytes core/img/filetypes/image.svg | 44 +- core/img/filetypes/package-x-generic.png | Bin 794 -> 720 bytes core/img/filetypes/package-x-generic.svg | 71 +-- core/img/filetypes/text-code.png | Bin 908 -> 834 bytes core/img/filetypes/text-code.svg | 36 +- core/img/filetypes/text-html.png | Bin 654 -> 581 bytes core/img/filetypes/text-html.svg | 34 +- core/img/filetypes/text-vcard.png | Bin 782 -> 668 bytes core/img/filetypes/text-vcard.svg | 75 ++- core/img/filetypes/text-x-c.png | Bin 1345 -> 1228 bytes core/img/filetypes/text-x-c.svg | 89 ++- core/img/filetypes/text-x-h.png | Bin 1242 -> 1168 bytes core/img/filetypes/text-x-h.svg | 95 ++- core/img/filetypes/text-x-javascript.png | Bin 1340 -> 1243 bytes core/img/filetypes/text-x-javascript.svg | 91 ++- core/img/filetypes/text-x-python.png | Bin 1469 -> 1368 bytes core/img/filetypes/text-x-python.svg | 107 ++-- core/img/filetypes/text.png | Bin 693 -> 620 bytes core/img/filetypes/text.svg | 30 +- core/img/filetypes/video.png | Bin 1362 -> 1252 bytes core/img/filetypes/video.svg | 141 ++--- core/img/filetypes/web.png | Bin 2254 -> 2136 bytes core/img/filetypes/web.svg | 45 +- core/img/filetypes/x-office-document.png | Bin 930 -> 856 bytes core/img/filetypes/x-office-document.svg | 75 ++- core/img/filetypes/x-office-presentation.png | Bin 1102 -> 1028 bytes core/img/filetypes/x-office-presentation.svg | 123 ++-- core/img/filetypes/x-office-spreadsheet.png | Bin 789 -> 715 bytes core/img/filetypes/x-office-spreadsheet.svg | 93 ++- core/img/image-optimization.sh | 2 +- core/img/logo-wide.png | Bin 2227 -> 2154 bytes core/img/logo-wide.svg | 4 +- core/img/logo.png | Bin 5182 -> 5109 bytes core/img/logo.svg | 4 +- core/img/places/calendar-dark.png | Bin 429 -> 356 bytes core/img/places/contacts-dark.png | Bin 962 -> 888 bytes core/img/places/contacts-dark.svg | 4 +- core/img/places/file.png | Bin 364 -> 290 bytes core/img/places/file.svg | 6 +- core/img/places/files.png | Bin 280 -> 207 bytes core/img/places/files.svg | 2 +- core/img/places/folder.png | Bin 339 -> 265 bytes core/img/places/folder.svg | 8 +- core/img/places/home.png | Bin 342 -> 269 bytes core/img/places/home.svg | 4 +- core/img/places/link.png | Bin 1093 -> 851 bytes core/img/places/link.svg | 12 +- core/img/places/music.png | Bin 708 -> 634 bytes core/img/places/picture.png | Bin 434 -> 360 bytes core/img/places/picture.svg | 2 +- core/img/rating/s1.png | Bin 393 -> 299 bytes core/img/rating/s10.png | Bin 651 -> 557 bytes core/img/rating/s11.png | Bin 561 -> 464 bytes core/img/rating/s2.png | Bin 535 -> 441 bytes core/img/rating/s3.png | Bin 688 -> 594 bytes core/img/rating/s4.png | Bin 714 -> 620 bytes core/img/rating/s5.png | Bin 696 -> 602 bytes core/img/rating/s6.png | Bin 715 -> 621 bytes core/img/rating/s7.png | Bin 697 -> 603 bytes core/img/rating/s8.png | Bin 715 -> 621 bytes core/img/rating/s9.png | Bin 678 -> 584 bytes 174 files changed, 1125 insertions(+), 2969 deletions(-) diff --git a/core/img/actions/add.png b/core/img/actions/add.png index 1aac02b8454..3c051e4d73e 100644 Binary files a/core/img/actions/add.png and b/core/img/actions/add.png differ diff --git a/core/img/actions/caret-dark.png b/core/img/actions/caret-dark.png index f84e87e0a82..215af33ea4b 100644 Binary files a/core/img/actions/caret-dark.png and b/core/img/actions/caret-dark.png differ diff --git a/core/img/actions/caret-dark.svg b/core/img/actions/caret-dark.svg index 3a5318e6fa2..2d75e4dd8c1 100644 --- a/core/img/actions/caret-dark.svg +++ b/core/img/actions/caret-dark.svg @@ -1,13 +1,5 @@ + - - - - image/svg+xml - - - - - - - + + diff --git a/core/img/actions/caret.png b/core/img/actions/caret.png index 00baea9ece6..7066b767a28 100644 Binary files a/core/img/actions/caret.png and b/core/img/actions/caret.png differ diff --git a/core/img/actions/caret.svg b/core/img/actions/caret.svg index d1ae8d60a6f..8cd758daf84 100644 --- a/core/img/actions/caret.svg +++ b/core/img/actions/caret.svg @@ -1,11 +1,11 @@ - + - - + + diff --git a/core/img/actions/checkmark-white.png b/core/img/actions/checkmark-white.png index 08b8783649f..27f17204b1d 100644 Binary files a/core/img/actions/checkmark-white.png and b/core/img/actions/checkmark-white.png differ diff --git a/core/img/actions/checkmark-white.svg b/core/img/actions/checkmark-white.svg index 5e8fe8abccc..e6b63a4d599 100644 --- a/core/img/actions/checkmark-white.svg +++ b/core/img/actions/checkmark-white.svg @@ -1,4 +1,4 @@ -image/svg+xml - - + + + diff --git a/core/img/actions/checkmark.png b/core/img/actions/checkmark.png index 99a4019c69e..8b4c8ddc706 100644 Binary files a/core/img/actions/checkmark.png and b/core/img/actions/checkmark.png differ diff --git a/core/img/actions/checkmark.svg b/core/img/actions/checkmark.svg index f70a407c2ed..dbb97d1b469 100644 --- a/core/img/actions/checkmark.svg +++ b/core/img/actions/checkmark.svg @@ -1,4 +1,4 @@ -image/svg+xml - - + + + diff --git a/core/img/actions/clock.png b/core/img/actions/clock.png index 9c3a284b8ba..5023cf4c3f6 100644 Binary files a/core/img/actions/clock.png and b/core/img/actions/clock.png differ diff --git a/core/img/actions/clock.svg b/core/img/actions/clock.svg index f3fcb19031a..6b938deea82 100644 --- a/core/img/actions/clock.svg +++ b/core/img/actions/clock.svg @@ -1,5 +1,5 @@ - + diff --git a/core/img/actions/close.png b/core/img/actions/close.png index 0d8c89a56e2..3389c66e03b 100644 Binary files a/core/img/actions/close.png and b/core/img/actions/close.png differ diff --git a/core/img/actions/delete-hover.png b/core/img/actions/delete-hover.png index 99f549faf9b..48e6c089c9d 100644 Binary files a/core/img/actions/delete-hover.png and b/core/img/actions/delete-hover.png differ diff --git a/core/img/actions/delete-hover.svg b/core/img/actions/delete-hover.svg index 568185c5c70..9e5150359de 100644 --- a/core/img/actions/delete-hover.svg +++ b/core/img/actions/delete-hover.svg @@ -1,12 +1,4 @@ + - - - - image/svg+xml - - - - - - + diff --git a/core/img/actions/delete.png b/core/img/actions/delete.png index 0d8c89a56e2..3389c66e03b 100644 Binary files a/core/img/actions/delete.png and b/core/img/actions/delete.png differ diff --git a/core/img/actions/download.png b/core/img/actions/download.png index 65954f941bb..0f71a5a776f 100644 Binary files a/core/img/actions/download.png and b/core/img/actions/download.png differ diff --git a/core/img/actions/history.png b/core/img/actions/history.png index 3234880b25a..ec2bbd0587f 100644 Binary files a/core/img/actions/history.png and b/core/img/actions/history.png differ diff --git a/core/img/actions/info.png b/core/img/actions/info.png index 37ccb356830..9ebfe9cbdcc 100644 Binary files a/core/img/actions/info.png and b/core/img/actions/info.png differ diff --git a/core/img/actions/info.svg b/core/img/actions/info.svg index 55bdb17f2e1..7c93fd6a3ef 100644 --- a/core/img/actions/info.svg +++ b/core/img/actions/info.svg @@ -1,7 +1,7 @@ - + diff --git a/core/img/actions/lock.png b/core/img/actions/lock.png index f3121811ea6..2013ebad695 100644 Binary files a/core/img/actions/lock.png and b/core/img/actions/lock.png differ diff --git a/core/img/actions/lock.svg b/core/img/actions/lock.svg index beef1d3ad3a..9ea5015c8a3 100644 --- a/core/img/actions/lock.svg +++ b/core/img/actions/lock.svg @@ -1,5 +1,5 @@ - + diff --git a/core/img/actions/logout.png b/core/img/actions/logout.png index e9c89a15a7a..5b94147732c 100644 Binary files a/core/img/actions/logout.png and b/core/img/actions/logout.png differ diff --git a/core/img/actions/logout.svg b/core/img/actions/logout.svg index 59543875d75..895080dab8f 100644 --- a/core/img/actions/logout.svg +++ b/core/img/actions/logout.svg @@ -1,5 +1,5 @@ - - + + diff --git a/core/img/actions/mail.png b/core/img/actions/mail.png index be6142444ae..6d06259cd08 100644 Binary files a/core/img/actions/mail.png and b/core/img/actions/mail.png differ diff --git a/core/img/actions/more.png b/core/img/actions/more.png index edcafdd9bbf..880d5dccce3 100644 Binary files a/core/img/actions/more.png and b/core/img/actions/more.png differ diff --git a/core/img/actions/password.png b/core/img/actions/password.png index 07365a5775e..3619fabab9a 100644 Binary files a/core/img/actions/password.png and b/core/img/actions/password.png differ diff --git a/core/img/actions/password.svg b/core/img/actions/password.svg index a9b29fda093..4b772ae2dcb 100644 --- a/core/img/actions/password.svg +++ b/core/img/actions/password.svg @@ -1,3 +1,4 @@ -image/svg+xml - + + + diff --git a/core/img/actions/pause-big.png b/core/img/actions/pause-big.png index 1c4cf503b8d..054281c6314 100644 Binary files a/core/img/actions/pause-big.png and b/core/img/actions/pause-big.png differ diff --git a/core/img/actions/pause.png b/core/img/actions/pause.png index f74ed3a8619..d4b865e3401 100644 Binary files a/core/img/actions/pause.png and b/core/img/actions/pause.png differ diff --git a/core/img/actions/play-add.png b/core/img/actions/play-add.png index 0097f671aef..ccf77d2a062 100644 Binary files a/core/img/actions/play-add.png and b/core/img/actions/play-add.png differ diff --git a/core/img/actions/play-add.svg b/core/img/actions/play-add.svg index cdf4f6ea9f3..a0dec159d77 100644 --- a/core/img/actions/play-add.svg +++ b/core/img/actions/play-add.svg @@ -1,9 +1,7 @@ - - - - + + diff --git a/core/img/actions/play-big.png b/core/img/actions/play-big.png index 2da2426dcfc..7d4916cb204 100644 Binary files a/core/img/actions/play-big.png and b/core/img/actions/play-big.png differ diff --git a/core/img/actions/play-next.png b/core/img/actions/play-next.png index 08568b3dc0b..50cd91d240e 100644 Binary files a/core/img/actions/play-next.png and b/core/img/actions/play-next.png differ diff --git a/core/img/actions/play-previous.png b/core/img/actions/play-previous.png index 811cde46c15..c380e96bb58 100644 Binary files a/core/img/actions/play-previous.png and b/core/img/actions/play-previous.png differ diff --git a/core/img/actions/play.png b/core/img/actions/play.png index adbef1e576d..7994424c65c 100644 Binary files a/core/img/actions/play.png and b/core/img/actions/play.png differ diff --git a/core/img/actions/public.png b/core/img/actions/public.png index 9e56f2919fd..077bb7504de 100644 Binary files a/core/img/actions/public.png and b/core/img/actions/public.png differ diff --git a/core/img/actions/rename.png b/core/img/actions/rename.png index 3af6840071b..975bd2d7031 100644 Binary files a/core/img/actions/rename.png and b/core/img/actions/rename.png differ diff --git a/core/img/actions/search.png b/core/img/actions/search.png index 312e4f419e5..49b61754354 100644 Binary files a/core/img/actions/search.png and b/core/img/actions/search.png differ diff --git a/core/img/actions/search.svg b/core/img/actions/search.svg index 4f27369dbbc..28e36e2d5bd 100644 --- a/core/img/actions/search.svg +++ b/core/img/actions/search.svg @@ -1,14 +1,12 @@ - + - - - - + + diff --git a/core/img/actions/settings.png b/core/img/actions/settings.png index 9ada3087707..f6eb6ce0cc7 100644 Binary files a/core/img/actions/settings.png and b/core/img/actions/settings.png differ diff --git a/core/img/actions/settings.svg b/core/img/actions/settings.svg index bd7ae3b3d7f..a3a4c6c51d3 100644 --- a/core/img/actions/settings.svg +++ b/core/img/actions/settings.svg @@ -1,17 +1,17 @@ - + - + - + - - + + diff --git a/core/img/actions/share.png b/core/img/actions/share.png index 099e4d6ab35..fdacbbabebc 100644 Binary files a/core/img/actions/share.png and b/core/img/actions/share.png differ diff --git a/core/img/actions/shared.png b/core/img/actions/shared.png index 6e112e75b44..83ec1a0cf15 100644 Binary files a/core/img/actions/shared.png and b/core/img/actions/shared.png differ diff --git a/core/img/actions/shared.svg b/core/img/actions/shared.svg index 3e63cc54687..60b54015167 100644 --- a/core/img/actions/shared.svg +++ b/core/img/actions/shared.svg @@ -1,5 +1,5 @@ - + diff --git a/core/img/actions/sound-off.png b/core/img/actions/sound-off.png index 2eddb00af0f..0457de8e4d1 100644 Binary files a/core/img/actions/sound-off.png and b/core/img/actions/sound-off.png differ diff --git a/core/img/actions/sound.png b/core/img/actions/sound.png index 9349c94e7a4..e849b4d248b 100644 Binary files a/core/img/actions/sound.png and b/core/img/actions/sound.png differ diff --git a/core/img/actions/star.png b/core/img/actions/star.png index 124ce495af6..6a04282f3fa 100644 Binary files a/core/img/actions/star.png and b/core/img/actions/star.png differ diff --git a/core/img/actions/star.svg b/core/img/actions/star.svg index 7bcd8dc0598..c2b3b60a2b8 100644 --- a/core/img/actions/star.svg +++ b/core/img/actions/star.svg @@ -1,14 +1,6 @@ + - - - - image/svg+xml - - - - - - - + + diff --git a/core/img/actions/starred.png b/core/img/actions/starred.png index 5185d0f5381..22e68c757e7 100644 Binary files a/core/img/actions/starred.png and b/core/img/actions/starred.png differ diff --git a/core/img/actions/starred.svg b/core/img/actions/starred.svg index c7a5a7dac12..130bab366a2 100644 --- a/core/img/actions/starred.svg +++ b/core/img/actions/starred.svg @@ -1,14 +1,6 @@ + - - - - image/svg+xml - - - - - - - + + diff --git a/core/img/actions/toggle-filelist.png b/core/img/actions/toggle-filelist.png index 45d363f1934..0926a726d53 100644 Binary files a/core/img/actions/toggle-filelist.png and b/core/img/actions/toggle-filelist.png differ diff --git a/core/img/actions/toggle-filelist.svg b/core/img/actions/toggle-filelist.svg index 940f6a49e63..57f4c67fb30 100644 --- a/core/img/actions/toggle-filelist.svg +++ b/core/img/actions/toggle-filelist.svg @@ -1,11 +1,9 @@ - - - - - - - - + + + + + + diff --git a/core/img/actions/toggle-pictures.png b/core/img/actions/toggle-pictures.png index 8068d17e30d..7499d5b7809 100644 Binary files a/core/img/actions/toggle-pictures.png and b/core/img/actions/toggle-pictures.png differ diff --git a/core/img/actions/toggle-pictures.svg b/core/img/actions/toggle-pictures.svg index 5205c0226d1..f25695537f9 100644 --- a/core/img/actions/toggle-pictures.svg +++ b/core/img/actions/toggle-pictures.svg @@ -1,9 +1,7 @@ - - - - - - + + + + diff --git a/core/img/actions/toggle.png b/core/img/actions/toggle.png index d06e5cb32b5..45f9407a1ab 100644 Binary files a/core/img/actions/toggle.png and b/core/img/actions/toggle.png differ diff --git a/core/img/actions/toggle.svg b/core/img/actions/toggle.svg index 1b774a19b11..774daa4fdf6 100644 --- a/core/img/actions/toggle.svg +++ b/core/img/actions/toggle.svg @@ -1,5 +1,5 @@ - + diff --git a/core/img/actions/triangle-e.png b/core/img/actions/triangle-e.png index 09d398f602e..8abe23a6280 100644 Binary files a/core/img/actions/triangle-e.png and b/core/img/actions/triangle-e.png differ diff --git a/core/img/actions/triangle-n.png b/core/img/actions/triangle-n.png index 0ffcf6cbc44..0f37e950a45 100644 Binary files a/core/img/actions/triangle-n.png and b/core/img/actions/triangle-n.png differ diff --git a/core/img/actions/triangle-n.svg b/core/img/actions/triangle-n.svg index 4f866978f48..49d1ac99a7e 100644 --- a/core/img/actions/triangle-n.svg +++ b/core/img/actions/triangle-n.svg @@ -1,4 +1,4 @@ - + diff --git a/core/img/actions/triangle-s.png b/core/img/actions/triangle-s.png index 0f533b142eb..81f623eac17 100644 Binary files a/core/img/actions/triangle-s.png and b/core/img/actions/triangle-s.png differ diff --git a/core/img/actions/triangle-s.svg b/core/img/actions/triangle-s.svg index b178b20a20b..4f35c38f689 100644 --- a/core/img/actions/triangle-s.svg +++ b/core/img/actions/triangle-s.svg @@ -1,4 +1,4 @@ - + diff --git a/core/img/actions/upload-white.png b/core/img/actions/upload-white.png index fd9bdccc240..a3b233e8aa6 100644 Binary files a/core/img/actions/upload-white.png and b/core/img/actions/upload-white.png differ diff --git a/core/img/actions/upload.png b/core/img/actions/upload.png index 1d90165a552..f6a0c4cfa83 100644 Binary files a/core/img/actions/upload.png and b/core/img/actions/upload.png differ diff --git a/core/img/actions/user.png b/core/img/actions/user.png index 2221ac679d1..5f2fddc0ea3 100644 Binary files a/core/img/actions/user.png and b/core/img/actions/user.png differ diff --git a/core/img/actions/user.svg b/core/img/actions/user.svg index aa719573708..65edc5ebec8 100644 --- a/core/img/actions/user.svg +++ b/core/img/actions/user.svg @@ -1,5 +1,5 @@ - + diff --git a/core/img/actions/view-close.png b/core/img/actions/view-close.png index 330ae09ea73..8422b733466 100644 Binary files a/core/img/actions/view-close.png and b/core/img/actions/view-close.png differ diff --git a/core/img/actions/view-next.png b/core/img/actions/view-next.png index f9e6174ae3f..8a23452e083 100644 Binary files a/core/img/actions/view-next.png and b/core/img/actions/view-next.png differ diff --git a/core/img/actions/view-pause.png b/core/img/actions/view-pause.png index 94696bf6868..1de1fb4654b 100644 Binary files a/core/img/actions/view-pause.png and b/core/img/actions/view-pause.png differ diff --git a/core/img/actions/view-pause.svg b/core/img/actions/view-pause.svg index d901a4d789e..f5fdc030479 100644 --- a/core/img/actions/view-pause.svg +++ b/core/img/actions/view-pause.svg @@ -1,6 +1,6 @@ - + diff --git a/core/img/actions/view-play.png b/core/img/actions/view-play.png index 721787d9c44..c506815c0cf 100644 Binary files a/core/img/actions/view-play.png and b/core/img/actions/view-play.png differ diff --git a/core/img/actions/view-previous.png b/core/img/actions/view-previous.png index 97b41a195ff..79dcb2301df 100644 Binary files a/core/img/actions/view-previous.png and b/core/img/actions/view-previous.png differ diff --git a/core/img/breadcrumb.png b/core/img/breadcrumb.png index 7e9593a36bf..5556920aa73 100644 Binary files a/core/img/breadcrumb.png and b/core/img/breadcrumb.png differ diff --git a/core/img/breadcrumb.svg b/core/img/breadcrumb.svg index f0b5c9218d5..10d6e4150cb 100644 --- a/core/img/breadcrumb.svg +++ b/core/img/breadcrumb.svg @@ -1,12 +1,4 @@ + - - - - image/svg+xml - - - - - - + diff --git a/core/img/desktopapp.svg b/core/img/desktopapp.svg index c2cfb016299..d63cfef0848 100644 --- a/core/img/desktopapp.svg +++ b/core/img/desktopapp.svg @@ -1,4 +1,5 @@ -image/svg+xml -Desktop app -Windows, OS X, Linux + + +Desktop app +Windows, OS X, Linux diff --git a/core/img/favicon-touch.png b/core/img/favicon-touch.png index 24770fb634f..27019a4ddef 100644 Binary files a/core/img/favicon-touch.png and b/core/img/favicon-touch.png differ diff --git a/core/img/favicon-touch.svg b/core/img/favicon-touch.svg index 68f36a8a9ac..8d548ef0359 100644 --- a/core/img/favicon-touch.svg +++ b/core/img/favicon-touch.svg @@ -1,4 +1,4 @@ - - + + diff --git a/core/img/favicon.png b/core/img/favicon.png index 02936243cb1..8067350ef47 100644 Binary files a/core/img/favicon.png and b/core/img/favicon.png differ diff --git a/core/img/favicon.svg b/core/img/favicon.svg index 39cb1742689..319fd434dc5 100644 --- a/core/img/favicon.svg +++ b/core/img/favicon.svg @@ -1,4 +1,4 @@ - - + + diff --git a/core/img/filetypes/application-epub+zip.png b/core/img/filetypes/application-epub+zip.png index b3e3b28b4d5..2399088b28a 100644 Binary files a/core/img/filetypes/application-epub+zip.png and b/core/img/filetypes/application-epub+zip.png differ diff --git a/core/img/filetypes/application-epub+zip.svg b/core/img/filetypes/application-epub+zip.svg index 041f9f15e68..7de28f4f216 100644 --- a/core/img/filetypes/application-epub+zip.svg +++ b/core/img/filetypes/application-epub+zip.svg @@ -1,761 +1,74 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/application-pdf.png b/core/img/filetypes/application-pdf.png index a9ab6d279b6..74676372671 100644 Binary files a/core/img/filetypes/application-pdf.png and b/core/img/filetypes/application-pdf.png differ diff --git a/core/img/filetypes/application-pdf.svg b/core/img/filetypes/application-pdf.svg index 47c2caabdad..b671e98725d 100644 --- a/core/img/filetypes/application-pdf.svg +++ b/core/img/filetypes/application-pdf.svg @@ -1,52 +1,48 @@ - + - + - + - + - + - + - + - - - + + + - - - - - - - - - - + + + + + + diff --git a/core/img/filetypes/application-rss+xml.png b/core/img/filetypes/application-rss+xml.png index e5bb322c573..5b18ee2cd4f 100644 Binary files a/core/img/filetypes/application-rss+xml.png and b/core/img/filetypes/application-rss+xml.png differ diff --git a/core/img/filetypes/application-rss+xml.svg b/core/img/filetypes/application-rss+xml.svg index 4fd98545a7d..54a9f46e4ec 100644 --- a/core/img/filetypes/application-rss+xml.svg +++ b/core/img/filetypes/application-rss+xml.svg @@ -1,40 +1,38 @@ - + - + - + - + - - + + - - - - - - - + + + + + diff --git a/core/img/filetypes/application-x-cbr.png b/core/img/filetypes/application-x-cbr.png index c61130cda31..c0d374a4596 100644 Binary files a/core/img/filetypes/application-x-cbr.png and b/core/img/filetypes/application-x-cbr.png differ diff --git a/core/img/filetypes/application-x-cbr.svg b/core/img/filetypes/application-x-cbr.svg index 9e3fc11d39d..3c9e150e790 100644 --- a/core/img/filetypes/application-x-cbr.svg +++ b/core/img/filetypes/application-x-cbr.svg @@ -1,771 +1,78 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/application.png b/core/img/filetypes/application.png index 9152cc1b744..b6b1bbce2f0 100644 Binary files a/core/img/filetypes/application.png and b/core/img/filetypes/application.png differ diff --git a/core/img/filetypes/application.svg b/core/img/filetypes/application.svg index 870a4ac2467..edce49e3e4e 100644 --- a/core/img/filetypes/application.svg +++ b/core/img/filetypes/application.svg @@ -1,59 +1,57 @@ - + - - + + - + - + - + - + - + - + - + - - - + + + - - - - - - - - + + + + + + diff --git a/core/img/filetypes/audio.png b/core/img/filetypes/audio.png index 3f56a7e2a9a..3c78bcfd173 100644 Binary files a/core/img/filetypes/audio.png and b/core/img/filetypes/audio.png differ diff --git a/core/img/filetypes/audio.svg b/core/img/filetypes/audio.svg index d5eda38e8aa..1b37a1e6eab 100644 --- a/core/img/filetypes/audio.svg +++ b/core/img/filetypes/audio.svg @@ -1,49 +1,47 @@ - + - + - + - + - + - + - + - - - + + + - + - - - - - - + + + + diff --git a/core/img/filetypes/calendar.png b/core/img/filetypes/calendar.png index d85b1db651c..d5c666a7695 100644 Binary files a/core/img/filetypes/calendar.png and b/core/img/filetypes/calendar.png differ diff --git a/core/img/filetypes/calendar.svg b/core/img/filetypes/calendar.svg index 0016749b936..7d62bb8fa12 100644 --- a/core/img/filetypes/calendar.svg +++ b/core/img/filetypes/calendar.svg @@ -1,94 +1,89 @@ - + - + - + - + - - - + + + - + - - - + + + - + - - + + - + - - - + + + - + - + - + - + - + - + - + - - - - image/svg+xml - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/database.png b/core/img/filetypes/database.png index 24788b2a37f..49b2b861757 100644 Binary files a/core/img/filetypes/database.png and b/core/img/filetypes/database.png differ diff --git a/core/img/filetypes/database.svg b/core/img/filetypes/database.svg index 6dfac54e68b..f3d4570015f 100644 --- a/core/img/filetypes/database.svg +++ b/core/img/filetypes/database.svg @@ -1,54 +1,47 @@ - + - + - + - - + + - - + + - - - - - + + + + + - - - + + + - - - + + + - - - - image/svg+xml - - - - - - - - - - - - - + + + + + + + + + + diff --git a/core/img/filetypes/file.png b/core/img/filetypes/file.png index c20f13c2e13..54a242d9d29 100644 Binary files a/core/img/filetypes/file.png and b/core/img/filetypes/file.png differ diff --git a/core/img/filetypes/file.svg b/core/img/filetypes/file.svg index 3d91c341143..ab7db2d2e45 100644 --- a/core/img/filetypes/file.svg +++ b/core/img/filetypes/file.svg @@ -5,32 +5,28 @@ - + - + - - - + + + - - - - - - - - - + + + + + diff --git a/core/img/filetypes/flash.png b/core/img/filetypes/flash.png index bcde641da3c..75424f81d68 100644 Binary files a/core/img/filetypes/flash.png and b/core/img/filetypes/flash.png differ diff --git a/core/img/filetypes/flash.svg b/core/img/filetypes/flash.svg index cb823703d9b..b373fd6512d 100644 --- a/core/img/filetypes/flash.svg +++ b/core/img/filetypes/flash.svg @@ -5,56 +5,52 @@ - + - + - - - + + + - + - + - + - + - - - - - - - - - + + + + + - - - + + + diff --git a/core/img/filetypes/folder-drag-accept.png b/core/img/filetypes/folder-drag-accept.png index 19c2d2eebd4..086f38afd83 100644 Binary files a/core/img/filetypes/folder-drag-accept.png and b/core/img/filetypes/folder-drag-accept.png differ diff --git a/core/img/filetypes/folder-drag-accept.svg b/core/img/filetypes/folder-drag-accept.svg index a7885c80be7..5ee8f0e5ff3 100644 --- a/core/img/filetypes/folder-drag-accept.svg +++ b/core/img/filetypes/folder-drag-accept.svg @@ -1,335 +1,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/folder-external.png b/core/img/filetypes/folder-external.png index 997f07b2bac..7da0a42fc24 100644 Binary files a/core/img/filetypes/folder-external.png and b/core/img/filetypes/folder-external.png differ diff --git a/core/img/filetypes/folder-external.svg b/core/img/filetypes/folder-external.svg index 89ec9a8ecaa..bf07bdd79ce 100644 --- a/core/img/filetypes/folder-external.svg +++ b/core/img/filetypes/folder-external.svg @@ -1,68 +1,60 @@ + - - - - image/svg+xml - - - - - - + - - + + - + - + - + - + - + - + - + - - + + - + - + - - - + + + - - - + + + - - - - - - + + + + + + diff --git a/core/img/filetypes/folder-public.png b/core/img/filetypes/folder-public.png index c716607e26e..4758fb25408 100644 Binary files a/core/img/filetypes/folder-public.png and b/core/img/filetypes/folder-public.png differ diff --git a/core/img/filetypes/folder-public.svg b/core/img/filetypes/folder-public.svg index a949833f95a..04a11f26899 100644 --- a/core/img/filetypes/folder-public.svg +++ b/core/img/filetypes/folder-public.svg @@ -1,68 +1,60 @@ + - - - - image/svg+xml - - - - - - + - - + + - + - + - + - + - + - + - + - - + + - + - + - - - + + + - - - + + + - - - - - - + + + + + + diff --git a/core/img/filetypes/folder-shared.png b/core/img/filetypes/folder-shared.png index e547a242062..e3c0ee9815a 100644 Binary files a/core/img/filetypes/folder-shared.png and b/core/img/filetypes/folder-shared.png differ diff --git a/core/img/filetypes/folder-shared.svg b/core/img/filetypes/folder-shared.svg index 56aa9634d27..a389e535439 100644 --- a/core/img/filetypes/folder-shared.svg +++ b/core/img/filetypes/folder-shared.svg @@ -1,68 +1,60 @@ + - - - - image/svg+xml - - - - - - + - - + + - + - + - + - + - + - + - + - - + + - + - + - - - + + + - - - + + + - - - - - - + + + + + + diff --git a/core/img/filetypes/folder.png b/core/img/filetypes/folder.png index b7be63d5836..bffa01fa071 100644 Binary files a/core/img/filetypes/folder.png and b/core/img/filetypes/folder.png differ diff --git a/core/img/filetypes/folder.svg b/core/img/filetypes/folder.svg index 92d4cc22718..8271ca3793a 100644 --- a/core/img/filetypes/folder.svg +++ b/core/img/filetypes/folder.svg @@ -1,60 +1,58 @@ - + - + - + - + - + - + - + - + - + - - - - - + + + - - - + + + - - - + + + diff --git a/core/img/filetypes/font.png b/core/img/filetypes/font.png index 9404c3ca6ac..535e03dfa77 100644 Binary files a/core/img/filetypes/font.png and b/core/img/filetypes/font.png differ diff --git a/core/img/filetypes/font.svg b/core/img/filetypes/font.svg index 8fca5ff9eff..13c0596006b 100644 --- a/core/img/filetypes/font.svg +++ b/core/img/filetypes/font.svg @@ -5,33 +5,31 @@ - + - - - - + + + + - + - + - + - - - - - - - - - + + + + + + + diff --git a/core/img/filetypes/image-svg+xml.png b/core/img/filetypes/image-svg+xml.png index e3dd52489d3..a847f78fcd8 100644 Binary files a/core/img/filetypes/image-svg+xml.png and b/core/img/filetypes/image-svg+xml.png differ diff --git a/core/img/filetypes/image-svg+xml.svg b/core/img/filetypes/image-svg+xml.svg index 06df5f54da6..1f0a54a21ca 100644 --- a/core/img/filetypes/image-svg+xml.svg +++ b/core/img/filetypes/image-svg+xml.svg @@ -1,56 +1,48 @@ - + - + - + - + - - + + - + - - - - - - - - - + + + + + - - - - - - - - - - - + + + + + + + diff --git a/core/img/filetypes/image.png b/core/img/filetypes/image.png index 087f5dcdbdf..5cdc05029af 100644 Binary files a/core/img/filetypes/image.png and b/core/img/filetypes/image.png differ diff --git a/core/img/filetypes/image.svg b/core/img/filetypes/image.svg index 50991f7359d..86cbb633bf3 100644 --- a/core/img/filetypes/image.svg +++ b/core/img/filetypes/image.svg @@ -1,61 +1,57 @@ - + - - + + - + - + - + - + - + - + - + - - - - - - - - - - - - - - + + + + + + + + + + diff --git a/core/img/filetypes/package-x-generic.png b/core/img/filetypes/package-x-generic.png index e08cc5480ce..4f5c6583bf1 100644 Binary files a/core/img/filetypes/package-x-generic.png and b/core/img/filetypes/package-x-generic.png differ diff --git a/core/img/filetypes/package-x-generic.svg b/core/img/filetypes/package-x-generic.svg index 13ab5b7550e..e00438421af 100644 --- a/core/img/filetypes/package-x-generic.svg +++ b/core/img/filetypes/package-x-generic.svg @@ -1,62 +1,53 @@ - + - - - - image/svg+xml - - - - - - + - - + + - + - - + + - + - + - - + + - + - - + + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + diff --git a/core/img/filetypes/text-code.png b/core/img/filetypes/text-code.png index 753d151f538..c0e75901081 100644 Binary files a/core/img/filetypes/text-code.png and b/core/img/filetypes/text-code.png differ diff --git a/core/img/filetypes/text-code.svg b/core/img/filetypes/text-code.svg index 61a5c19f511..b85ddece9c0 100644 --- a/core/img/filetypes/text-code.svg +++ b/core/img/filetypes/text-code.svg @@ -1,42 +1,38 @@ - + - + - + - + - - + + - - - - - - - - - - + + + + + + @@ -58,9 +54,7 @@ - - - - - + + + diff --git a/core/img/filetypes/text-html.png b/core/img/filetypes/text-html.png index dd17b750103..c3bbf2bfd91 100644 Binary files a/core/img/filetypes/text-html.png and b/core/img/filetypes/text-html.png differ diff --git a/core/img/filetypes/text-html.svg b/core/img/filetypes/text-html.svg index c41964738d0..99215d303ea 100644 --- a/core/img/filetypes/text-html.svg +++ b/core/img/filetypes/text-html.svg @@ -1,49 +1,43 @@ - + - + - + - + - - + + - - - - - - - - - + + + + + - - - - - + + + diff --git a/core/img/filetypes/text-vcard.png b/core/img/filetypes/text-vcard.png index 2e52d1ecb3a..6849792dfd2 100644 Binary files a/core/img/filetypes/text-vcard.png and b/core/img/filetypes/text-vcard.png differ diff --git a/core/img/filetypes/text-vcard.svg b/core/img/filetypes/text-vcard.svg index 27054be57e6..f9d50fef77c 100644 --- a/core/img/filetypes/text-vcard.svg +++ b/core/img/filetypes/text-vcard.svg @@ -1,60 +1,53 @@ - + - - - + + + - + - - - + + + - + - - - - - - + + + + + + - + - - - + + + - + - - + + - + - - - - image/svg+xml - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/core/img/filetypes/text-x-c.png b/core/img/filetypes/text-x-c.png index b9edd1e866e..2bdb16a2a77 100644 Binary files a/core/img/filetypes/text-x-c.png and b/core/img/filetypes/text-x-c.png differ diff --git a/core/img/filetypes/text-x-c.svg b/core/img/filetypes/text-x-c.svg index 35a6a0cdfe2..462286754f9 100644 --- a/core/img/filetypes/text-x-c.svg +++ b/core/img/filetypes/text-x-c.svg @@ -1,75 +1,70 @@ - + - - + + - - + + - - + + - + - - - + + + - + - + - - - + + + - + - + - - - - + + + + - - - - - + + + + + - - - - image/svg+xml - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/text-x-h.png b/core/img/filetypes/text-x-h.png index 37a8805b506..7b4a36cdbe9 100644 Binary files a/core/img/filetypes/text-x-h.png and b/core/img/filetypes/text-x-h.png differ diff --git a/core/img/filetypes/text-x-h.svg b/core/img/filetypes/text-x-h.svg index 38ed04690fc..9ed1bd6ff9c 100644 --- a/core/img/filetypes/text-x-h.svg +++ b/core/img/filetypes/text-x-h.svg @@ -1,79 +1,74 @@ - + - + - + - - - + + + - - + + - - + + - - + + - - - + + + - + - - - + + + - + - + - - - - + + + + - - - - - + + + + + - - - - image/svg+xml - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/text-x-javascript.png b/core/img/filetypes/text-x-javascript.png index 24d09ce9781..1e1d3140f63 100644 Binary files a/core/img/filetypes/text-x-javascript.png and b/core/img/filetypes/text-x-javascript.png differ diff --git a/core/img/filetypes/text-x-javascript.svg b/core/img/filetypes/text-x-javascript.svg index 0cc52ce6ba7..4e9819bb685 100644 --- a/core/img/filetypes/text-x-javascript.svg +++ b/core/img/filetypes/text-x-javascript.svg @@ -1,76 +1,71 @@ - + - + - - - + + + - + - - - + + + - + - + - - - + + + - + - + - - - - + + + + - - - - - + + + + + - + - - + + - + - - - - image/svg+xml - - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/core/img/filetypes/text-x-python.png b/core/img/filetypes/text-x-python.png index 57148f4b90d..fbaf9a342f6 100644 Binary files a/core/img/filetypes/text-x-python.png and b/core/img/filetypes/text-x-python.png differ diff --git a/core/img/filetypes/text-x-python.svg b/core/img/filetypes/text-x-python.svg index 00755e6d0c2..b0ed6fc536f 100644 --- a/core/img/filetypes/text-x-python.svg +++ b/core/img/filetypes/text-x-python.svg @@ -1,87 +1,80 @@ - + - + - - - + + + - + - - - + + + - + - - - + + + - - + - - + + - - - + + - + - + - - - + + + - + - + - - - - + + + + - - - - - + + + + + - - - - image/svg+xml - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - diff --git a/core/img/filetypes/text.png b/core/img/filetypes/text.png index 6b069c82c11..73080fb3ea0 100644 Binary files a/core/img/filetypes/text.png and b/core/img/filetypes/text.png differ diff --git a/core/img/filetypes/text.svg b/core/img/filetypes/text.svg index 69a1bcd98c3..32685b586cb 100644 --- a/core/img/filetypes/text.svg +++ b/core/img/filetypes/text.svg @@ -1,43 +1,39 @@ - + - + - + - + - - + + - - - - - - - - + + + + - - - + + + diff --git a/core/img/filetypes/video.png b/core/img/filetypes/video.png index 045754df26f..a5793d6eb10 100644 Binary files a/core/img/filetypes/video.png and b/core/img/filetypes/video.png differ diff --git a/core/img/filetypes/video.svg b/core/img/filetypes/video.svg index 67691369ac9..b54e08bdf2f 100644 --- a/core/img/filetypes/video.svg +++ b/core/img/filetypes/video.svg @@ -1,85 +1,92 @@ - + - - - - + + + + - - - + + + - - + + - - + + - - + + - - - + + + - - - + + + - - - - - - - - - + + + + + + + + + - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/web.png b/core/img/filetypes/web.png index c3802312645..33063212466 100644 Binary files a/core/img/filetypes/web.png and b/core/img/filetypes/web.png differ diff --git a/core/img/filetypes/web.svg b/core/img/filetypes/web.svg index 67775a2233b..5b5a9c3b771 100644 --- a/core/img/filetypes/web.svg +++ b/core/img/filetypes/web.svg @@ -1,45 +1,36 @@ - + - - - - image/svg+xml - - - - - - + - + - + - - + + - + - + - - - + + + - - - - - - - + + + + + + + diff --git a/core/img/filetypes/x-office-document.png b/core/img/filetypes/x-office-document.png index fcd28e9a292..6c0c4f8c228 100644 Binary files a/core/img/filetypes/x-office-document.png and b/core/img/filetypes/x-office-document.png differ diff --git a/core/img/filetypes/x-office-document.svg b/core/img/filetypes/x-office-document.svg index fc51a3a1b70..eb2368722e2 100644 --- a/core/img/filetypes/x-office-document.svg +++ b/core/img/filetypes/x-office-document.svg @@ -1,60 +1,53 @@ - + - + - - - + + + - + - - + + - + - + - - - + + + - + - - - - + + + + - - - - - + + + + + - - - - image/svg+xml - - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/core/img/filetypes/x-office-presentation.png b/core/img/filetypes/x-office-presentation.png index 7ee552ba7c8..b129c76de60 100644 Binary files a/core/img/filetypes/x-office-presentation.png and b/core/img/filetypes/x-office-presentation.png differ diff --git a/core/img/filetypes/x-office-presentation.svg b/core/img/filetypes/x-office-presentation.svg index 821798d50fd..534e695537e 100644 --- a/core/img/filetypes/x-office-presentation.svg +++ b/core/img/filetypes/x-office-presentation.svg @@ -1,109 +1,108 @@ - + - - - + + + - + - - - + + + - + - + - - - - - - + + + + + + - + - - - + + + - + - + - + - - + + - + - + - + - + - + - + - + - - - - image/svg+xml - - - - - - - - - - - + + + + - - - + + + - - - - - - - - - - - + + + - + + + + + + + + + + + + + + + + + + + diff --git a/core/img/filetypes/x-office-spreadsheet.png b/core/img/filetypes/x-office-spreadsheet.png index dfdc74a8bf6..9efe6f29501 100644 Binary files a/core/img/filetypes/x-office-spreadsheet.png and b/core/img/filetypes/x-office-spreadsheet.png differ diff --git a/core/img/filetypes/x-office-spreadsheet.svg b/core/img/filetypes/x-office-spreadsheet.svg index af40bb252a2..aae8f3c95ca 100644 --- a/core/img/filetypes/x-office-spreadsheet.svg +++ b/core/img/filetypes/x-office-spreadsheet.svg @@ -1,64 +1,63 @@ - + - + - - - + + + - + - + - - - - + + + + - - - - - + + + + + - + - - + + - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/image-optimization.sh b/core/img/image-optimization.sh index 0a96bf558d1..e6374c419b2 100755 --- a/core/img/image-optimization.sh +++ b/core/img/image-optimization.sh @@ -2,7 +2,7 @@ function recursive_optimize_images() { cd $1; -optipng -o6 *.png; +optipng -o6 -strip all *.png; jpegoptim --strip-all *.jpg; for svg in `ls *.svg`; do diff --git a/core/img/logo-wide.png b/core/img/logo-wide.png index 5b7d4c6f915..b15c76ecb15 100644 Binary files a/core/img/logo-wide.png and b/core/img/logo-wide.png differ diff --git a/core/img/logo-wide.svg b/core/img/logo-wide.svg index 29c617d6f83..bacba6755c5 100644 --- a/core/img/logo-wide.svg +++ b/core/img/logo-wide.svg @@ -1,3 +1,3 @@ - - + + diff --git a/core/img/logo.png b/core/img/logo.png index 8d112d99be5..2c551a1c22c 100644 Binary files a/core/img/logo.png and b/core/img/logo.png differ diff --git a/core/img/logo.svg b/core/img/logo.svg index cfb20b60e4f..06008c41c57 100644 --- a/core/img/logo.svg +++ b/core/img/logo.svg @@ -1,4 +1,4 @@ - - + + diff --git a/core/img/places/calendar-dark.png b/core/img/places/calendar-dark.png index 920dee610dd..39032bcfa1a 100644 Binary files a/core/img/places/calendar-dark.png and b/core/img/places/calendar-dark.png differ diff --git a/core/img/places/contacts-dark.png b/core/img/places/contacts-dark.png index a08339d1d3d..ec60fb603fb 100644 Binary files a/core/img/places/contacts-dark.png and b/core/img/places/contacts-dark.png differ diff --git a/core/img/places/contacts-dark.svg b/core/img/places/contacts-dark.svg index 3fc10cfe08f..9c95478cdfe 100644 --- a/core/img/places/contacts-dark.svg +++ b/core/img/places/contacts-dark.svg @@ -1,7 +1,7 @@ - - + + diff --git a/core/img/places/file.png b/core/img/places/file.png index 63837a1af90..ff179e96b64 100644 Binary files a/core/img/places/file.png and b/core/img/places/file.png differ diff --git a/core/img/places/file.svg b/core/img/places/file.svg index f93f3ef6fae..ea2ea068ce6 100644 --- a/core/img/places/file.svg +++ b/core/img/places/file.svg @@ -1,14 +1,14 @@ - + - - + + diff --git a/core/img/places/files.png b/core/img/places/files.png index 52e0c6bf949..16c78efe40f 100644 Binary files a/core/img/places/files.png and b/core/img/places/files.png differ diff --git a/core/img/places/files.svg b/core/img/places/files.svg index d446ef655ae..970f5b56296 100644 --- a/core/img/places/files.svg +++ b/core/img/places/files.svg @@ -1,6 +1,6 @@ - + diff --git a/core/img/places/folder.png b/core/img/places/folder.png index 46079e03e9e..d8eb4ccf4c6 100644 Binary files a/core/img/places/folder.png and b/core/img/places/folder.png differ diff --git a/core/img/places/folder.svg b/core/img/places/folder.svg index 676f10afe0b..edc9e7e208a 100644 --- a/core/img/places/folder.svg +++ b/core/img/places/folder.svg @@ -1,18 +1,18 @@ - + - + - + - + diff --git a/core/img/places/home.png b/core/img/places/home.png index e664719e2ec..8905bd7fb3c 100644 Binary files a/core/img/places/home.png and b/core/img/places/home.png differ diff --git a/core/img/places/home.svg b/core/img/places/home.svg index 80b7dcc8663..bb75f259b4b 100644 --- a/core/img/places/home.svg +++ b/core/img/places/home.svg @@ -1,11 +1,11 @@ - + - + diff --git a/core/img/places/link.png b/core/img/places/link.png index 44b7e199a72..7cf97115ded 100644 Binary files a/core/img/places/link.png and b/core/img/places/link.png differ diff --git a/core/img/places/link.svg b/core/img/places/link.svg index 8784ebc1456..f012db6315c 100644 --- a/core/img/places/link.svg +++ b/core/img/places/link.svg @@ -1,12 +1,4 @@ + - - - - image/svg+xml - - - - - - + diff --git a/core/img/places/music.png b/core/img/places/music.png index 5b71e19ee3c..953a2c24665 100644 Binary files a/core/img/places/music.png and b/core/img/places/music.png differ diff --git a/core/img/places/picture.png b/core/img/places/picture.png index 2b96ea518ce..b60da3b5fd8 100644 Binary files a/core/img/places/picture.png and b/core/img/places/picture.png differ diff --git a/core/img/places/picture.svg b/core/img/places/picture.svg index 82d457f5c7c..b4c81b7a937 100644 --- a/core/img/places/picture.svg +++ b/core/img/places/picture.svg @@ -1,4 +1,4 @@ - + diff --git a/core/img/rating/s1.png b/core/img/rating/s1.png index 015f9483714..9d5014106e5 100644 Binary files a/core/img/rating/s1.png and b/core/img/rating/s1.png differ diff --git a/core/img/rating/s10.png b/core/img/rating/s10.png index b47b05e4f89..b9c190f8ce7 100644 Binary files a/core/img/rating/s10.png and b/core/img/rating/s10.png differ diff --git a/core/img/rating/s11.png b/core/img/rating/s11.png index 3dcb4bb4830..c674569c389 100644 Binary files a/core/img/rating/s11.png and b/core/img/rating/s11.png differ diff --git a/core/img/rating/s2.png b/core/img/rating/s2.png index 94ac5bc9566..6846c8771f5 100644 Binary files a/core/img/rating/s2.png and b/core/img/rating/s2.png differ diff --git a/core/img/rating/s3.png b/core/img/rating/s3.png index 42a814ca081..2f132cc5fa1 100644 Binary files a/core/img/rating/s3.png and b/core/img/rating/s3.png differ diff --git a/core/img/rating/s4.png b/core/img/rating/s4.png index 5ce38887570..55e917f92e6 100644 Binary files a/core/img/rating/s4.png and b/core/img/rating/s4.png differ diff --git a/core/img/rating/s5.png b/core/img/rating/s5.png index da4bbc58479..fa76c311c69 100644 Binary files a/core/img/rating/s5.png and b/core/img/rating/s5.png differ diff --git a/core/img/rating/s6.png b/core/img/rating/s6.png index 267c52ad3c0..8856309f838 100644 Binary files a/core/img/rating/s6.png and b/core/img/rating/s6.png differ diff --git a/core/img/rating/s7.png b/core/img/rating/s7.png index 3381d066d87..4112e14fde2 100644 Binary files a/core/img/rating/s7.png and b/core/img/rating/s7.png differ diff --git a/core/img/rating/s8.png b/core/img/rating/s8.png index 091dc5b21f0..ce25cf58df9 100644 Binary files a/core/img/rating/s8.png and b/core/img/rating/s8.png differ diff --git a/core/img/rating/s9.png b/core/img/rating/s9.png index dfe83563433..3197f23785f 100644 Binary files a/core/img/rating/s9.png and b/core/img/rating/s9.png differ -- cgit v1.2.3 From b76a3993d44ed61c181b36a27560f026f470bc56 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 20 Feb 2014 09:47:59 +0100 Subject: fix master - #7274 brokes it --- lib/private/appframework/middleware/middlewaredispatcher.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/private/appframework/middleware/middlewaredispatcher.php b/lib/private/appframework/middleware/middlewaredispatcher.php index 2a715598fc4..598743e523f 100644 --- a/lib/private/appframework/middleware/middlewaredispatcher.php +++ b/lib/private/appframework/middleware/middlewaredispatcher.php @@ -26,6 +26,7 @@ namespace OC\AppFramework\Middleware; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Response; +use OCP\AppFramework\MiddleWare; /** * This class is used to store and run all the middleware in correct order -- cgit v1.2.3 From 49f2014e0c131a07bc0139ce437cb8c170ad518d Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 20 Feb 2014 10:01:49 +0100 Subject: Revert "Added extra checks for ext storage class" This reverts commit 9e9a5b9ea1f9b4699cf2d0c621f3f911f3639df9. Unit tests weren't ready, need further tweaking. --- apps/files_external/lib/config.php | 8 +------- apps/files_external/tests/mountconfig.php | 24 ------------------------ 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index cd3e7f3a4a6..94dc5fb7ad8 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -277,21 +277,15 @@ class OC_Mount_Config { $mountType, $applicable, $isPersonal = false) { - $backends = self::getBackends(); $mountPoint = OC\Files\Filesystem::normalizePath($mountPoint); if ($mountPoint === '' || $mountPoint === '/' || $mountPoint == '/Shared') { // can't mount at root or "Shared" folder return false; } - - if (!isset($backends[$class])) { - // invalid backend - return false; - } if ($isPersonal) { // Verify that the mount point applies for the current user // Prevent non-admin users from mounting local storage - if ($applicable !== OCP\User::getUser() || strtolower($class) === '\oc\files\storage\local') { + if ($applicable != OCP\User::getUser() || $class == '\OC\Files\Storage\Local') { return false; } $mountPoint = '/'.$applicable.'/files/'.ltrim($mountPoint, '/'); diff --git a/apps/files_external/tests/mountconfig.php b/apps/files_external/tests/mountconfig.php index 4c61b8961f3..941aec680bb 100644 --- a/apps/files_external/tests/mountconfig.php +++ b/apps/files_external/tests/mountconfig.php @@ -48,28 +48,4 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase { $this->assertEquals(false, OC_Mount_Config::addMountPoint('/Shared', $storageClass, array(), $mountType, $applicable, $isPersonal)); } - - public function testAddMountPointSingleUser() { - \OC_User::setUserId('test'); - $mountType = 'user'; - $applicable = 'test'; - $isPersonal = true; - // local - $this->assertEquals(false, OC_Mount_Config::addMountPoint('/ext', '\OC\Files\storage\local', array(), $mountType, $applicable, $isPersonal)); - // non-local - $this->assertEquals(true, OC_Mount_Config::addMountPoint('/ext', '\OC\Files\Storage\SFTP', array(), $mountType, $applicable, $isPersonal)); - - } - - public function testAddMountPointUnexistClass() { - \OC_User::setUserId('test'); - $storageClass = 'Unexist_Storage'; - $mountType = 'user'; - $applicable = 'test'; - $isPersonal = true; - // local - // non-local - $this->assertEquals(false, OC_Mount_Config::addMountPoint('/ext', $storageClass, array(), $mountType, $applicable, $isPersonal)); - - } } -- cgit v1.2.3