diff options
Diffstat (limited to 'lib')
51 files changed, 206 insertions, 94 deletions
diff --git a/lib/MDB2/Driver/sqlite3.php b/lib/MDB2/Driver/sqlite3.php index 8f057cfb6e8..aef0eab9bf1 100644 --- a/lib/MDB2/Driver/sqlite3.php +++ b/lib/MDB2/Driver/sqlite3.php @@ -892,10 +892,10 @@ class MDB2_Driver_sqlite3 extends MDB2_Driver_Common $connection = $this->getConnection(); if (PEAR::isError($connection)) { return $connection; - } + } $statement =$this->connection->prepare($query); if (!$statement) { - return $this->db->raiseError(MDB2_ERROR_NOT_FOUND, null, null, + return $this->raiseError(MDB2_ERROR_NOT_FOUND, null, null, 'unable to prepare statement: '.$query); } diff --git a/lib/base.php b/lib/base.php index dde994a7e57..3b421486daf 100644 --- a/lib/base.php +++ b/lib/base.php @@ -97,8 +97,15 @@ class OC { $path = 'public/' . strtolower(str_replace('\\', '/', substr($className, 3)) . '.php'); } elseif (strpos($className, 'OCA\\') === 0) { foreach (self::$APPSROOTS as $appDir) { - $path = $appDir['path'] . '/' . strtolower(str_replace('\\', '/', substr($className, 3)) . '.php'); - $fullPath = stream_resolve_include_path($path); + $path = strtolower(str_replace('\\', '/', substr($className, 4)) . '.php'); + $fullPath = stream_resolve_include_path($appDir['path'] . '/' . $path); + if (file_exists($fullPath)) { + require_once $fullPath; + return false; + } + // If not found in the root of the app directory, insert '/lib' after app id and try again. + $libpath = substr($path, 0, strpos($path, '/')) . '/lib' . substr($path, strpos($path, '/')); + $fullPath = stream_resolve_include_path($appDir['path'] . '/' . $libpath); if (file_exists($fullPath)) { require_once $fullPath; return false; @@ -278,7 +285,7 @@ class OC { OC_Config::setValue('maintenance', true); OC_Log::write('core', 'starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, - OC_Log::DEBUG); + OC_Log::WARN); $minimizerCSS = new OC_Minimizer_CSS(); $minimizerCSS->clearCache(); $minimizerJS = new OC_Minimizer_JS(); @@ -324,7 +331,8 @@ class OC { ini_set('session.cookie_httponly', '1;'); // set the cookie path to the ownCloud directory - ini_set('session.cookie_path', OC::$WEBROOT); + $cookie_path = OC::$WEBROOT ?: '/'; + ini_set('session.cookie_path', $cookie_path); // set the session name to the instance id - which is unique session_name(OC_Util::getInstanceId()); @@ -357,7 +365,7 @@ class OC { // session timeout if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 60*60*24)) { if (isset($_COOKIE[session_name()])) { - setcookie(session_name(), '', time() - 42000, OC::$WEBROOT); + setcookie(session_name(), '', time() - 42000, $cookie_path); } session_unset(); session_destroy(); @@ -466,11 +474,11 @@ class OC { stream_wrapper_register('close', 'OC\Files\Stream\Close'); stream_wrapper_register('oc', 'OC\Files\Stream\OC'); + self::initTemplateEngine(); self::checkConfig(); self::checkInstalled(); self::checkSSL(); self::initSession(); - self::initTemplateEngine(); $errors = OC_Util::checkServer(); if (count($errors) > 0) { @@ -630,8 +638,13 @@ class OC { // Handle redirect URL for logged in users if (isset($_REQUEST['redirect_url']) && OC_User::isLoggedIn()) { $location = OC_Helper::makeURLAbsolute(urldecode($_REQUEST['redirect_url'])); - header('Location: ' . $location); - return; + + // Deny the redirect if the URL contains a @ + // This prevents unvalidated redirects like ?redirect_url=:user@domain.com + if (strpos($location, '@') === FALSE) { + header('Location: ' . $location); + return; + } } // Handle WebDAV if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') { diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php index c0e9d215fb5..09732e67ac6 100644 --- a/lib/files/filesystem.php +++ b/lib/files/filesystem.php @@ -287,9 +287,9 @@ class Filesystem { } /** - * fill in the correct values for $user, and $password placeholders + * fill in the correct values for $user * - * @param string $input + * @param string $user * @param string $input * @return string */ @@ -311,6 +311,7 @@ class Filesystem { */ static public function tearDown() { self::clearMounts(); + self::$defaultInstance = null; } /** diff --git a/lib/files/mount.php b/lib/files/mount.php index 59c98e9dcc8..0030d0ee7a6 100644 --- a/lib/files/mount.php +++ b/lib/files/mount.php @@ -136,6 +136,7 @@ class Mount { * @return Mount */ public static function find($path) { + \OC_Util::setupFS(); $path = self::formatPath($path); if (isset(self::$mounts[$path])) { return self::$mounts[$path]; @@ -163,6 +164,7 @@ class Mount { * @return Mount[] */ public static function findIn($path) { + \OC_Util::setupFS(); $path = self::formatPath($path); $result = array(); $pathLength = strlen($path); @@ -186,6 +188,7 @@ class Mount { * @return Mount[] */ public static function findByStorageId($id) { + \OC_Util::setupFS(); if (strlen($id) > 64) { $id = md5($id); } diff --git a/lib/files/view.php b/lib/files/view.php index f607bb59aac..0da104c107e 100644 --- a/lib/files/view.php +++ b/lib/files/view.php @@ -245,13 +245,13 @@ class View { if (!is_null($mtime) and !is_numeric($mtime)) { $mtime = strtotime($mtime); } - + $hooks = array('touch'); - + if (!$this->file_exists($path)) { $hooks[] = 'write'; } - + return $this->basicOperation('touch', $path, $hooks, $mtime); } @@ -263,11 +263,12 @@ class View { if (is_resource($data)) { //not having to deal with streams in file_put_contents makes life easier $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); if (\OC_FileProxy::runPreProxies('file_put_contents', $absolutePath, $data) - && Filesystem::isValidPath($path)) { + && Filesystem::isValidPath($path) + ) { $path = $this->getRelativePath($absolutePath); $exists = $this->file_exists($path); $run = true; - if ($this->fakeRoot == Filesystem::getRoot() && ! Cache\Scanner::isIgnoredFile($path) ) { + if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isIgnoredFile($path)) { if (!$exists) { \OC_Hook::emit( Filesystem::CLASSNAME, @@ -295,7 +296,7 @@ class View { list ($count, $result) = \OC_Helper::streamCopy($data, $target); fclose($target); fclose($data); - if ($this->fakeRoot == Filesystem::getRoot() && ! Cache\Scanner::isIgnoredFile($path) ) { + if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isIgnoredFile($path)) { if (!$exists) { \OC_Hook::emit( Filesystem::CLASSNAME, @@ -335,8 +336,11 @@ class View { $postFix2 = (substr($path2, -1, 1) === '/') ? '/' : ''; $absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1)); $absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2)); - if (\OC_FileProxy::runPreProxies('rename', $absolutePath1, $absolutePath2) - and Filesystem::isValidPath($path2)) { + if ( + \OC_FileProxy::runPreProxies('rename', $absolutePath1, $absolutePath2) + and Filesystem::isValidPath($path2) + and Filesystem::isValidPath($path1) + ) { $path1 = $this->getRelativePath($absolutePath1); $path2 = $this->getRelativePath($absolutePath2); @@ -396,7 +400,11 @@ class View { $postFix2 = (substr($path2, -1, 1) === '/') ? '/' : ''; $absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1)); $absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2)); - if (\OC_FileProxy::runPreProxies('copy', $absolutePath1, $absolutePath2) and Filesystem::isValidPath($path2)) { + if ( + \OC_FileProxy::runPreProxies('copy', $absolutePath1, $absolutePath2) + and Filesystem::isValidPath($path2) + and Filesystem::isValidPath($path1) + ) { $path1 = $this->getRelativePath($absolutePath1); $path2 = $this->getRelativePath($absolutePath2); @@ -627,7 +635,7 @@ class View { private function runHooks($hooks, $path, $post = false) { $prefix = ($post) ? 'post_' : ''; $run = true; - if (Filesystem::$loaded and $this->fakeRoot == Filesystem::getRoot() && ! Cache\Scanner::isIgnoredFile($path) ) { + if (Filesystem::$loaded and $this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isIgnoredFile($path)) { foreach ($hooks as $hook) { if ($hook != 'read') { \OC_Hook::emit( @@ -931,11 +939,11 @@ class View { } /** - * Get the owner for a file or folder - * - * @param string $path - * @return string - */ + * Get the owner for a file or folder + * + * @param string $path + * @return string + */ public function getOwner($path) { return $this->basicOperation('getOwner', $path); } diff --git a/lib/helper.php b/lib/helper.php index 73484ad913f..2ba70294f4b 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -159,7 +159,7 @@ class OC_Helper { */ public static function imagePath( $app, $image ) { // Read the selected theme from the config file - $theme=OC_Config::getValue( "theme" ); + $theme = OC_Util::getTheme(); // Check if the app is in the app folder if( file_exists( OC::$SERVERROOT."/themes/$theme/apps/$app/img/$image" )) { diff --git a/lib/json.php b/lib/json.php index f929e958957..6ba0b13806b 100644 --- a/lib/json.php +++ b/lib/json.php @@ -14,7 +14,7 @@ class OC_JSON{ public static function setContentTypeHeader($type='application/json') { if (!self::$send_content_type_header) { // We send json data - header( 'Content-Type: '.$type ); + header( 'Content-Type: '.$type . '; charset=utf-8'); self::$send_content_type_header = true; } } diff --git a/lib/l10n/ar.php b/lib/l10n/ar.php index 8b7324f3ff4..ae8233f80da 100644 --- a/lib/l10n/ar.php +++ b/lib/l10n/ar.php @@ -18,7 +18,6 @@ "Images" => "صور", "Set an admin username." => "اعداد اسم مستخدم للمدير", "Set an admin password." => "اعداد كلمة مرور للمدير", -"Specify a data folder." => "تحديد مجلد ", "%s enter the database username." => "%s ادخل اسم المستخدم الخاص بقاعدة البيانات.", "%s enter the database name." => "%s ادخل اسم فاعدة البيانات", "%s you may not use dots in the database name" => "%s لا يسمح لك باستخدام نقطه (.) في اسم قاعدة البيانات", diff --git a/lib/l10n/bg_BG.php b/lib/l10n/bg_BG.php index d32e2aadfc5..2d4775a89f3 100644 --- a/lib/l10n/bg_BG.php +++ b/lib/l10n/bg_BG.php @@ -18,7 +18,6 @@ "Images" => "Снимки", "Set an admin username." => "Въведете потребителско име за администратор.", "Set an admin password." => "Въведете парола за администратор.", -"Specify a data folder." => "Укажете папка за данни", "%s enter the database username." => "%s въведете потребителско име за базата с данни.", "%s enter the database name." => "%s въведете име на базата с данни.", "%s you may not use dots in the database name" => "%s, не можете да ползвате точки в името на базата от данни", diff --git a/lib/l10n/ca.php b/lib/l10n/ca.php index 108bb5c09be..16dc74f40c4 100644 --- a/lib/l10n/ca.php +++ b/lib/l10n/ca.php @@ -18,7 +18,6 @@ "Images" => "Imatges", "Set an admin username." => "Establiu un nom d'usuari per l'administrador.", "Set an admin password." => "Establiu una contrasenya per l'administrador.", -"Specify a data folder." => "Especifiqueu una carpeta de dades.", "%s enter the database username." => "%s escriviu el nom d'usuari de la base de dades.", "%s enter the database name." => "%s escriviu el nom de la base de dades.", "%s you may not use dots in the database name" => "%s no podeu usar punts en el nom de la base de dades", diff --git a/lib/l10n/cs_CZ.php b/lib/l10n/cs_CZ.php index d9ec3d82cf7..79161c74e8e 100644 --- a/lib/l10n/cs_CZ.php +++ b/lib/l10n/cs_CZ.php @@ -18,7 +18,6 @@ "Images" => "Obrázky", "Set an admin username." => "Zadejte uživatelské jméno správce.", "Set an admin password." => "Zadejte heslo správce.", -"Specify a data folder." => "Určete složku dat.", "%s enter the database username." => "Zadejte uživatelské jméno %s databáze.", "%s enter the database name." => "Zadejte název databáze pro %s databáze.", "%s you may not use dots in the database name" => "V názvu databáze %s nesmíte používat tečky.", diff --git a/lib/l10n/cy_GB.php b/lib/l10n/cy_GB.php new file mode 100644 index 00000000000..6cf88c15ccc --- /dev/null +++ b/lib/l10n/cy_GB.php @@ -0,0 +1,55 @@ +<?php $TRANSLATIONS = array( +"Help" => "Cymorth", +"Personal" => "Personol", +"Settings" => "Gosodiadau", +"Users" => "Defnyddwyr", +"Apps" => "Pecynnau", +"Admin" => "Gweinyddu", +"ZIP download is turned off." => "Mae llwytho ZIP wedi ei ddiffodd.", +"Files need to be downloaded one by one." => "Mae angen llwytho ffeiliau i lawr fesul un.", +"Back to Files" => "Nôl i Ffeiliau", +"Selected files too large to generate zip file." => "Mae'r ffeiliau ddewiswyd yn rhy fawr i gynhyrchu ffeil zip.", +"couldn't be determined" => "methwyd pennu", +"Application is not enabled" => "Nid yw'r pecyn wedi'i alluogi", +"Authentication error" => "Gwall dilysu", +"Token expired. Please reload page." => "Tocyn wedi dod i ben. Ail-lwythwch y dudalen.", +"Files" => "Ffeiliau", +"Text" => "Testun", +"Images" => "Delweddau", +"Set an admin username." => "Creu enw defnyddiwr i'r gweinyddwr.", +"Set an admin password." => "Gosod cyfrinair y gweinyddwr.", +"%s enter the database username." => "%s rhowch enw defnyddiwr y gronfa ddata.", +"%s enter the database name." => "%s rhowch enw'r gronfa ddata.", +"%s you may not use dots in the database name" => "%s does dim hawl defnyddio dot yn enw'r gronfa ddata", +"%s set the database host." => "%s gosod gwesteiwr y gronfa ddata.", +"PostgreSQL username and/or password not valid" => "Enw a/neu gyfrinair PostgreSQL annilys", +"You need to enter either an existing account or the administrator." => "Rhaid i chi naill ai gyflwyno cyfrif presennol neu'r gweinyddwr.", +"Oracle username and/or password not valid" => "Enw a/neu gyfrinair Oracle annilys", +"MySQL username and/or password not valid" => "Enw a/neu gyfrinair MySQL annilys", +"DB Error: \"%s\"" => "Gwall DB: \"%s\"", +"Offending command was: \"%s\"" => "Y gorchymyn wnaeth beri tramgwydd oedd: \"%s\"", +"MySQL user '%s'@'localhost' exists already." => "Defnyddiwr MySQL '%s'@'localhost' yn bodoli eisoes.", +"Drop this user from MySQL" => "Gollwng y defnyddiwr hwn o MySQL", +"MySQL user '%s'@'%%' already exists" => "Defnyddiwr MySQL '%s'@'%%' eisoes yn bodoli", +"Drop this user from MySQL." => "Gollwng y defnyddiwr hwn o MySQL.", +"Offending command was: \"%s\", name: %s, password: %s" => "Y gorchymyn wnaeth beri tramgwydd oedd: \"%s\", enw: %s, cyfrinair: %s", +"MS SQL username and/or password not valid: %s" => "Enw a/neu gyfrinair MS SQL annilys: %s", +"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Nid yw eich gweinydd wedi'i gyflunio eto i ganiatáu cydweddu ffeiliau oherwydd bod y rhyngwyneb WebDAV wedi torri.", +"Please double check the <a href='%s'>installation guides</a>." => "Gwiriwch y <a href='%s'>canllawiau gosod</a> eto.", +"seconds ago" => "eiliad yn ôl", +"1 minute ago" => "1 munud yn ôl", +"%d minutes ago" => "%d munud yn ôl", +"1 hour ago" => "1 awr yn ôl", +"%d hours ago" => "%d awr yn ôl", +"today" => "heddiw", +"yesterday" => "ddoe", +"%d days ago" => "%d diwrnod yn ôl", +"last month" => "mis diwethaf", +"%d months ago" => "%d mis yn ôl", +"last year" => "y llynedd", +"years ago" => "blwyddyn yn ôl", +"%s is available. Get <a href=\"%s\">more information</a>" => "%s ar gael. <a href=\"%s\">Mwy o wybodaeth</a>", +"up to date" => "cyfredol", +"updates check is disabled" => "gwirio am ddiweddariadau wedi'i analluogi", +"Could not find category \"%s\"" => "Methu canfod categori \"%s\"" +); diff --git a/lib/l10n/da.php b/lib/l10n/da.php index 38ccbbe8e21..4850d0be19a 100644 --- a/lib/l10n/da.php +++ b/lib/l10n/da.php @@ -18,7 +18,6 @@ "Images" => "Billeder", "Set an admin username." => "Angiv et admin brugernavn.", "Set an admin password." => "Angiv et admin kodeord.", -"Specify a data folder." => "Specificer en data mappe.", "%s enter the database username." => "%s indtast database brugernavnet.", "%s enter the database name." => "%s indtast database navnet.", "%s you may not use dots in the database name" => "%s du må ikke bruge punktummer i databasenavnet.", diff --git a/lib/l10n/de.php b/lib/l10n/de.php index 3c2069d4637..7a680574bfa 100644 --- a/lib/l10n/de.php +++ b/lib/l10n/de.php @@ -18,7 +18,6 @@ "Images" => "Bilder", "Set an admin username." => "Setze Administrator Benutzername.", "Set an admin password." => "Setze Administrator Passwort", -"Specify a data folder." => "Datei-Verzeichnis angeben.", "%s enter the database username." => "%s gib den Datenbank-Benutzernamen an.", "%s enter the database name." => "%s gib den Datenbank-Namen an.", "%s you may not use dots in the database name" => "%s Der Datenbank-Name darf keine Punkte enthalten", @@ -36,7 +35,7 @@ "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 Password ungültig: %s", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Dein 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üfe die <a href='%s'>Instalationsanleitungen</a>.", +"Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfe die <a href='%s'>Installationsanleitungen</a>.", "seconds ago" => "Gerade eben", "1 minute ago" => "Vor einer Minute", "%d minutes ago" => "Vor %d Minuten", diff --git a/lib/l10n/de_DE.php b/lib/l10n/de_DE.php index 9978cdf8b31..eb002c97be2 100644 --- a/lib/l10n/de_DE.php +++ b/lib/l10n/de_DE.php @@ -18,7 +18,6 @@ "Images" => "Bilder", "Set an admin username." => "Setze Administrator Benutzername.", "Set an admin password." => "Setze Administrator Passwort", -"Specify a data folder." => "Datei-Verzeichnis angeben", "%s enter the database username." => "%s geben Sie den Datenbank-Benutzernamen an.", "%s enter the database name." => "%s geben Sie den Datenbank-Namen an.", "%s you may not use dots in the database name" => "%s Der Datenbank-Name darf keine Punkte enthalten", @@ -36,7 +35,7 @@ "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 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>.", +"Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfen Sie die <a href='%s'>Installationsanleitungen</a>.", "seconds ago" => "Gerade eben", "1 minute ago" => "Vor einer Minute", "%d minutes ago" => "Vor %d Minuten", diff --git a/lib/l10n/el.php b/lib/l10n/el.php index a3599095258..63f5d8eb836 100644 --- a/lib/l10n/el.php +++ b/lib/l10n/el.php @@ -18,7 +18,6 @@ "Images" => "Εικόνες", "Set an admin username." => "Εισάγετε όνομα χρήστη διαχειριστή.", "Set an admin password." => "Εισάγετε συνθηματικό διαχειριστή.", -"Specify a data folder." => "Καθορίστε τον φάκελο δεδομένων.", "%s enter the database username." => "%s εισάγετε το όνομα χρήστη της βάσης δεδομένων.", "%s enter the database name." => "%s εισάγετε το όνομα της βάσης δεδομένων.", "%s you may not use dots in the database name" => "%s μάλλον δεν χρησιμοποιείτε τελείες στο όνομα της βάσης δεδομένων", diff --git a/lib/l10n/es.php b/lib/l10n/es.php index 37b15a375c4..5b868e2d451 100644 --- a/lib/l10n/es.php +++ b/lib/l10n/es.php @@ -18,7 +18,6 @@ "Images" => "Imágenes", "Set an admin username." => "Configurar un nombre de usuario del administrador", "Set an admin password." => "Configurar la contraseña del administrador.", -"Specify a data folder." => "Especificar la carpeta de datos.", "%s enter the database username." => "%s ingresar el usuario de la base de datos.", "%s enter the database name." => "%s ingresar el nombre de la base de datos", "%s you may not use dots in the database name" => "%s no se puede utilizar puntos en el nombre de la base de datos", diff --git a/lib/l10n/es_AR.php b/lib/l10n/es_AR.php index ff3d47285fc..fc25cd6b1d8 100644 --- a/lib/l10n/es_AR.php +++ b/lib/l10n/es_AR.php @@ -18,7 +18,6 @@ "Images" => "Imágenes", "Set an admin username." => "Configurar un nombre de administrador", "Set an admin password." => "Configurar una palabra clave de administrador", -"Specify a data folder." => "Especificar un directorio de datos", "%s enter the database username." => "%s Entre el Usuario de la Base de Datos", "%s enter the database name." => "%s Entre el Nombre de la Base de Datos", "%s you may not use dots in the database name" => "%s no puede usar puntos en el nombre de la Base de Datos", diff --git a/lib/l10n/et_EE.php b/lib/l10n/et_EE.php index 6948686b7f6..25909e1555e 100644 --- a/lib/l10n/et_EE.php +++ b/lib/l10n/et_EE.php @@ -18,7 +18,6 @@ "Images" => "Pildid", "Set an admin username." => "Määra admin kasutajanimi.", "Set an admin password." => "Määra admini parool.", -"Specify a data folder." => "Määra andmete kaust.", "%s enter the database username." => "%s sisesta andmebaasi kasutajatunnus", "%s enter the database name." => "%s sisesta andmebaasi nimi.", "%s you may not use dots in the database name" => "%s punktide kasutamine andmebaasi nimes pole lubatud", diff --git a/lib/l10n/eu.php b/lib/l10n/eu.php index 36eb397e425..fde65572d8a 100644 --- a/lib/l10n/eu.php +++ b/lib/l10n/eu.php @@ -18,7 +18,6 @@ "Images" => "Irudiak", "Set an admin username." => "Ezarri administraziorako erabiltzaile izena.", "Set an admin password." => "Ezarri administraziorako pasahitza.", -"Specify a data folder." => "Zehaztu data karpeta.", "%s enter the database username." => "%s sartu datu basearen erabiltzaile izena.", "%s enter the database name." => "%s sartu datu basearen izena.", "%s you may not use dots in the database name" => "%s ezin duzu punturik erabili datu basearen izenean.", diff --git a/lib/l10n/fa.php b/lib/l10n/fa.php index f05195f5b8b..b0d423421df 100644 --- a/lib/l10n/fa.php +++ b/lib/l10n/fa.php @@ -14,7 +14,6 @@ "Files" => "پروندهها", "Text" => "متن", "Images" => "تصاویر", -"Specify a data folder." => "پوشه ای برای داده ها مشخص کنید.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "احتمالاً وب سرور شما طوری تنظیم نشده است که اجازه ی همگام سازی فایلها را بدهد زیرا به نظر میرسد رابط WebDAV از کار افتاده است.", "Please double check the <a href='%s'>installation guides</a>." => "لطفاً دوباره <a href='%s'>راهنمای نصب</a>را بررسی کنید.", "seconds ago" => "ثانیهها پیش", diff --git a/lib/l10n/fi_FI.php b/lib/l10n/fi_FI.php index 2c85931e1d0..201cae19536 100644 --- a/lib/l10n/fi_FI.php +++ b/lib/l10n/fi_FI.php @@ -18,7 +18,6 @@ "Images" => "Kuvat", "Set an admin username." => "Aseta ylläpitäjän käyttäjätunnus.", "Set an admin password." => "Aseta ylläpitäjän salasana.", -"Specify a data folder." => "Määritä datakansio.", "%s enter the database username." => "%s anna tietokannan käyttäjätunnus.", "%s enter the database name." => "%s anna tietokannan nimi.", "%s you may not use dots in the database name" => "%s et voi käyttää pisteitä tietokannan nimessä", diff --git a/lib/l10n/fr.php b/lib/l10n/fr.php index 9448502df6a..ffc29450461 100644 --- a/lib/l10n/fr.php +++ b/lib/l10n/fr.php @@ -18,7 +18,6 @@ "Images" => "Images", "Set an admin username." => "Spécifiez un nom d'utilisateur pour l'administrateur.", "Set an admin password." => "Spécifiez un mot de passe administrateur.", -"Specify a data folder." => "Spécifiez un répertoire pour les données.", "%s enter the database username." => "%s entrez le nom d'utilisateur de la base de données.", "%s enter the database name." => "%s entrez le nom de la base de données.", "%s you may not use dots in the database name" => "%s vous nez pouvez pas utiliser de points dans le nom de la base de données", diff --git a/lib/l10n/gl.php b/lib/l10n/gl.php index a11724fef43..d38bf8329d1 100644 --- a/lib/l10n/gl.php +++ b/lib/l10n/gl.php @@ -18,7 +18,6 @@ "Images" => "Imaxes", "Set an admin username." => "Estabeleza un nome de usuario administrador", "Set an admin password." => "Estabeleza un contrasinal de administrador", -"Specify a data folder." => "Especifique un cartafol de datos.", "%s enter the database username." => "%s introduza o nome de usuario da base de datos", "%s enter the database name." => "%s introduza o nome da base de datos", "%s you may not use dots in the database name" => "%s non se poden empregar puntos na base de datos", diff --git a/lib/l10n/hu_HU.php b/lib/l10n/hu_HU.php index 537066c6fea..4621c5074b8 100644 --- a/lib/l10n/hu_HU.php +++ b/lib/l10n/hu_HU.php @@ -18,7 +18,6 @@ "Images" => "Képek", "Set an admin username." => "Állítson be egy felhasználói nevet az adminisztrációhoz.", "Set an admin password." => "Állítson be egy jelszót az adminisztrációhoz.", -"Specify a data folder." => "Adja meg az adatokat tartalmazó könyvtár nevét.", "%s enter the database username." => "%s adja meg az adatbázist elérő felhasználó login nevét.", "%s enter the database name." => "%s adja meg az adatbázis nevét.", "%s you may not use dots in the database name" => "%s az adatbázis neve nem tartalmazhat pontot", diff --git a/lib/l10n/id.php b/lib/l10n/id.php index b34fa0ac59d..7eb26c5eb86 100644 --- a/lib/l10n/id.php +++ b/lib/l10n/id.php @@ -18,7 +18,6 @@ "Images" => "Gambar", "Set an admin username." => "Setel nama pengguna admin.", "Set an admin password." => "Setel sandi admin.", -"Specify a data folder." => "Tentukan folder data.", "%s enter the database username." => "%s masukkan nama pengguna basis data.", "%s enter the database name." => "%s masukkan nama basis data.", "%s you may not use dots in the database name" => "%sAnda tidak boleh menggunakan karakter titik pada nama basis data", diff --git a/lib/l10n/it.php b/lib/l10n/it.php index 297f1efde05..847f767fa76 100644 --- a/lib/l10n/it.php +++ b/lib/l10n/it.php @@ -18,7 +18,6 @@ "Images" => "Immagini", "Set an admin username." => "Imposta un nome utente di amministrazione.", "Set an admin password." => "Imposta una password di amministrazione.", -"Specify a data folder." => "Specifica una cartella dei dati.", "%s enter the database username." => "%s digita il nome utente del database.", "%s enter the database name." => "%s digita il nome del database.", "%s you may not use dots in the database name" => "%s non dovresti utilizzare punti nel nome del database", diff --git a/lib/l10n/ja_JP.php b/lib/l10n/ja_JP.php index 5906c7f7a1e..18d0833792d 100644 --- a/lib/l10n/ja_JP.php +++ b/lib/l10n/ja_JP.php @@ -18,7 +18,6 @@ "Images" => "画像", "Set an admin username." => "管理者のユーザ名を設定。", "Set an admin password." => "管理者のパスワードを設定。", -"Specify a data folder." => "データフォルダを指定。", "%s enter the database username." => "%s のデータベースのユーザ名を入力してください。", "%s enter the database name." => "%s のデータベース名を入力してください。", "%s you may not use dots in the database name" => "%s ではデータベース名にドットを利用できないかもしれません。", diff --git a/lib/l10n/ka_GE.php b/lib/l10n/ka_GE.php index 26b356b6341..ffdf549f480 100644 --- a/lib/l10n/ka_GE.php +++ b/lib/l10n/ka_GE.php @@ -18,7 +18,6 @@ "Images" => "სურათები", "Set an admin username." => "დააყენეთ ადმინისტრატორის სახელი.", "Set an admin password." => "დააყენეთ ადმინისტრატორის პაროლი.", -"Specify a data folder." => "მიუთითეთ data ფოლდერი.", "%s enter the database username." => "%s შეიყვანეთ ბაზის იუზერნეიმი.", "%s enter the database name." => "%s შეიყვანეთ ბაზის სახელი.", "%s you may not use dots in the database name" => "%s არ მიუთითოთ წერტილი ბაზის სახელში", diff --git a/lib/l10n/lv.php b/lib/l10n/lv.php index c73d306ca0a..38793914073 100644 --- a/lib/l10n/lv.php +++ b/lib/l10n/lv.php @@ -18,7 +18,6 @@ "Images" => "Attēli", "Set an admin username." => "Iestatiet administratora lietotājvārdu.", "Set an admin password." => "Iestatiet administratora paroli.", -"Specify a data folder." => "Norādiet datu mapi.", "%s enter the database username." => "%s ievadiet datubāzes lietotājvārdu.", "%s enter the database name." => "%s ievadiet datubāzes nosaukumu.", "%s you may not use dots in the database name" => "%s datubāžu nosaukumos nedrīkst izmantot punktus", diff --git a/lib/l10n/nl.php b/lib/l10n/nl.php index 10a4060e119..f7cc6ad899c 100644 --- a/lib/l10n/nl.php +++ b/lib/l10n/nl.php @@ -18,7 +18,6 @@ "Images" => "Afbeeldingen", "Set an admin username." => "Stel de gebruikersnaam van de beheerder in.", "Set an admin password." => "Stel een beheerderswachtwoord in.", -"Specify a data folder." => "Geef een datamap op.", "%s enter the database username." => "%s opgeven database gebruikersnaam.", "%s enter the database name." => "%s opgeven databasenaam.", "%s you may not use dots in the database name" => "%s er mogen geen puntjes in de databasenaam voorkomen", diff --git a/lib/l10n/pl.php b/lib/l10n/pl.php index 9a1a5e836c9..c508794c42a 100644 --- a/lib/l10n/pl.php +++ b/lib/l10n/pl.php @@ -18,7 +18,6 @@ "Images" => "Obrazy", "Set an admin username." => "Ustaw nazwę administratora.", "Set an admin password." => "Ustaw hasło administratora.", -"Specify a data folder." => "Określ folder danych.", "%s enter the database username." => "%s wpisz nazwę użytkownika do bazy", "%s enter the database name." => "%s wpisz nazwę bazy.", "%s you may not use dots in the database name" => "%s nie można używać kropki w nazwie bazy danych", diff --git a/lib/l10n/pt_BR.php b/lib/l10n/pt_BR.php index d4f410d8885..8196b43be23 100644 --- a/lib/l10n/pt_BR.php +++ b/lib/l10n/pt_BR.php @@ -18,7 +18,6 @@ "Images" => "Imagens", "Set an admin username." => "Defina um nome de usuário de administrador.", "Set an admin password." => "Defina uma senha de administrador.", -"Specify a data folder." => "Especifique uma pasta de dados.", "%s enter the database username." => "%s insira o nome de usuário do banco de dados.", "%s enter the database name." => "%s insira o nome do banco de dados.", "%s you may not use dots in the database name" => "%s você não pode usar pontos no nome do banco de dados", diff --git a/lib/l10n/pt_PT.php b/lib/l10n/pt_PT.php index 2c813f5b07c..12470686e7e 100644 --- a/lib/l10n/pt_PT.php +++ b/lib/l10n/pt_PT.php @@ -18,7 +18,6 @@ "Images" => "Imagens", "Set an admin username." => "Definir um nome de utilizador de administrador", "Set an admin password." => "Definiar uma password de administrador", -"Specify a data folder." => "Especificar a pasta para os dados.", "%s enter the database username." => "%s introduza o nome de utilizador da base de dados", "%s enter the database name." => "%s introduza o nome da base de dados", "%s you may not use dots in the database name" => "%s não é permitido utilizar pontos (.) no nome da base de dados", diff --git a/lib/l10n/ru.php b/lib/l10n/ru.php index 25a88d5efc2..6f351cd4584 100644 --- a/lib/l10n/ru.php +++ b/lib/l10n/ru.php @@ -18,7 +18,6 @@ "Images" => "Изображения", "Set an admin username." => "Установить имя пользователя для admin.", "Set an admin password." => "становит пароль для admin.", -"Specify a data folder." => "Указать папку данных.", "%s enter the database username." => "%s введите имя пользователя базы данных.", "%s enter the database name." => "%s введите имя базы данных.", "%s you may not use dots in the database name" => "%s Вы не можете использовать точки в имени базы данных", diff --git a/lib/l10n/sk_SK.php b/lib/l10n/sk_SK.php index 8c9ce61622c..2ab255ef8fe 100644 --- a/lib/l10n/sk_SK.php +++ b/lib/l10n/sk_SK.php @@ -18,7 +18,6 @@ "Images" => "Obrázky", "Set an admin username." => "Zadajte používateľské meno administrátora.", "Set an admin password." => "Zadajte heslo administrátora.", -"Specify a data folder." => "Zadajte priečinok pre dáta.", "%s enter the database username." => "Zadajte používateľské meno %s databázy..", "%s enter the database name." => "Zadajte názov databázy pre %s databázy.", "%s you may not use dots in the database name" => "V názve databázy %s nemôžete používať bodky", diff --git a/lib/l10n/sl.php b/lib/l10n/sl.php index a2e1719de87..8775cdd0303 100644 --- a/lib/l10n/sl.php +++ b/lib/l10n/sl.php @@ -18,7 +18,6 @@ "Images" => "Slike", "Set an admin username." => "Nastavi uporabniško ime skrbnika.", "Set an admin password." => "Nastavi geslo skrbnika.", -"Specify a data folder." => "Določi podatkovno mapo.", "%s enter the database username." => "%s - vnos uporabniškega imena podatkovne zbirke.", "%s enter the database name." => "%s - vnos imena podatkovne zbirke.", "%s you may not use dots in the database name" => "%s - v imenu podatkovne zbirke ni dovoljeno uporabljati pik.", diff --git a/lib/l10n/sq.php b/lib/l10n/sq.php index 743c52850ac..649af3c5c25 100644 --- a/lib/l10n/sq.php +++ b/lib/l10n/sq.php @@ -18,7 +18,6 @@ "Images" => "Foto", "Set an admin username." => "Cakto emrin e administratorit.", "Set an admin password." => "Cakto kodin e administratorit.", -"Specify a data folder." => "Specifiko dosjen e të dhënave.", "%s enter the database username." => "% shkruani përdoruesin e database-it.", "%s enter the database name." => "%s shkruani emrin e database-it.", "%s you may not use dots in the database name" => "%s nuk mund të përdorni pikat tek emri i database-it", diff --git a/lib/l10n/sr.php b/lib/l10n/sr.php index 1161b0a44b7..5c6620f82ba 100644 --- a/lib/l10n/sr.php +++ b/lib/l10n/sr.php @@ -16,6 +16,8 @@ "Files" => "Датотеке", "Text" => "Текст", "Images" => "Слике", +"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ваш веб сервер тренутно не подржава синхронизацију датотека јер се чини да је WebDAV сучеље неисправно.", +"Please double check the <a href='%s'>installation guides</a>." => "Погледајте <a href='%s'>водиче за инсталацију</a>.", "seconds ago" => "пре неколико секунди", "1 minute ago" => "пре 1 минут", "%d minutes ago" => "пре %d минута", diff --git a/lib/l10n/tr.php b/lib/l10n/tr.php index 84278f6d4c4..4a8292989ab 100644 --- a/lib/l10n/tr.php +++ b/lib/l10n/tr.php @@ -16,6 +16,16 @@ "Files" => "Dosyalar", "Text" => "Metin", "Images" => "Resimler", +"Set an admin username." => "Bir adi kullanici vermek. ", +"Set an admin password." => "Parola yonetici birlemek. ", +"PostgreSQL username and/or password not valid" => "PostgreSQL adi kullanici ve/veya parola yasal degildir. ", +"You need to enter either an existing account or the administrator." => "Bir konto veya kullanici birlemek ihtiyacin. ", +"Oracle username and/or password not valid" => "Adi klullanici ve/veya parola Oracle mantikli değildir. ", +"DB Error: \"%s\"" => "DB Hata: ''%s''", +"Offending command was: \"%s\"" => "Komut rahasiz ''%s''. ", +"MySQL user '%s'@'localhost' exists already." => "MySQL kullanici '%s @local host zatan var. ", +"Drop this user from MySQL" => "Bu kullanici MySQLden list disari koymak. ", +"MySQL user '%s'@'%%' already exists" => "MySQL kullanici '%s @ % % zaten var (zaten yazili)", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Web sunucunuz dosya transferi için düzgün bir şekilde yapılandırılmamış. WevDAV arabirimini sorunlu gözüküyor.", "Please double check the <a href='%s'>installation guides</a>." => "Lütfen <a href='%s'>kurulum kılavuzlarını</a> iki kez kontrol edin.", "seconds ago" => "saniye önce", diff --git a/lib/l10n/uk.php b/lib/l10n/uk.php index 68f7151d15e..9dfc16c3464 100644 --- a/lib/l10n/uk.php +++ b/lib/l10n/uk.php @@ -18,7 +18,6 @@ "Images" => "Зображення", "Set an admin username." => "Встановіть ім'я адміністратора.", "Set an admin password." => "Встановіть пароль адміністратора.", -"Specify a data folder." => "Вкажіть теку для даних.", "%s enter the database username." => "%s введіть ім'я користувача бази даних.", "%s enter the database name." => "%s введіть назву бази даних.", "%s you may not use dots in the database name" => "%s не можна використовувати крапки в назві бази даних", diff --git a/lib/l10n/zh_CN.php b/lib/l10n/zh_CN.php index b79fdfcca1d..2dea94dec36 100644 --- a/lib/l10n/zh_CN.php +++ b/lib/l10n/zh_CN.php @@ -18,7 +18,6 @@ "Images" => "图片", "Set an admin username." => "请设置一个管理员用户名。", "Set an admin password." => "请设置一个管理员密码。", -"Specify a data folder." => "请指定一个数据目录。", "%s enter the database username." => "%s 输入数据库用户名。", "%s enter the database name." => "%s 输入数据库名称。", "%s you may not use dots in the database name" => "%s 您不能在数据库名称中使用英文句号。", diff --git a/lib/l10n/zh_TW.php b/lib/l10n/zh_TW.php index 62a55ebbb47..fbcf81ad3a4 100644 --- a/lib/l10n/zh_TW.php +++ b/lib/l10n/zh_TW.php @@ -5,10 +5,10 @@ "Users" => "使用者", "Apps" => "應用程式", "Admin" => "管理", -"ZIP download is turned off." => "ZIP 下載已關閉", -"Files need to be downloaded one by one." => "檔案需要逐一下載", +"ZIP download is turned off." => "ZIP 下載已關閉。", +"Files need to be downloaded one by one." => "檔案需要逐一下載。", "Back to Files" => "回到檔案列表", -"Selected files too large to generate zip file." => "選擇的檔案太大以致於無法產生壓縮檔", +"Selected files too large to generate zip file." => "選擇的檔案太大以致於無法產生壓縮檔。", "couldn't be determined" => "無法判斷", "Application is not enabled" => "應用程式未啟用", "Authentication error" => "認證錯誤", @@ -16,12 +16,24 @@ "Files" => "檔案", "Text" => "文字", "Images" => "圖片", -"Set an admin username." => "設置一個管理員用戶名。", -"Set an admin password." => "設置一個管理員密碼。", -"PostgreSQL username and/or password not valid" => "PostgreSQL用戶名和/或密碼無效", -"You need to enter either an existing account or the administrator." => "您必須輸入一個現有的賬戶或管理員", -"Oracle username and/or password not valid" => "Oracle用戶名和/或密碼無效", -"MySQL username and/or password not valid" => "MySQL用戶名和/或密碼無效", +"Set an admin username." => "設定管理員帳號。", +"Set an admin password." => "設定管理員密碼。", +"%s enter the database username." => "%s 輸入資料庫使用者名稱。", +"%s enter the database name." => "%s 輸入資料庫名稱。", +"%s you may not use dots in the database name" => "%s 資料庫名稱不能包含小數點", +"%s set the database host." => "%s 設定資料庫主機。", +"PostgreSQL username and/or password not valid" => "PostgreSQL 用戶名和/或密碼無效", +"You need to enter either an existing account or the administrator." => "您必須輸入一個現有的帳號或管理員帳號。", +"Oracle username and/or password not valid" => "Oracle 用戶名和/或密碼無效", +"MySQL username and/or password not valid" => "MySQL 用戶名和/或密碼無效", +"DB Error: \"%s\"" => "資料庫錯誤:\"%s\"", +"Offending command was: \"%s\"" => "有問題的指令是:\"%s\"", +"MySQL user '%s'@'localhost' exists already." => "MySQL 使用者 '%s'@'localhost' 已經存在。", +"Drop this user from MySQL" => "在 MySQL 移除這個使用者", +"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." => "您的網頁伺服器尚未被正確設定來進行檔案同步,因為您的 WebDAV 界面似乎無法使用。", "Please double check the <a href='%s'>installation guides</a>." => "請參考<a href='%s'>安裝指南</a>。", "seconds ago" => "幾秒前", @@ -38,6 +50,6 @@ "years ago" => "幾年前", "%s is available. Get <a href=\"%s\">more information</a>" => "%s 已經可用。取得 <a href=\"%s\">更多資訊</a>", "up to date" => "最新的", -"updates check is disabled" => "檢查更新已停用", +"updates check is disabled" => "更新檢查已停用", "Could not find category \"%s\"" => "找不到分類:\"%s\"" ); diff --git a/lib/log/owncloud.php b/lib/log/owncloud.php index 20df52c27bb..7a11a588330 100644 --- a/lib/log/owncloud.php +++ b/lib/log/owncloud.php @@ -49,7 +49,8 @@ class OC_Log_Owncloud { public static function write($app, $message, $level) { $minLevel=min(OC_Config::getValue( "loglevel", OC_Log::WARN ), OC_Log::ERROR); if($level>=$minLevel) { - $entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=>time()); + $time = date("F d, Y H:i:s", time()); + $entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=> $time); $handle = @fopen(self::$logFile, 'a'); if ($handle) { fwrite($handle, json_encode($entry)."\n"); diff --git a/lib/mimetypes.list.php b/lib/mimetypes.list.php index 86ce9c6c237..9135a7e3af2 100644 --- a/lib/mimetypes.list.php +++ b/lib/mimetypes.list.php @@ -98,5 +98,9 @@ return array( 'epub' => 'application/epub+zip', 'mobi' => 'application/x-mobipocket-ebook', 'exe' => 'application', - 'msi' => 'application' + 'msi' => 'application', + 'md' => 'text/markdown', + 'markdown' => 'text/markdown', + 'mdown' => 'text/markdown', + 'mdwn' => 'text/markdown' ); diff --git a/lib/request.php b/lib/request.php index 9f74cf9beb5..4d8380eb9ac 100755 --- a/lib/request.php +++ b/lib/request.php @@ -11,9 +11,10 @@ class OC_Request { * @brief Check overwrite condition * @returns true/false */ - private static function isOverwriteCondition() { + private static function isOverwriteCondition($type = '') { $regex = '/' . OC_Config::getValue('overwritecondaddr', '') . '/'; - return $regex === '//' or preg_match($regex, $_SERVER['REMOTE_ADDR']) === 1; + return $regex === '//' or preg_match($regex, $_SERVER['REMOTE_ADDR']) === 1 + or ($type !== 'protocol' and OC_Config::getValue('forcessl', false)); } /** @@ -27,7 +28,7 @@ class OC_Request { if(OC::$CLI) { return 'localhost'; } - if(OC_Config::getValue('overwritehost', '')<>'' and self::isOverwriteCondition()) { + if(OC_Config::getValue('overwritehost', '') !== '' and self::isOverwriteCondition()) { return OC_Config::getValue('overwritehost'); } if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { @@ -52,7 +53,7 @@ class OC_Request { * Returns the server protocol. It respects reverse proxy servers and load balancers */ public static function serverProtocol() { - if(OC_Config::getValue('overwriteprotocol', '')<>'' and self::isOverwriteCondition()) { + if(OC_Config::getValue('overwriteprotocol', '') !== '' and self::isOverwriteCondition('protocol')) { return OC_Config::getValue('overwriteprotocol'); } if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) { @@ -76,7 +77,7 @@ class OC_Request { */ public static function requestUri() { $uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; - if (OC_Config::getValue('overwritewebroot', '') <> '' and self::isOverwriteCondition()) { + if (OC_Config::getValue('overwritewebroot', '') !== '' and self::isOverwriteCondition()) { $uri = self::scriptName() . substr($uri, strlen($_SERVER['SCRIPT_NAME'])); } return $uri; @@ -91,7 +92,7 @@ class OC_Request { */ public static function scriptName() { $name = $_SERVER['SCRIPT_NAME']; - if (OC_Config::getValue('overwritewebroot', '') <> '' and self::isOverwriteCondition()) { + if (OC_Config::getValue('overwritewebroot', '') !== '' and self::isOverwriteCondition()) { $serverroot = str_replace("\\", '/', substr(__DIR__, 0, -4)); $suburi = str_replace("\\", "/", substr(realpath($_SERVER["SCRIPT_FILENAME"]), strlen($serverroot))); $name = OC_Config::getValue('overwritewebroot', '') . $suburi; diff --git a/lib/setup.php b/lib/setup.php index 7082f0b2afd..d1197b3ebf3 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -37,7 +37,7 @@ class OC_Setup { $error[] = $l->t('Set an admin password.'); } if(empty($options['directory'])) { - $error[] = $l->t('Specify a data folder.'); + $options['directory'] = OC::$SERVERROOT."/data"; } if($dbtype == 'mysql' or $dbtype == 'pgsql' or $dbtype == 'oci' or $dbtype == 'mssql') { //mysql and postgresql needs more config options @@ -187,6 +187,7 @@ class OC_Setup { unlink("$datadir/owncloud.db"); } //in case of sqlite, we can always fill the database + error_log("creating sqlite db"); OC_DB::createDbFromStructure('db_structure.xml'); } @@ -195,7 +196,7 @@ class OC_Setup { OC_User::createUser($username, $password); } catch(Exception $exception) { - $error[] = $exception->getMessage(); + $error[] = 'Error while trying to create admin user: ' . $exception->getMessage(); } if(count($error) == 0) { @@ -827,6 +828,10 @@ class OC_Setup { $content.= "AddType image/svg+xml svg svgz\n"; $content.= "AddEncoding gzip svgz\n"; $content.= "</IfModule>\n"; + $content.= "<IfModule dir_module>\n"; + $content.= "DirectoryIndex index.php index.html\n"; + $content.= "</IfModule>\n"; + $content.= "AddDefaultCharset utf-8\n"; $content.= "Options -Indexes\n"; @file_put_contents(OC::$SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it diff --git a/lib/template.php b/lib/template.php index 434c1e9e990..2f535335648 100644 --- a/lib/template.php +++ b/lib/template.php @@ -186,10 +186,15 @@ class OC_Template{ $this->l10n = OC_L10N::get($parts[0]); // Some headers to enhance security - header('X-Frame-Options: Sameorigin'); // Disallow iFraming from other domains header('X-XSS-Protection: 1; mode=block'); // Enforce browser based XSS filters header('X-Content-Type-Options: nosniff'); // Disable sniffing the content type for IE + // iFrame Restriction Policy + $xFramePolicy = OC_Config::getValue('xframe_restriction', true); + if($xFramePolicy) { + header('X-Frame-Options: Sameorigin'); // Disallow iFraming from other domains + } + // Content Security Policy // If you change the standard policy, please also change it in config.sample.php $policy = OC_Config::getValue('custom_csp_policy', @@ -198,7 +203,8 @@ class OC_Template{ .'style-src \'self\' \'unsafe-inline\'; ' .'frame-src *; ' .'img-src *; ' - .'font-src \'self\' data:'); + .'font-src \'self\' data:; ' + .'media-src *'); header('Content-Security-Policy:'.$policy); // Standard $this->findTemplate($name); @@ -272,7 +278,7 @@ class OC_Template{ protected function findTemplate($name) { // Read the selected theme from the config file - $theme=OC_Config::getValue( "theme" ); + $theme = OC_Util::getTheme(); // Read the detected formfactor and use the right file name. $fext = self::getFormFactorExtension(); diff --git a/lib/templatelayout.php b/lib/templatelayout.php index 73094232230..3c496f56e41 100644 --- a/lib/templatelayout.php +++ b/lib/templatelayout.php @@ -103,7 +103,7 @@ class OC_TemplateLayout extends OC_Template { static public function findStylesheetFiles($styles) { // Read the selected theme from the config file - $theme=OC_Config::getValue( 'theme' ); + $theme = OC_Util::getTheme(); // Read the detected formfactor and use the right file name. $fext = self::getFormFactorExtension(); @@ -111,7 +111,8 @@ class OC_TemplateLayout extends OC_Template { $files = array(); foreach($styles as $style) { // is it in 3rdparty? - if(self::appendIfExist($files, OC::$THIRDPARTYROOT, OC::$THIRDPARTYWEBROOT, $style.'.css')) { + if(strpos($style, '3rdparty') === 0 && + self::appendIfExist($files, OC::$THIRDPARTYROOT, OC::$THIRDPARTYWEBROOT, $style.'.css')) { // or in the owncloud root? }elseif(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, "$style$fext.css" )) { @@ -161,7 +162,7 @@ class OC_TemplateLayout extends OC_Template { static public function findJavascriptFiles($scripts) { // Read the selected theme from the config file - $theme=OC_Config::getValue( 'theme' ); + $theme = OC_Util::getTheme(); // Read the detected formfactor and use the right file name. $fext = self::getFormFactorExtension(); @@ -169,7 +170,8 @@ class OC_TemplateLayout extends OC_Template { $files = array(); foreach($scripts as $script) { // Is it in 3rd party? - if(self::appendIfExist($files, OC::$THIRDPARTYROOT, OC::$THIRDPARTYWEBROOT, $script.'.js')) { + if(strpos($script, '3rdparty') === 0 && + self::appendIfExist($files, OC::$THIRDPARTYROOT, OC::$THIRDPARTYWEBROOT, $script.'.js')) { // Is it in apps and overwritten by the theme? }elseif(self::appendIfExist($files, OC::$SERVERROOT, OC::$WEBROOT, "themes/$theme/apps/$script$fext.js" )) { diff --git a/lib/user/database.php b/lib/user/database.php index 210c7f3e1eb..ea938790d22 100644 --- a/lib/user/database.php +++ b/lib/user/database.php @@ -237,13 +237,13 @@ class OC_User_Database extends OC_User_Backend { * @return boolean */ public function userExists($uid) { - $query = OC_DB::prepare( 'SELECT * FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)' ); + $query = OC_DB::prepare( 'SELECT COUNT(*) FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)' ); $result = $query->execute( array( $uid )); if (OC_DB::isError($result)) { OC_Log::write('core', OC_DB::getErrorMessage($result), OC_Log::ERROR); return false; } - return $result->numRows() > 0; + return $result->fetchOne() > 0; } /** diff --git a/lib/util.php b/lib/util.php index 37fb1bd9d06..810593358a5 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(5, 80, 01); + return array(5, 80, 02); } /** @@ -595,7 +595,7 @@ class OC_Util { } catch(\Sabre_DAV_Exception_NotAuthenticated $e) { $return = true; } catch(\Exception $e) { - OC_Log::write('core', 'isWebDAVWorking: NO - Reason: '.$e, OC_Log::WARN); + OC_Log::write('core', 'isWebDAVWorking: NO - Reason: '.$e->getMessage(). ' ('.get_class($e).')', OC_Log::WARN); $return = false; } @@ -795,4 +795,25 @@ class OC_Util { return (substr(PHP_OS, 0, 3) === "WIN"); } + + /** + * Handles the case that there may not be a theme, then check if a "default" + * theme exists and take that one + * @return string the theme + */ + public static function getTheme() { + $theme = OC_Config::getValue("theme"); + + if(is_null($theme)) { + + if(is_dir(OC::$SERVERROOT . '/themes/default')) { + $theme = 'default'; + } + + } + + return $theme; + } + + } |