diff options
author | Tom Needham <tom@owncloud.com> | 2013-03-09 00:04:33 +0000 |
---|---|---|
committer | Tom Needham <tom@owncloud.com> | 2013-03-09 00:04:33 +0000 |
commit | e58dbd46fc4648ca6f33b83e7ce7745f07217477 (patch) | |
tree | e71722b44bf58d64e30addc4e6685855d62c5db5 /lib | |
parent | 370f202251df2425ec49c78265859a804a88433f (diff) | |
parent | 546fb72b25fb8ebdc70aa75ccc7a095d7d83b174 (diff) | |
download | nextcloud-server-e58dbd46fc4648ca6f33b83e7ce7745f07217477.tar.gz nextcloud-server-e58dbd46fc4648ca6f33b83e7ce7745f07217477.zip |
Merge in master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 4 | ||||
-rw-r--r-- | lib/connector/sabre/directory.php | 4 | ||||
-rw-r--r-- | lib/files.php | 29 | ||||
-rw-r--r-- | lib/files/cache/upgrade.php | 9 | ||||
-rw-r--r-- | lib/files/mount.php | 26 | ||||
-rw-r--r-- | lib/files/view.php | 12 | ||||
-rw-r--r-- | lib/group.php | 8 | ||||
-rw-r--r-- | lib/group/backend.php | 12 | ||||
-rw-r--r-- | lib/group/database.php | 4 | ||||
-rw-r--r-- | lib/l10n/da.php | 1 | ||||
-rw-r--r-- | lib/l10n/de_DE.php | 2 | ||||
-rw-r--r-- | lib/l10n/nl.php | 1 | ||||
-rw-r--r-- | lib/l10n/pt_PT.php | 1 | ||||
-rw-r--r-- | lib/l10n/uk.php | 1 | ||||
-rw-r--r-- | lib/mail.php | 8 | ||||
-rw-r--r-- | lib/public/share.php | 2 | ||||
-rw-r--r-- | lib/public/util.php | 4 | ||||
-rw-r--r-- | lib/template.php | 6 | ||||
-rwxr-xr-x | lib/util.php | 34 | ||||
-rw-r--r-- | lib/vcategories.php | 9 |
20 files changed, 123 insertions, 54 deletions
diff --git a/lib/base.php b/lib/base.php index bffae36261e..59b861ffce1 100644 --- a/lib/base.php +++ b/lib/base.php @@ -277,6 +277,10 @@ class OC { OC_Log::write('core', 'starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, OC_Log::DEBUG); + $minimizerCSS = new OC_Minimizer_CSS(); + $minimizerCSS->clearCache(); + $minimizerJS = new OC_Minimizer_JS(); + $minimizerJS->clearCache(); OC_Util::addscript('update'); $tmpl = new OC_Template('', 'update', 'guest'); $tmpl->assign('version', OC_Util::getVersionString()); diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php index 953692f80a9..6ccb54b79ab 100644 --- a/lib/connector/sabre/directory.php +++ b/lib/connector/sabre/directory.php @@ -107,7 +107,9 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa public function createDirectory($name) { $newPath = $this->path . '/' . $name; - \OC\Files\Filesystem::mkdir($newPath); + if(!\OC\Files\Filesystem::mkdir($newPath)) { + throw new Sabre_DAV_Exception_Forbidden('Could not create directory '.$newPath); + } } diff --git a/lib/files.php b/lib/files.php index b594b78c4b7..71bb21851b6 100644 --- a/lib/files.php +++ b/lib/files.php @@ -49,8 +49,9 @@ class OC_Files { isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED'])) { $xsendfile = true; } - if(strpos($files, ';')) { - $files=explode(';', $files); + + if (count($files) == 1) { + $files = $files[0]; } if (is_array($files)) { @@ -77,7 +78,13 @@ class OC_Files { } } $zip->close(); - $name = basename($dir) . '.zip'; + $basename = basename($dir); + if ($basename) { + $name = $basename . '.zip'; + } else { + $name = 'owncloud.zip'; + } + set_time_limit($executionTime); } elseif (\OC\Files\Filesystem::is_dir($dir . '/' . $files)) { self::validateZipDownload($dir, $files); @@ -212,12 +219,18 @@ class OC_Files { $zipLimit = OC_Config::getValue('maxZipInputSize', OC_Helper::computerFileSize('800 MB')); if ($zipLimit > 0) { $totalsize = 0; - if (is_array($files)) { - foreach ($files as $file) { - $totalsize += \OC\Files\Filesystem::filesize($dir . '/' . $file); + if(!is_array($files)) { + $files = array($files); + } + foreach ($files as $file) { + $path = $dir . '/' . $file; + if(\OC\Files\Filesystem::is_dir($path)) { + foreach (\OC\Files\Filesystem::getDirectoryContent($path) as $i) { + $totalsize += $i['size']; + } + } else { + $totalsize += \OC\Files\Filesystem::filesize($path); } - } else { - $totalsize += \OC\Files\Filesystem::filesize($dir . '/' . $files); } if ($totalsize > $zipLimit) { $l = OC_L10N::get('lib'); diff --git a/lib/files/cache/upgrade.php b/lib/files/cache/upgrade.php index 1fe4c584686..811d82d7437 100644 --- a/lib/files/cache/upgrade.php +++ b/lib/files/cache/upgrade.php @@ -64,7 +64,7 @@ class Upgrade { * @param array $data the data for the new cache */ function insert($data) { - if (!$this->inCache($data['storage'], $data['path_hash'])) { + if (!$this->inCache($data['storage'], $data['path_hash'], $data['id'])) { $insertQuery = \OC_DB::prepare('INSERT INTO `*PREFIX*filecache` ( `fileid`, `storage`, `path`, `path_hash`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted` ) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); @@ -78,11 +78,12 @@ class Upgrade { /** * @param string $storage * @param string $pathHash + * @param string $id * @return bool */ - function inCache($storage, $pathHash) { - $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE `storage` = ? AND `path_hash` = ?'); - $result = $query->execute(array($storage, $pathHash)); + function inCache($storage, $pathHash, $id) { + $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE (`storage` = ? AND `path_hash` = ?) OR `fileid` = ?'); + $result = $query->execute(array($storage, $pathHash, $id)); return (bool)$result->fetchRow(); } diff --git a/lib/files/mount.php b/lib/files/mount.php index 6e99d8eabb4..1c9382d78e7 100644 --- a/lib/files/mount.php +++ b/lib/files/mount.php @@ -176,10 +176,12 @@ class Mount { } /** + * Find mounts by storage id + * * @param string $id - * @return \OC\Files\Storage\Storage[] + * @return Mount[] */ - public static function findById($id) { + public static function findByStorageId($id) { if (strlen($id) > 64) { $id = md5($id); } @@ -191,4 +193,24 @@ class Mount { } return $result; } + + /** + * Find mounts by numeric storage id + * + * @param string $id + * @return Mount + */ + public static function findByNumericId($id) { + $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*storages` WHERE `numeric_id` = ?'); + $result = $query->execute(array($id))->fetchOne(); + if ($result) { + $id = $result; + foreach (self::$mounts as $mount) { + if ($mount->getStorageId() === $id) { + return $mount; + } + } + } + return false; + } } diff --git a/lib/files/view.php b/lib/files/view.php index 3e2cb080e1d..19f33ad64a2 100644 --- a/lib/files/view.php +++ b/lib/files/view.php @@ -245,7 +245,14 @@ class View { if (!is_null($mtime) and !is_numeric($mtime)) { $mtime = strtotime($mtime); } - return $this->basicOperation('touch', $path, array('write'), $mtime); + + $hooks = array('touch'); + + if (!$this->file_exists($path)) { + $hooks[] = 'write'; + } + + return $this->basicOperation('touch', $path, $hooks, $mtime); } public function file_get_contents($path) { @@ -596,6 +603,7 @@ class View { if ($path == null) { return false; } + $run = $this->runHooks($hooks, $path); list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix); if ($run and $storage) { @@ -960,7 +968,7 @@ class View { */ public function getPath($id) { list($storage, $internalPath) = Cache\Cache::getById($id); - $mounts = Mount::findById($storage); + $mounts = Mount::findByStorageId($storage); foreach ($mounts as $mount) { /** * @var \OC\Files\Mount $mount diff --git a/lib/group.php b/lib/group.php index 88f0a2a032c..d1a830730b7 100644 --- a/lib/group.php +++ b/lib/group.php @@ -294,7 +294,13 @@ class OC_Group { public static function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) { $displayNames=array(); foreach(self::$_usedBackends as $backend) { - $displayNames = array_merge($backend->displayNamesInGroup($gid, $search, $limit, $offset), $displayNames); + if($backend->implementsActions(OC_GROUP_BACKEND_GET_DISPLAYNAME)) { + $displayNames = array_merge($backend->displayNamesInGroup($gid, $search, $limit, $offset), $displayNames); + } else { + $users = $backend->usersInGroup($gid, $search, $limit, $offset); + $names = array_combine($users, $users); + $displayNames = array_merge($names, $displayNames); + } } return $displayNames; } diff --git a/lib/group/backend.php b/lib/group/backend.php index e7b7b21d957..2e17b5d0b7f 100644 --- a/lib/group/backend.php +++ b/lib/group/backend.php @@ -33,6 +33,7 @@ define('OC_GROUP_BACKEND_CREATE_GROUP', 0x00000001); define('OC_GROUP_BACKEND_DELETE_GROUP', 0x00000010); define('OC_GROUP_BACKEND_ADD_TO_GROUP', 0x00000100); define('OC_GROUP_BACKEND_REMOVE_FROM_GOUP', 0x00001000); +define('OC_GROUP_BACKEND_GET_DISPLAYNAME', 0x00010000); /** * Abstract base class for user management @@ -43,6 +44,7 @@ abstract class OC_Group_Backend implements OC_Group_Interface { OC_GROUP_BACKEND_DELETE_GROUP => 'deleteGroup', OC_GROUP_BACKEND_ADD_TO_GROUP => 'addToGroup', OC_GROUP_BACKEND_REMOVE_FROM_GOUP => 'removeFromGroup', + OC_GROUP_BACKEND_GET_DISPLAYNAME => 'displayNamesInGroup', ); /** @@ -142,14 +144,14 @@ abstract class OC_Group_Backend implements OC_Group_Interface { * @param int $offset * @return array with display names (value) and user ids (key) */ - public function DisplayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) { - $displayNames = ''; + public function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) { + $displayNames = array(); $users = $this->usersInGroup($gid, $search, $limit, $offset); - foreach ( $users as $user ) { - $DisplayNames[$user] = $user; + foreach ($users as $user) { + $displayNames[$user] = $user; } - return $DisplayNames; + return $displayNames; } } diff --git a/lib/group/database.php b/lib/group/database.php index 40e9b0d4147..d0974685ff6 100644 --- a/lib/group/database.php +++ b/lib/group/database.php @@ -219,8 +219,8 @@ class OC_Group_Database extends OC_Group_Backend { * @param int $offset * @return array with display names (value) and user ids (key) */ - public function DisplayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) { - $displayNames = ''; + public function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) { + $displayNames = array(); $stmt = OC_DB::prepare('SELECT `*PREFIX*users`.`uid`, `*PREFIX*users`.`displayname`' .' FROM `*PREFIX*users`' diff --git a/lib/l10n/da.php b/lib/l10n/da.php index e61fba30ff3..38ccbbe8e21 100644 --- a/lib/l10n/da.php +++ b/lib/l10n/da.php @@ -34,6 +34,7 @@ "MySQL user '%s'@'%%' already exists" => "MySQL brugeren '%s'@'%%' eksisterer allerede.", "Drop this user from MySQL." => "Slet denne bruger fra MySQL", "Offending command was: \"%s\", name: %s, password: %s" => "Fejlende kommando var: \"%s\", navn: %s, password: %s", +"MS SQL username and/or password not valid: %s" => "MS SQL brugernavn og/eller adgangskode ikke er gyldigt: %s", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Din webserver er endnu ikke sat op til at tillade fil synkronisering fordi WebDAV grænsefladen virker ødelagt.", "Please double check the <a href='%s'>installation guides</a>." => "Dobbelttjek venligst <a href='%s'>installations vejledningerne</a>.", "seconds ago" => "sekunder siden", diff --git a/lib/l10n/de_DE.php b/lib/l10n/de_DE.php index bbff4948096..9978cdf8b31 100644 --- a/lib/l10n/de_DE.php +++ b/lib/l10n/de_DE.php @@ -34,7 +34,7 @@ "MySQL user '%s'@'%%' already exists" => "MySQL Benutzer '%s'@'%%' existiert bereits", "Drop this user from MySQL." => "Lösche diesen Benutzer aus MySQL.", "Offending command was: \"%s\", name: %s, password: %s" => "Fehlerhafter Befehl war: \"%s\", Name: %s, Passwort: %s", -"MS SQL username and/or password not valid: %s" => "MS SQL Benutzername und/oder Passwort nicht valide: %s", +"MS SQL username and/or password not valid: %s" => "MS SQL Benutzername und/oder Passwort ungültig: %s", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ihr Web-Server ist noch nicht für Datei-Synchronisation bereit, weil die WebDAV-Schnittstelle vermutlich defekt ist.", "Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfen Sie die <a href='%s'>Instalationsanleitungen</a>.", "seconds ago" => "Gerade eben", diff --git a/lib/l10n/nl.php b/lib/l10n/nl.php index 4a357889fdc..e26a663e9cc 100644 --- a/lib/l10n/nl.php +++ b/lib/l10n/nl.php @@ -34,6 +34,7 @@ "MySQL user '%s'@'%%' already exists" => "MySQL gebruiker '%s'@'%%' bestaat al", "Drop this user from MySQL." => "Verwijder deze gebruiker uit MySQL.", "Offending command was: \"%s\", name: %s, password: %s" => "Onjuiste commando was: \"%s\", naam: %s, wachtwoord: %s", +"MS SQL username and/or password not valid: %s" => "MS SQL gebruikersnaam en/of wachtwoord niet geldig: %s", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Uw webserver is nog niet goed ingesteld voor bestandssynchronisatie omdat de WebDAV interface verbroken lijkt.", "Please double check the <a href='%s'>installation guides</a>." => "Conntroleer de <a href='%s'>installatie handleiding</a> goed.", "seconds ago" => "seconden geleden", diff --git a/lib/l10n/pt_PT.php b/lib/l10n/pt_PT.php index 9bdcfcc9ced..2c813f5b07c 100644 --- a/lib/l10n/pt_PT.php +++ b/lib/l10n/pt_PT.php @@ -34,6 +34,7 @@ "MySQL user '%s'@'%%' already exists" => "O utilizador '%s'@'%%' do MySQL já existe", "Drop this user from MySQL." => "Eliminar este utilizador do MySQL", "Offending command was: \"%s\", name: %s, password: %s" => "O comando gerador de erro foi: \"%s\", nome: %s, password: %s", +"MS SQL username and/or password not valid: %s" => "Nome de utilizador/password do MySQL é inválido: %s", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "O seu servidor web não está configurado correctamente para autorizar sincronização de ficheiros, pois o interface WebDAV parece estar com problemas.", "Please double check the <a href='%s'>installation guides</a>." => "Por favor verifique <a href='%s'>installation guides</a>.", "seconds ago" => "há alguns segundos", diff --git a/lib/l10n/uk.php b/lib/l10n/uk.php index 415c0a80c27..68f7151d15e 100644 --- a/lib/l10n/uk.php +++ b/lib/l10n/uk.php @@ -34,6 +34,7 @@ "MySQL user '%s'@'%%' already exists" => "Користувач MySQL '%s'@'%%' вже існує", "Drop this user from MySQL." => "Видалити цього користувача з MySQL.", "Offending command was: \"%s\", name: %s, password: %s" => "Команда, що викликала проблему: \"%s\", ім'я: %s, пароль: %s", +"MS SQL username and/or password not valid: %s" => "MS SQL ім'я користувача та/або пароль не дійсні: %s", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ваш Web-сервер ще не налаштований належним чином для того, щоб дозволити синхронізацію файлів, через те що інтерфейс WebDAV, здається, зламаний.", "Please double check the <a href='%s'>installation guides</a>." => "Будь ласка, перевірте <a href='%s'>інструкції по встановленню</a>.", "seconds ago" => "секунди тому", diff --git a/lib/mail.php b/lib/mail.php index 22194045a76..61634632efc 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -119,4 +119,12 @@ class OC_Mail { return($txt); } + + /** + * @param string $emailAddress a given email address to be validated + * @return bool + */ + public static function ValidateAddress($emailAddress) { + return PHPMailer::ValidateAddress($emailAddress); + } } diff --git a/lib/public/share.php b/lib/public/share.php index 8146a23f360..59f41a9bfd6 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -786,7 +786,7 @@ class Share { } else { $select = '`*PREFIX*share`.`id`, `item_type`, `item_source`, `item_target`, `*PREFIX*share`.`parent`, `share_type`, `share_with`, `uid_owner`, - `file_source`, `path`, `file_target`, `permissions`, `stime`, `expiration`, `token`'; + `file_source`, `path`, `file_target`, `permissions`, `stime`, `expiration`, `token`, `storage`'; } } else { $select = '*'; diff --git a/lib/public/util.php b/lib/public/util.php index 5d814114a24..db07cbcfff3 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -219,11 +219,11 @@ class Util { $host_name = self::getServerHostName(); $defaultEmailAddress = $user_part.'@'.$host_name; - if (\PHPMailer::ValidateAddress($defaultEmailAddress)) { + if (\OC_Mail::ValidateAddress($defaultEmailAddress)) { return $defaultEmailAddress; } - // incase we cannot build a valid email address from the hostname let's fallback to 'localhost.localdomain' + // in case we cannot build a valid email address from the hostname let's fallback to 'localhost.localdomain' return $user_part.'@localhost.localdomain'; } diff --git a/lib/template.php b/lib/template.php index b2d1f0c0292..434c1e9e990 100644 --- a/lib/template.php +++ b/lib/template.php @@ -200,7 +200,6 @@ class OC_Template{ .'img-src *; ' .'font-src \'self\' data:'); header('Content-Security-Policy:'.$policy); // Standard - header('X-WebKit-CSP:'.$policy); // Older webkit browsers $this->findTemplate($name); } @@ -520,12 +519,13 @@ class OC_Template{ /** * @brief Print a fatal error page and terminates the script * @param string $error The error message to show - * @param string $hint An option hint message + * @param string $hint An optional hint message + * Warning: All data passed to $hint needs to get sanitized using OC_Util::sanitizeHTML */ public static function printErrorPage( $error_msg, $hint = '' ) { $content = new OC_Template( '', 'error', 'error' ); $errors = array(array('error' => $error_msg, 'hint' => $hint)); - $content->assign( 'errors', $errors, false ); + $content->assign( 'errors', $errors ); $content->printPage(); die(); } diff --git a/lib/util.php b/lib/util.php index de1f870fd7e..47c02074a8c 100755 --- a/lib/util.php +++ b/lib/util.php @@ -75,7 +75,7 @@ class OC_Util { public static function getVersion() { // hint: We only can count up. Reset minor/patchlevel when // updating major/minor version number. - return array(4, 95, 10); + return array(4, 97, 10); } /** @@ -83,7 +83,7 @@ class OC_Util { * @return string */ public static function getVersionString() { - return '5.0 RC 1'; + return '5.0 RC 3'; } /** @@ -172,7 +172,7 @@ class OC_Util { if(!(is_callable('sqlite_open') or class_exists('SQLite3')) and !is_callable('mysql_connect') and !is_callable('pg_connect')) { - $errors[]=array('error'=>'No database drivers (sqlite, mysql, or postgresql) installed.<br/>', + $errors[]=array('error'=>'No database drivers (sqlite, mysql, or postgresql) installed.', 'hint'=>'');//TODO: sane hint $web_server_restart= true; } @@ -218,74 +218,74 @@ class OC_Util { } // check if all required php modules are present if(!class_exists('ZipArchive')) { - $errors[]=array('error'=>'PHP module zip not installed.<br/>', + $errors[]=array('error'=>'PHP module zip not installed.', 'hint'=>'Please ask your server administrator to install the module.'); $web_server_restart= false; } if(!class_exists('DOMDocument')) { - $errors[] = array('error' => 'PHP module dom not installed.<br/>', + $errors[] = array('error' => 'PHP module dom not installed.', 'hint' => 'Please ask your server administrator to install the module.'); $web_server_restart = false; } if(!function_exists('xml_parser_create')) { - $errors[] = array('error' => 'PHP module libxml not installed.<br/>', + $errors[] = array('error' => 'PHP module libxml not installed.', 'hint' => 'Please ask your server administrator to install the module.'); $web_server_restart = false; } if(!function_exists('mb_detect_encoding')) { - $errors[]=array('error'=>'PHP module mb multibyte not installed.<br/>', + $errors[]=array('error'=>'PHP module mb multibyte not installed.', 'hint'=>'Please ask your server administrator to install the module.'); $web_server_restart= false; } if(!function_exists('ctype_digit')) { - $errors[]=array('error'=>'PHP module ctype is not installed.<br/>', + $errors[]=array('error'=>'PHP module ctype is not installed.', 'hint'=>'Please ask your server administrator to install the module.'); $web_server_restart= false; } if(!function_exists('json_encode')) { - $errors[]=array('error'=>'PHP module JSON is not installed.<br/>', + $errors[]=array('error'=>'PHP module JSON is not installed.', 'hint'=>'Please ask your server administrator to install the module.'); $web_server_restart= false; } if(!function_exists('imagepng')) { - $errors[]=array('error'=>'PHP module GD is not installed.<br/>', + $errors[]=array('error'=>'PHP module GD is not installed.', 'hint'=>'Please ask your server administrator to install the module.'); $web_server_restart= false; } if(!function_exists('gzencode')) { - $errors[]=array('error'=>'PHP module zlib is not installed.<br/>', + $errors[]=array('error'=>'PHP module zlib is not installed.', 'hint'=>'Please ask your server administrator to install the module.'); $web_server_restart= false; } if(!function_exists('iconv')) { - $errors[]=array('error'=>'PHP module iconv is not installed.<br/>', + $errors[]=array('error'=>'PHP module iconv is not installed.', 'hint'=>'Please ask your server administrator to install the module.'); $web_server_restart= false; } if(!function_exists('simplexml_load_string')) { - $errors[]=array('error'=>'PHP module SimpleXML is not installed.<br/>', + $errors[]=array('error'=>'PHP module SimpleXML is not installed.', 'hint'=>'Please ask your server administrator to install the module.'); $web_server_restart= false; } if(floatval(phpversion())<5.3) { - $errors[]=array('error'=>'PHP 5.3 is required.<br/>', + $errors[]=array('error'=>'PHP 5.3 is required.', 'hint'=>'Please ask your server administrator to update PHP to version 5.3 or higher.' .' PHP 5.2 is no longer supported by ownCloud and the PHP community.'); $web_server_restart= false; } if(!defined('PDO::ATTR_DRIVER_NAME')) { - $errors[]=array('error'=>'PHP PDO module is not installed.<br/>', + $errors[]=array('error'=>'PHP PDO module is not installed.', 'hint'=>'Please ask your server administrator to install the module.'); $web_server_restart= false; } if(ini_get('safe_mode')) { - $errors[]=array('error'=>'PHP Safe Mode is enabled. ownCloud requires that it is disabled to work properly.<br/>', + $errors[]=array('error'=>'PHP Safe Mode is enabled. ownCloud requires that it is disabled to work properly.', 'hint'=>'PHP Safe Mode is a deprecated and mostly useless setting that should be disabled. Please ask your server administrator to disable it in php.ini or in your webserver config.'); $web_server_restart= false; } if($web_server_restart) { - $errors[]=array('error'=>'PHP modules have been installed, but they are still listed as missing?<br/>', + $errors[]=array('error'=>'PHP modules have been installed, but they are still listed as missing?', 'hint'=>'Please ask your server administrator to restart the web server.'); } diff --git a/lib/vcategories.php b/lib/vcategories.php index f94a0a55d3b..2f990c5d2d2 100644 --- a/lib/vcategories.php +++ b/lib/vcategories.php @@ -348,12 +348,11 @@ class OC_VCategories { self::$relations[] = array('objid' => $id, 'category' => $name); } } - if(count($newones) > 0) { - $this->categories = array_merge($this->categories, $newones); - if($sync === true) { - $this->save(); - } + $this->categories = array_merge($this->categories, $newones); + if($sync === true) { + $this->save(); } + return true; } |