aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/filesystem.php2
-rw-r--r--lib/private/mimetypes.list.php4
-rw-r--r--lib/private/setup.php18
-rw-r--r--lib/private/share/share.php2
-rw-r--r--lib/private/updater.php11
5 files changed, 27 insertions, 10 deletions
diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php
index 39c586c7ad3..4d991e5d11d 100644
--- a/lib/private/files/filesystem.php
+++ b/lib/private/files/filesystem.php
@@ -383,7 +383,7 @@ class Filesystem {
if (is_null($userObject)) {
\OCP\Util::writeLog('files', ' Backends provided no user object for ' . $user, \OCP\Util::ERROR);
- throw new \OC\User\NoUserException();
+ throw new \OC\User\NoUserException('Backends provided no user object for ' . $user);
}
$homeStorage = \OC_Config::getValue('objectstore');
diff --git a/lib/private/mimetypes.list.php b/lib/private/mimetypes.list.php
index e2b82b256e5..5f222cbd835 100644
--- a/lib/private/mimetypes.list.php
+++ b/lib/private/mimetypes.list.php
@@ -117,6 +117,8 @@ return array(
'mpg' => array('video/mpeg', null),
'mpo' => array('image/jpeg', null),
'msi' => array('application/x-msi', null),
+ 'mts' => ['video/MP2T', null],
+ 'mt2s' => ['video/MP2T', null],
'nef' => array('image/x-dcraw', null),
'numbers' => array('application/x-iwork-numbers-sffnumbers', null),
'odf' => array('application/vnd.oasis.opendocument.formula', null),
@@ -176,7 +178,7 @@ return array(
'wav' => array('audio/wav', null),
'webm' => array('video/webm', null),
'woff' => array('application/font-woff', null),
- 'wmv' => array('video/x-ms-asf', null),
+ 'wmv' => array('video/x-ms-wmv', null),
'xcf' => array('application/x-gimp', null),
'xla' => array('application/vnd.ms-excel', null),
'xlam' => array('application/vnd.ms-excel.addin.macroEnabled.12', null),
diff --git a/lib/private/setup.php b/lib/private/setup.php
index 7ca30e172ec..1ffe074dc34 100644
--- a/lib/private/setup.php
+++ b/lib/private/setup.php
@@ -402,10 +402,20 @@ class Setup {
throw new \OC\HintException('.htaccess file has the wrong version. Please upload the correct version. Maybe you forgot to replace it after updating?');
}
- $content = "\n";
- $content.= "ErrorDocument 403 ".\OC::$WEBROOT."/core/templates/403.php\n";//custom 403 error page
- $content.= "ErrorDocument 404 ".\OC::$WEBROOT."/core/templates/404.php";//custom 404 error page
- @file_put_contents($setupHelper->pathToHtaccess(), $content, FILE_APPEND); //suppress errors in case we don't have permissions for it
+ $htaccessContent = file_get_contents($setupHelper->pathToHtaccess());
+ $content = '';
+ if (strpos($htaccessContent, 'ErrorDocument 403') === false) {
+ //custom 403 error page
+ $content.= "\nErrorDocument 403 ".\OC::$WEBROOT."/core/templates/403.php";
+ }
+ if (strpos($htaccessContent, 'ErrorDocument 404') === false) {
+ //custom 404 error page
+ $content.= "\nErrorDocument 404 ".\OC::$WEBROOT."/core/templates/404.php";
+ }
+ if ($content !== '') {
+ //suppress errors in case we don't have permissions for it
+ @file_put_contents($setupHelper->pathToHtaccess(), $content . "\n", FILE_APPEND);
+ }
}
public static function protectDataDirectory() {
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 027c518f9f1..954071fdd6c 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -1220,7 +1220,7 @@ class Share extends Constants {
$qb->update('`*PREFIX*share`')
->set('`share_with`', ':pass')
->where('`id` = :shareId')
- ->setParameter(':pass', is_null($password) ? 'NULL' : \OC::$server->getHasher()->hash($password))
+ ->setParameter(':pass', is_null($password) ? null : \OC::$server->getHasher()->hash($password))
->setParameter(':shareId', $shareId);
$qb->execute();
diff --git a/lib/private/updater.php b/lib/private/updater.php
index bd9e8a65363..00c6569a52f 100644
--- a/lib/private/updater.php
+++ b/lib/private/updater.php
@@ -189,20 +189,25 @@ class Updater extends BasicEmitter {
$this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core'));
}
+ $success = true;
try {
$this->doUpgrade($currentVersion, $installedVersion);
} catch (\Exception $exception) {
- $this->emit('\OC\Updater', 'failure', array($exception->getMessage()));
+ \OCP\Util::logException('update', $exception);
+ $this->emit('\OC\Updater', 'failure', array(get_class($exception) . ': ' .$exception->getMessage()));
+ $success = false;
}
- $this->emit('\OC\Updater', 'updateEnd');
+ $this->emit('\OC\Updater', 'updateEnd', array($success));
- if(!$wasMaintenanceModeEnabled) {
+ if(!$wasMaintenanceModeEnabled && $success) {
$this->config->setSystemValue('maintenance', false);
$this->emit('\OC\Updater', 'maintenanceDisabled');
} else {
$this->emit('\OC\Updater', 'maintenanceActive');
}
+
+ return $success;
}
/**