diff options
49 files changed, 260 insertions, 102 deletions
diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 928eb0c778e..1d4d0774482 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -580,6 +580,9 @@ a.action > img { #fileList .popovermenu { margin-right: 21px; } +.ie8 #fileList .popovermenu { + margin-top: -10px; +} .ie8 #fileList a.action img, #fileList tr:hover a.action, @@ -752,6 +755,12 @@ table.dragshadow td.size { margin: 0; } +.newFileMenu.popovermenu a.menuitem.active { + opacity: 1; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; + filter: alpha(opacity=100); +} + .newFileMenu.bubble:after { left: 75px; right: auto; diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 7a025e772c5..9c4e43b3b8b 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1411,10 +1411,10 @@ generatePreviewUrl: function(urlSpec) { urlSpec = urlSpec || {}; if (!urlSpec.x) { - urlSpec.x = this.$table.data('preview-x') || 36; + urlSpec.x = this.$table.data('preview-x') || 32; } if (!urlSpec.y) { - urlSpec.y = this.$table.data('preview-y') || 36; + urlSpec.y = this.$table.data('preview-y') || 32; } urlSpec.x *= window.devicePixelRatio; urlSpec.y *= window.devicePixelRatio; diff --git a/apps/files/js/mainfileinfodetailview.js b/apps/files/js/mainfileinfodetailview.js index 39a00d0a5a5..b50e92dea8c 100644 --- a/apps/files/js/mainfileinfodetailview.js +++ b/apps/files/js/mainfileinfodetailview.js @@ -131,6 +131,7 @@ } else { // TODO: special icons / shared / external $iconDiv.css('background-image', 'url("' + OC.MimeType.getIconUrl('dir') + '")'); + OC.Util.scaleFixForIE8($iconDiv); } this.$el.find('[title]').tooltip({placement: 'bottom'}); } else { @@ -214,6 +215,7 @@ $iconDiv.css({ 'background-image': 'url("' + $iconDiv.previewImg + '")' }); + OC.Util.scaleFixForIE8($iconDiv); }.bind(this) }); } diff --git a/apps/files/js/newfilemenu.js b/apps/files/js/newfilemenu.js index 4c021e6b873..0a67aba202b 100644 --- a/apps/files/js/newfilemenu.js +++ b/apps/files/js/newfilemenu.js @@ -84,6 +84,8 @@ OC.hideMenus(); } else { event.preventDefault(); + this.$el.find('.menuitem.active').removeClass('active'); + $target.addClass('active'); this._promptFileName($target); } }, @@ -210,6 +212,7 @@ fileType: 'folder' }] })); + OC.Util.scaleFixForIE8(this.$('.svg')); }, /** diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php index bbbce8473de..7ebf80ee8b2 100644 --- a/apps/files/templates/list.php +++ b/apps/files/templates/list.php @@ -51,7 +51,7 @@ <p></p> </div> -<table id="filestable" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>" data-preview-x="36" data-preview-y="36"> +<table id="filestable" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>" data-preview-x="32" data-preview-y="32"> <thead> <tr> <th id='headerName' class="hidden column-name"> diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php index 6ddd4786c2a..69894bb8da5 100644 --- a/apps/files_sharing/ajax/publicpreview.php +++ b/apps/files_sharing/ajax/publicpreview.php @@ -28,8 +28,8 @@ OCP\JSON::checkAppEnabled('files_sharing'); \OC_User::setIncognitoMode(true); $file = array_key_exists('file', $_GET) ? (string) $_GET['file'] : ''; -$maxX = array_key_exists('x', $_GET) ? (int) $_GET['x'] : '36'; -$maxY = array_key_exists('y', $_GET) ? (int) $_GET['y'] : '36'; +$maxX = array_key_exists('x', $_GET) ? (int) $_GET['x'] : '32'; +$maxY = array_key_exists('y', $_GET) ? (int) $_GET['y'] : '32'; $scalingUp = array_key_exists('scalingup', $_GET) ? (bool) $_GET['scalingup'] : true; $token = array_key_exists('t', $_GET) ? (string) $_GET['t'] : ''; $keepAspect = array_key_exists('a', $_GET) ? true : false; diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 2ba1a92af3a..16b4f1589b1 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -161,10 +161,10 @@ OCA.Sharing.PublicApp = { this.fileList.generatePreviewUrl = function (urlSpec) { urlSpec = urlSpec || {}; if (!urlSpec.x) { - urlSpec.x = 36; + urlSpec.x = 32; } if (!urlSpec.y) { - urlSpec.y = 36; + urlSpec.y = 32; } urlSpec.x *= window.devicePixelRatio; urlSpec.y *= window.devicePixelRatio; diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/controllers/sharecontroller.php index ecf3ee853ee..28feb3110b4 100644 --- a/apps/files_sharing/lib/controllers/sharecontroller.php +++ b/apps/files_sharing/lib/controllers/sharecontroller.php @@ -46,6 +46,7 @@ use OCA\Files_Sharing\Helper; use OCP\User; use OCP\Util; use OCA\Files_Sharing\Activity; +use \OCP\Files\NotFoundException; /** * Class ShareController @@ -148,6 +149,7 @@ class ShareController extends Controller { * @param string $token * @param string $path * @return TemplateResponse|RedirectResponse + * @throws NotFoundException */ public function showShare($token, $path = '') { \OC_User::setIncognitoMode(true); @@ -171,7 +173,7 @@ class ShareController extends Controller { $getPath = Filesystem::normalizePath($path); $originalSharePath .= $path; } else { - throw new OCP\Files\NotFoundException(); + throw new NotFoundException(); } $file = basename($originalSharePath); @@ -303,7 +305,7 @@ class ShareController extends Controller { /** * @param string $token * @return string Resolved file path of the token - * @throws \Exception In case share could not get properly resolved + * @throws NotFoundException In case share could not get properly resolved */ private function getPath($token) { $linkItem = Share::getShareByToken($token, false); @@ -312,7 +314,7 @@ class ShareController extends Controller { $rootLinkItem = Share::resolveReShare($linkItem); if (isset($rootLinkItem['uid_owner'])) { if(!$this->userManager->userExists($rootLinkItem['uid_owner'])) { - throw new \Exception('Owner of the share does not exist anymore'); + throw new NotFoundException('Owner of the share does not exist anymore'); } OC_Util::tearDownFS(); OC_Util::setupFS($rootLinkItem['uid_owner']); @@ -324,6 +326,6 @@ class ShareController extends Controller { } } - throw new \Exception('No file found belonging to file.'); + throw new NotFoundException('No file found belonging to file.'); } } diff --git a/apps/files_sharing/lib/middleware/sharingcheckmiddleware.php b/apps/files_sharing/lib/middleware/sharingcheckmiddleware.php index 1c29b1da736..61dfd914d0b 100644 --- a/apps/files_sharing/lib/middleware/sharingcheckmiddleware.php +++ b/apps/files_sharing/lib/middleware/sharingcheckmiddleware.php @@ -27,6 +27,7 @@ use OCP\App\IAppManager; use OCP\AppFramework\Http\NotFoundResponse; use OCP\AppFramework\Middleware; use OCP\AppFramework\Http\TemplateResponse; +use OCP\Files\NotFoundException; use OCP\IConfig; /** @@ -58,22 +59,32 @@ class SharingCheckMiddleware extends Middleware { /** * Check if sharing is enabled before the controllers is executed + * + * @param \OCP\AppFramework\Controller $controller + * @param string $methodName + * @throws NotFoundException */ public function beforeController($controller, $methodName) { if(!$this->isSharingEnabled()) { - throw new \Exception('Sharing is disabled.'); + throw new NotFoundException('Sharing is disabled.'); } } /** - * Return 404 page in case of an exception + * Return 404 page in case of a not found exception + * * @param \OCP\AppFramework\Controller $controller * @param string $methodName * @param \Exception $exception - * @return TemplateResponse + * @return NotFoundResponse + * @throws \Exception */ - public function afterException($controller, $methodName, \Exception $exception){ - return new NotFoundResponse(); + public function afterException($controller, $methodName, \Exception $exception) { + if(is_a($exception, '\OCP\Files\NotFoundException')) { + return new NotFoundResponse(); + } + + throw $exception; } /** diff --git a/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php b/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php index 58f4b841339..3171d45d331 100644 --- a/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php +++ b/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php @@ -23,7 +23,8 @@ */ namespace OCA\Files_Sharing\Middleware; - +use OCP\AppFramework\Http\NotFoundResponse; +use OCP\Files\NotFoundException; /** * @package OCA\Files_Sharing\Middleware\SharingCheckMiddleware @@ -36,12 +37,16 @@ class SharingCheckMiddlewareTest extends \Test\TestCase { private $appManager; /** @var SharingCheckMiddleware */ private $sharingCheckMiddleware; + /** @var \OCP\AppFramework\Controller */ + private $controllerMock; protected function setUp() { $this->config = $this->getMockBuilder('\OCP\IConfig') ->disableOriginalConstructor()->getMock(); $this->appManager = $this->getMockBuilder('\OCP\App\IAppManager') ->disableOriginalConstructor()->getMock(); + $this->controllerMock = $this->getMockBuilder('\OCP\AppFramework\Controller') + ->disableOriginalConstructor()->getMock(); $this->sharingCheckMiddleware = new SharingCheckMiddleware('files_sharing', $this->config, $this->appManager); } @@ -116,4 +121,52 @@ class SharingCheckMiddlewareTest extends \Test\TestCase { $this->assertFalse(self::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled')); } + public function testBeforeControllerWithSharingEnabled() { + $this->appManager + ->expects($this->once()) + ->method('isEnabledForUser') + ->with('files_sharing') + ->will($this->returnValue(true)); + + $this->config + ->expects($this->at(0)) + ->method('getAppValue') + ->with('core', 'shareapi_enabled', 'yes') + ->will($this->returnValue('yes')); + + $this->config + ->expects($this->at(1)) + ->method('getAppValue') + ->with('core', 'shareapi_allow_links', 'yes') + ->will($this->returnValue('yes')); + + $this->sharingCheckMiddleware->beforeController($this->controllerMock, 'myMethod'); + } + + /** + * @expectedException \OCP\Files\NotFoundException + * @expectedExceptionMessage Sharing is disabled. + */ + public function testBeforeControllerWithSharingDisabled() { + $this->appManager + ->expects($this->once()) + ->method('isEnabledForUser') + ->with('files_sharing') + ->will($this->returnValue(false)); + + $this->sharingCheckMiddleware->beforeController($this->controllerMock, 'myMethod'); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage My Exception message + */ + public function testAfterExceptionWithRegularException() { + $this->sharingCheckMiddleware->afterException($this->controllerMock, 'myMethod', new \Exception('My Exception message')); + } + + public function testAfterExceptionWithNotFoundException() { + $this->assertEquals(new NotFoundResponse(), $this->sharingCheckMiddleware->afterException($this->controllerMock, 'myMethod', new NotFoundException('My Exception message'))); + } + } diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index 2a9df94988d..840fd4fa146 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -908,6 +908,6 @@ class Trashbin { * @return string */ public static function preview_icon($path) { - return \OCP\Util::linkToRoute('core_ajax_trashbin_preview', array('x' => 36, 'y' => 36, 'file' => $path)); + return \OCP\Util::linkToRoute('core_ajax_trashbin_preview', array('x' => 32, 'y' => 32, 'file' => $path)); } } diff --git a/config/config.sample.php b/config/config.sample.php index e0c486d75c1..cf4b25b0674 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -417,19 +417,21 @@ $CONFIG = array( * * Available values: * - * * ``auto`` default setting. keeps files and folders in the trash bin - * for 30 days and automatically deletes anytime after that - * if space is needed (note: files may not be deleted if space - * is not needed). - * * ``D, auto`` keeps files and folders in the trash bin for D+ days, - * delete anytime if space needed (note: files may not be deleted - * if space is not needed) - * * ``auto, D`` delete all files in the trash bin that are older than D days - * automatically, delete other files anytime if space needed - * * ``D1, D2`` keep files and folders the in trash bin for at least D1 days - * and delete when exceeds D2 days - * * ``disabled`` trash bin auto clean disabled, files and folders will be - * kept forever + * * ``auto`` + * default setting. keeps files and folders in the trash bin for 30 days + * and automatically deletes anytime after that if space is needed (note: + * files may not be deleted if space is not needed). + * * ``D, auto`` + * keeps files and folders in the trash bin for D+ days, delete anytime if + * space needed (note: files may not be deleted if space is not needed) + * * ``auto, D`` + * delete all files in the trash bin that are older than D days + * automatically, delete other files anytime if space needed + * * ``D1, D2`` + * keep files and folders the in trash bin for at least D1 days and + * delete when exceeds D2 days + * * ``disabled`` + * trash bin auto clean disabled, files and folders will be kept forever */ 'trashbin_retention_obligation' => 'auto', @@ -448,19 +450,24 @@ $CONFIG = array( * ownCloud 8.1 and before. * * Available values: - * ``auto`` default setting. Automatically expire versions according to - * expire rules. Please refer to Files_versions online documentation - * for more info. - * ``D, auto`` keep versions at least for D days, apply expire rules to all - * versions that are older than D days - * * ``auto, D`` delete all versions that are older than D days automatically, - * delete other versions according to expire rules - * * ``D1, D2`` keep versions for at least D1 days and delete when exceeds D2 days - * ``disabled`` versions auto clean disabled, versions will be kept forever + * + * * ``auto`` + * default setting. Automatically expire versions according to expire + * rules. Please refer to Files_versions online documentation for more + * info. + * * ``D, auto`` + * keep versions at least for D days, apply expire rules to all versions + * that are older than D days + * * ``auto, D`` + * delete all versions that are older than D days automatically, delete + * other versions according to expire rules + * * ``D1, D2`` + * keep versions for at least D1 days and delete when exceeds D2 days + * * ``disabled`` + * versions auto clean disabled, versions will be kept forever */ 'versions_retention_obligation' => 'auto', - /** * ownCloud Verifications * diff --git a/core/ajax/preview.php b/core/ajax/preview.php index baa0ed4ec61..c8bc05453ed 100644 --- a/core/ajax/preview.php +++ b/core/ajax/preview.php @@ -26,8 +26,8 @@ \OC::$server->getSession()->close(); $file = array_key_exists('file', $_GET) ? (string)$_GET['file'] : ''; -$maxX = array_key_exists('x', $_GET) ? (int)$_GET['x'] : '36'; -$maxY = array_key_exists('y', $_GET) ? (int)$_GET['y'] : '36'; +$maxX = array_key_exists('x', $_GET) ? (int)$_GET['x'] : '32'; +$maxY = array_key_exists('y', $_GET) ? (int)$_GET['y'] : '32'; $scalingUp = array_key_exists('scalingup', $_GET) ? (bool)$_GET['scalingup'] : true; $keepAspect = array_key_exists('a', $_GET) ? true : false; $always = array_key_exists('forceIcon', $_GET) ? (bool)$_GET['forceIcon'] : true; diff --git a/core/css/apps.css b/core/css/apps.css index 23e0c519d00..3122a2b48a1 100644 --- a/core/css/apps.css +++ b/core/css/apps.css @@ -308,6 +308,13 @@ -o-filter: drop-shadow(0 0 5px rgba(150, 150, 150, 0.75)); filter: drop-shadow(0 0 5px rgba(150, 150, 150, 0.75)); } +.ie8 .bubble { + border: 1px solid #eee; + margin-top: 18px; +} +.ie8 .bubble:after { + display: none; +} /* miraculous border arrow stuff */ .bubble:after, #app-navigation .app-navigation-entry-menu:after { diff --git a/core/css/fixes.css b/core/css/fixes.css index 7ef44ba6909..54852eb9beb 100644 --- a/core/css/fixes.css +++ b/core/css/fixes.css @@ -38,6 +38,10 @@ select { background-image: url('../img/actions/settings.png'); } +/* IE8 needs PNG image for header logo */ +.ie8 #header .logo { + background-image: url(../img/logo-icon-175px.png); +} /* IE8 needs background to be set to same color to make transparency look good. */ .lte9 #body-login form input[type="text"] { @@ -51,6 +55,15 @@ select { border-bottom: 1px solid lightgrey; background-color: white; /* don't change background on hover */ } +.ie8 #body-login input[type="submit"] { + padding: 10px 5px; + margin-top: 3px; +} +/* for whatever unexplained reason */ +.ie8 #password { + width: 271px !important; + min-width: auto !important; +} /* disable opacity of info text on gradient since we cannot set a good backround color to use the filter&background hack as with the input labels */ diff --git a/core/img/filetypes/application-pdf.png b/core/img/filetypes/application-pdf.png Binary files differindex 4029f8aead1..c215094eaa7 100644 --- a/core/img/filetypes/application-pdf.png +++ b/core/img/filetypes/application-pdf.png diff --git a/core/img/filetypes/application.png b/core/img/filetypes/application.png Binary files differindex 9be7361d1b6..d9db3b9114c 100644 --- a/core/img/filetypes/application.png +++ b/core/img/filetypes/application.png diff --git a/core/img/filetypes/audio.png b/core/img/filetypes/audio.png Binary files differindex 4eb8ab78e3f..3d52756341a 100644 --- a/core/img/filetypes/audio.png +++ b/core/img/filetypes/audio.png diff --git a/core/img/filetypes/file.png b/core/img/filetypes/file.png Binary files differindex 3bd7463cfc9..74add13f276 100644 --- a/core/img/filetypes/file.png +++ b/core/img/filetypes/file.png diff --git a/core/img/filetypes/folder-drag-accept.png b/core/img/filetypes/folder-drag-accept.png Binary files differindex 80ab53b72b9..1124a02982f 100644 --- a/core/img/filetypes/folder-drag-accept.png +++ b/core/img/filetypes/folder-drag-accept.png diff --git a/core/img/filetypes/folder-external.png b/core/img/filetypes/folder-external.png Binary files differindex 5262d72e627..dd8343d245a 100644 --- a/core/img/filetypes/folder-external.png +++ b/core/img/filetypes/folder-external.png diff --git a/core/img/filetypes/folder-public.png b/core/img/filetypes/folder-public.png Binary files differindex 17c3ee2a8d9..3da67f85f79 100644 --- a/core/img/filetypes/folder-public.png +++ b/core/img/filetypes/folder-public.png diff --git a/core/img/filetypes/folder-shared.png b/core/img/filetypes/folder-shared.png Binary files differindex be5e59cbf28..d24e1d7af4e 100644 --- a/core/img/filetypes/folder-shared.png +++ b/core/img/filetypes/folder-shared.png diff --git a/core/img/filetypes/folder-starred.png b/core/img/filetypes/folder-starred.png Binary files differindex b083a9d2d11..4b847bf69ea 100644 --- a/core/img/filetypes/folder-starred.png +++ b/core/img/filetypes/folder-starred.png diff --git a/core/img/filetypes/folder.png b/core/img/filetypes/folder.png Binary files differindex 1dbb1154100..e811e9cdfdc 100644 --- a/core/img/filetypes/folder.png +++ b/core/img/filetypes/folder.png diff --git a/core/img/filetypes/image.png b/core/img/filetypes/image.png Binary files differindex 0feaecf2830..8ff5e6c119f 100644 --- a/core/img/filetypes/image.png +++ b/core/img/filetypes/image.png diff --git a/core/img/filetypes/package-x-generic.png b/core/img/filetypes/package-x-generic.png Binary files differindex 287a1f18869..68117e0d070 100644 --- a/core/img/filetypes/package-x-generic.png +++ b/core/img/filetypes/package-x-generic.png diff --git a/core/img/filetypes/text-calendar.png b/core/img/filetypes/text-calendar.png Binary files differindex ff3ced62531..f21c3a9951d 100644 --- a/core/img/filetypes/text-calendar.png +++ b/core/img/filetypes/text-calendar.png diff --git a/core/img/filetypes/text-code.png b/core/img/filetypes/text-code.png Binary files differindex 5505102f60e..69744e499e6 100644 --- a/core/img/filetypes/text-code.png +++ b/core/img/filetypes/text-code.png diff --git a/core/img/filetypes/text-vcard.png b/core/img/filetypes/text-vcard.png Binary files differindex 77ac138fe1c..087eadaabd1 100644 --- a/core/img/filetypes/text-vcard.png +++ b/core/img/filetypes/text-vcard.png diff --git a/core/img/filetypes/text.png b/core/img/filetypes/text.png Binary files differindex 5fca7cb69d7..d6bec70cf43 100644 --- a/core/img/filetypes/text.png +++ b/core/img/filetypes/text.png diff --git a/core/img/filetypes/video.png b/core/img/filetypes/video.png Binary files differindex 308e81cca83..7cc1ecdc46a 100644 --- a/core/img/filetypes/video.png +++ b/core/img/filetypes/video.png diff --git a/core/img/filetypes/x-office-document.png b/core/img/filetypes/x-office-document.png Binary files differindex d9c5b890583..3bc2f08d1f9 100644 --- a/core/img/filetypes/x-office-document.png +++ b/core/img/filetypes/x-office-document.png diff --git a/core/img/filetypes/x-office-presentation.png b/core/img/filetypes/x-office-presentation.png Binary files differindex 5b3733b7121..644fb852009 100644 --- a/core/img/filetypes/x-office-presentation.png +++ b/core/img/filetypes/x-office-presentation.png diff --git a/core/img/filetypes/x-office-spreadsheet.png b/core/img/filetypes/x-office-spreadsheet.png Binary files differindex 5a20026ebdd..8f79c32fe01 100644 --- a/core/img/filetypes/x-office-spreadsheet.png +++ b/core/img/filetypes/x-office-spreadsheet.png diff --git a/core/img/logo-icon-175px.png b/core/img/logo-icon-175px.png Binary files differnew file mode 100644 index 00000000000..67e76498670 --- /dev/null +++ b/core/img/logo-icon-175px.png diff --git a/core/js/js.js b/core/js/js.js index 397fea8e3c5..e40141ac617 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1597,6 +1597,46 @@ OC.Util = { }, /** + * Fix image scaling for IE8, since background-size is not supported. + * + * This scales the image to the element's actual size, the URL is + * taken from the "background-image" CSS attribute. + * + * @param {Object} $el image element + */ + scaleFixForIE8: function($el) { + if (!this.isIE8()) { + return; + } + var self = this; + $($el).each(function() { + var url = $(this).css('background-image'); + var r = url.match(/url\(['"]?([^'")]*)['"]?\)/); + if (!r) { + return; + } + url = r[1]; + url = self.replaceSVGIcon(url); + // TODO: escape + url = url.replace(/'/g, '%27'); + $(this).css({ + 'filter': 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + url + '\', sizingMethod=\'scale\')', + 'background-image': '' + }); + }); + return $el; + }, + + /** + * Returns whether this is IE8 + * + * @return {bool} true if this is IE8, false otherwise + */ + isIE8: function() { + return $('html').hasClass('ie8'); + }, + + /** * Remove the time component from a given date * * @param {Date} date date diff --git a/core/templates/login.php b/core/templates/login.php index db77f63bbd0..6751d92f656 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -55,7 +55,7 @@ script('core', [ autocomplete="on" autocapitalize="off" autocorrect="off" required> <label for="password" class="infield"><?php p($l->t('Password')); ?></label> <img class="svg" id="password-icon" src="<?php print_unescaped(image_path('', 'actions/password.svg')); ?>" alt=""/> - <input type="submit" id="submit" class="login primary icon-confirm" title="<?php p($l->t('Log in')); ?>" value="" disabled="disabled"/> + <input type="submit" id="submit" class="login primary icon-confirm svg" title="<?php p($l->t('Log in')); ?>" value="" disabled="disabled"/> </p> <?php if (isset($_['invalidpassword']) && ($_['invalidpassword'])): ?> diff --git a/lib/private/appframework/http/request.php b/lib/private/appframework/http/request.php index b430673f9a9..af6015b0eef 100644 --- a/lib/private/appframework/http/request.php +++ b/lib/private/appframework/http/request.php @@ -603,7 +603,7 @@ class Request implements \ArrayAccess, \Countable, IRequest { if (strpos($pathInfo, $name) === 0) { $pathInfo = substr($pathInfo, strlen($name)); } - if($pathInfo === '/'){ + if($pathInfo === false || $pathInfo === '/'){ return ''; } else { return $pathInfo; diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php index fb60ee5aa53..bfdab16b645 100644 --- a/lib/private/files/cache/scanner.php +++ b/lib/private/files/cache/scanner.php @@ -186,9 +186,9 @@ class Scanner extends BasicEmitter { } if (!empty($newData)) { $data['fileid'] = $this->addToCache($file, $newData, $fileId); - $this->emit('\OC\Files\Cache\Scanner', 'postScanFile', array($file, $this->storageId)); - \OC_Hook::emit('\OC\Files\Cache\Scanner', 'post_scan_file', array('path' => $file, 'storage' => $this->storageId)); } + $this->emit('\OC\Files\Cache\Scanner', 'postScanFile', array($file, $this->storageId)); + \OC_Hook::emit('\OC\Files\Cache\Scanner', 'post_scan_file', array('path' => $file, 'storage' => $this->storageId)); } else { $this->removeFromCache($file); } diff --git a/lib/private/files/utils/scanner.php b/lib/private/files/utils/scanner.php index c70f4beb31d..558a1fba028 100644 --- a/lib/private/files/utils/scanner.php +++ b/lib/private/files/utils/scanner.php @@ -99,7 +99,12 @@ class Scanner extends PublicEmitter { $scanner->listen('\OC\Files\Cache\Scanner', 'scanFolder', function ($path) use ($mount, $emitter) { $emitter->emit('\OC\Files\Utils\Scanner', 'scanFolder', array($mount->getMountPoint() . $path)); }); - + $scanner->listen('\OC\Files\Cache\Scanner', 'postScanFile', function ($path) use ($mount, $emitter) { + $emitter->emit('\OC\Files\Utils\Scanner', 'postScanFile', array($mount->getMountPoint() . $path)); + }); + $scanner->listen('\OC\Files\Cache\Scanner', 'postScanFolder', function ($path) use ($mount, $emitter) { + $emitter->emit('\OC\Files\Utils\Scanner', 'postScanFolder', array($mount->getMountPoint() . $path)); + }); // propagate etag and mtimes when files are changed or removed $propagator = $this->propagator; $propagatorListener = function ($path) use ($mount, $propagator) { diff --git a/lib/private/helper.php b/lib/private/helper.php index b8e4b451835..dcd263daa24 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -193,11 +193,11 @@ class OC_Helper { * Returns the path to the preview of the file. */ public static function previewIcon($path) { - return self::linkToRoute( 'core_ajax_preview', array('x' => 36, 'y' => 36, 'file' => $path )); + return self::linkToRoute( 'core_ajax_preview', array('x' => 32, 'y' => 32, 'file' => $path )); } public static function publicPreviewIcon( $path, $token ) { - return self::linkToRoute( 'core_ajax_public_preview', array('x' => 36, 'y' => 36, 'file' => $path, 't' => $token)); + return self::linkToRoute( 'core_ajax_public_preview', array('x' => 32, 'y' => 32, 'file' => $path, 't' => $token)); } /** diff --git a/lib/private/l10n.php b/lib/private/l10n.php index 168011cfcec..ad02ba88526 100644 --- a/lib/private/l10n.php +++ b/lib/private/l10n.php @@ -503,8 +503,9 @@ class OC_L10N implements \OCP\IL10N { * @return array an array of available languages */ public static function findAvailableLanguages($app=null) { - if(!empty(self::$availableLanguages)) { - return self::$availableLanguages; + // also works with null as key + if(isset(self::$availableLanguages[$app]) && !empty(self::$availableLanguages[$app])) { + return self::$availableLanguages[$app]; } $available=array('en');//english is always available $dir = self::findI18nDir($app); @@ -518,7 +519,7 @@ class OC_L10N implements \OCP\IL10N { } } - self::$availableLanguages = $available; + self::$availableLanguages[$app] = $available; return $available; } diff --git a/lib/private/preview/image.php b/lib/private/preview/image.php index f9c27e690f6..fd90b15eb0c 100644 --- a/lib/private/preview/image.php +++ b/lib/private/preview/image.php @@ -46,12 +46,16 @@ abstract class Image extends Provider { $image = new \OC_Image(); - if ($fileInfo['encrypted'] === true) { + $useTempFile = $fileInfo->isEncrypted() || !$fileInfo->getStorage()->isLocal(); + if ($useTempFile) { $fileName = $fileview->toTmpFile($path); } else { $fileName = $fileview->getLocalFile($path); } $image->loadFromFile($fileName); + if ($useTempFile) { + unlink($fileName); + } $image->fixOrientation(); if ($image->valid()) { $image->scaleDownToFit($maxX, $maxY); diff --git a/lib/private/preview/txt.php b/lib/private/preview/txt.php index 0bba570a8c9..2fdc86d9546 100644 --- a/lib/private/preview/txt.php +++ b/lib/private/preview/txt.php @@ -53,7 +53,7 @@ class TXT extends Provider { $lines = preg_split("/\r\n|\n|\r/", $content); - $fontSize = ($maxX) ? (int) ((5 / 36) * $maxX) : 5; //5px + $fontSize = ($maxX) ? (int) ((5 / 32) * $maxX) : 5; //5px $lineSize = ceil($fontSize * 1.25); $image = imagecreate($maxX, $maxY); diff --git a/settings/admin.php b/settings/admin.php index c8bf1d32749..31c9b8c1376 100644 --- a/settings/admin.php +++ b/settings/admin.php @@ -37,7 +37,7 @@ OC_Util::checkAdminUser(); OC_App::setActiveNavigationEntry("admin"); $template = new OC_Template('settings', 'admin', 'user'); -$l = OC_L10N::get('settings'); +$l = \OC::$server->getL10N('settings'); $showLog = (\OC::$server->getConfig()->getSystemValue('log_type', 'owncloud') === 'owncloud'); $numEntriesToLoad = 3; diff --git a/settings/personal.php b/settings/personal.php index 0cfdc9ed371..26e730d8089 100644 --- a/settings/personal.php +++ b/settings/personal.php @@ -148,7 +148,7 @@ sort($groups2); $tmpl->assign('groups', $groups2); // add hardcoded forms from the template -$l = OC_L10N::get('settings'); +$l = \OC::$server->getL10N('settings'); $formsAndMore = []; $formsAndMore[]= ['anchor' => 'clientsbox', 'section-name' => $l->t('Sync clients')]; $formsAndMore[]= ['anchor' => 'passwordform', 'section-name' => $l->t('Personal info')]; diff --git a/tests/lib/appframework/http/RequestTest.php b/tests/lib/appframework/http/RequestTest.php index deb28909869..e9a0755d1f8 100644 --- a/tests/lib/appframework/http/RequestTest.php +++ b/tests/lib/appframework/http/RequestTest.php @@ -60,18 +60,18 @@ class RequestTest extends \Test\TestCase { ); // Countable - $this->assertEquals(2, count($request)); + $this->assertSame(2, count($request)); // Array access - $this->assertEquals('Joey', $request['nickname']); + $this->assertSame('Joey', $request['nickname']); // "Magic" accessors - $this->assertEquals('Joey', $request->{'nickname'}); + $this->assertSame('Joey', $request->{'nickname'}); $this->assertTrue(isset($request['nickname'])); $this->assertTrue(isset($request->{'nickname'})); - $this->assertEquals(false, isset($request->{'flickname'})); + $this->assertFalse(isset($request->{'flickname'})); // Only testing 'get', but same approach for post, files etc. - $this->assertEquals('Joey', $request->get['nickname']); + $this->assertSame('Joey', $request->get['nickname']); // Always returns null if variable not set. - $this->assertEquals(null, $request->{'flickname'}); + $this->assertSame(null, $request->{'flickname'}); } @@ -92,9 +92,9 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals(3, count($request)); - $this->assertEquals('Janey', $request->{'nickname'}); - $this->assertEquals('Johnny Weissmüller', $request->{'name'}); + $this->assertSame(3, count($request)); + $this->assertSame('Janey', $request->{'nickname'}); + $this->assertSame('Johnny Weissmüller', $request->{'name'}); } @@ -172,10 +172,10 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('GET', $request->method); + $this->assertSame('GET', $request->method); $result = $request->get; - $this->assertEquals('John Q. Public', $result['name']); - $this->assertEquals('Joey', $result['nickname']); + $this->assertSame('John Q. Public', $result['name']); + $this->assertSame('Joey', $result['nickname']); } public function testJsonPost() { @@ -194,12 +194,12 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('POST', $request->method); + $this->assertSame('POST', $request->method); $result = $request->post; - $this->assertEquals('John Q. Public', $result['name']); - $this->assertEquals('Joey', $result['nickname']); - $this->assertEquals('Joey', $request->params['nickname']); - $this->assertEquals('Joey', $request['nickname']); + $this->assertSame('John Q. Public', $result['name']); + $this->assertSame('Joey', $result['nickname']); + $this->assertSame('Joey', $request->params['nickname']); + $this->assertSame('Joey', $request['nickname']); } public function testPatch() { @@ -219,11 +219,11 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('PATCH', $request->method); + $this->assertSame('PATCH', $request->method); $result = $request->patch; - $this->assertEquals('John Q. Public', $result['name']); - $this->assertEquals('Joey', $result['nickname']); + $this->assertSame('John Q. Public', $result['name']); + $this->assertSame('Joey', $result['nickname']); } public function testJsonPatchAndPut() { @@ -244,11 +244,11 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('PUT', $request->method); + $this->assertSame('PUT', $request->method); $result = $request->put; - $this->assertEquals('John Q. Public', $result['name']); - $this->assertEquals('Joey', $result['nickname']); + $this->assertSame('John Q. Public', $result['name']); + $this->assertSame('Joey', $result['nickname']); // PATCH content $data = '{"name": "John Q. Public", "nickname": null}'; @@ -265,11 +265,11 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('PATCH', $request->method); + $this->assertSame('PATCH', $request->method); $result = $request->patch; - $this->assertEquals('John Q. Public', $result['name']); - $this->assertEquals(null, $result['nickname']); + $this->assertSame('John Q. Public', $result['name']); + $this->assertSame(null, $result['nickname']); } public function testPutStream() { @@ -290,10 +290,10 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('PUT', $request->method); + $this->assertSame('PUT', $request->method); $resource = $request->put; $contents = stream_get_contents($resource); - $this->assertEquals($data, $contents); + $this->assertSame($data, $contents); try { $resource = $request->put; @@ -322,7 +322,7 @@ class RequestTest extends \Test\TestCase { $newParams = array('id' => '3', 'test' => 'test2'); $request->setUrlParameters($newParams); - $this->assertEquals('test2', $request->getParam('test')); + $this->assertSame('test2', $request->getParam('test')); $this->assertEquals('3', $request->getParam('id')); $this->assertEquals('3', $request->getParams()['id']); } @@ -660,7 +660,7 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals($matches, $request->isUserAgent($userAgent)); + $this->assertSame($matches, $request->isUserAgent($userAgent)); } /** @@ -749,7 +749,7 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('from.server.name:8080', $request->getInsecureServerHost()); + $this->assertSame('from.server.name:8080', $request->getInsecureServerHost()); } public function testInsecureServerHostHttpHostHeader() { @@ -766,7 +766,7 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('from.host.header:8080', $request->getInsecureServerHost()); + $this->assertSame('from.host.header:8080', $request->getInsecureServerHost()); } public function testInsecureServerHostHttpFromForwardedHeaderSingle() { @@ -784,7 +784,7 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('from.forwarded.host:8080', $request->getInsecureServerHost()); + $this->assertSame('from.forwarded.host:8080', $request->getInsecureServerHost()); } public function testInsecureServerHostHttpFromForwardedHeaderStacked() { @@ -802,7 +802,7 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('from.forwarded.host2:8080', $request->getInsecureServerHost()); + $this->assertSame('from.forwarded.host2:8080', $request->getInsecureServerHost()); } public function testGetServerHostWithOverwriteHost() { @@ -830,7 +830,7 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('my.overwritten.host', $request->getServerHost()); + $this->assertSame('my.overwritten.host', $request->getServerHost()); } public function testGetServerHostWithTrustedDomain() { @@ -852,7 +852,7 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('my.trusted.host', $request->getServerHost()); + $this->assertSame('my.trusted.host', $request->getServerHost()); } public function testGetServerHostWithUntrustedDomain() { @@ -879,7 +879,7 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('my.trusted.host', $request->getServerHost()); + $this->assertSame('my.trusted.host', $request->getServerHost()); } public function testGetServerHostWithNoTrustedDomain() { @@ -906,7 +906,7 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('', $request->getServerHost()); + $this->assertSame('', $request->getServerHost()); } public function testGetOverwriteHostDefaultNull() { @@ -967,7 +967,7 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals('apps/files/', $request->getPathInfo()); + $this->assertSame('apps/files/', $request->getPathInfo()); } /** @@ -1032,7 +1032,7 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals($expected, $request->getPathInfo()); + $this->assertSame($expected, $request->getPathInfo()); } /** @@ -1055,7 +1055,7 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals($expected, $request->getRawPathInfo()); + $this->assertSame($expected, $request->getRawPathInfo()); } /** @@ -1078,7 +1078,7 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals($expected, $request->getRawPathInfo()); + $this->assertSame($expected, $request->getRawPathInfo()); } /** @@ -1101,7 +1101,7 @@ class RequestTest extends \Test\TestCase { $this->stream ); - $this->assertEquals($expected, $request->getPathInfo()); + $this->assertSame($expected, $request->getPathInfo()); } /** @@ -1109,6 +1109,7 @@ class RequestTest extends \Test\TestCase { */ public function genericPathInfoProvider() { return [ + ['/core/index.php?XDEBUG_SESSION_START=14600', '/core/index.php', ''], ['/index.php/apps/files/', 'index.php', '/apps/files/'], ['/index.php/apps/files/../&/&?someQueryParameter=QueryParam', 'index.php', '/apps/files/../&/&'], ['/remote.php/漢字編碼方法 / 汉字编码方法', 'remote.php', '/漢字編碼方法 / 汉字编码方法'], diff --git a/tests/lib/preview.php b/tests/lib/preview.php index a135ed40d0a..9374cf2393f 100644 --- a/tests/lib/preview.php +++ b/tests/lib/preview.php @@ -534,10 +534,10 @@ class Preview extends TestCase { // Small thumbnails are always cropped $this->keepAspect = false; // Smaller previews should be based on the previous, larger preview, with the correct aspect ratio - $this->createThumbnailFromBiggerCachedPreview($fileId, 36, 36); + $this->createThumbnailFromBiggerCachedPreview($fileId, 32, 32); // 2nd cache query should indicate that we have a cached copy of the exact dimension - $this->getCachedSmallThumbnail($fileId, 36, 36); + $this->getCachedSmallThumbnail($fileId, 32, 32); // We create a preview in order to be able to delete the cache $preview = $this->createPreview(rand(), rand()); |