summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2013-11-24 23:27:44 +0100
committerThomas Mueller <thomas.mueller@tmit.eu>2013-11-24 23:27:44 +0100
commit37b07fe6a9e512214852584fb15056f008509882 (patch)
tree6200a40da93696df4e3e5863308757f4b0b2ece2 /lib
parent14332681fc541aca936dcbd6baf7de220734815f (diff)
parenta2d4cd87d05392058d6837e8feea4fffb3e55faa (diff)
downloadnextcloud-server-37b07fe6a9e512214852584fb15056f008509882.tar.gz
nextcloud-server-37b07fe6a9e512214852584fb15056f008509882.zip
Merge branch 'master' into fix-5388-master
Diffstat (limited to 'lib')
-rw-r--r--lib/l10n/de.php1
-rw-r--r--lib/l10n/de_DE.php1
-rw-r--r--lib/l10n/el.php2
-rw-r--r--lib/l10n/et_EE.php1
-rw-r--r--lib/l10n/gl.php1
-rw-r--r--lib/l10n/it.php1
-rw-r--r--lib/private/files/cache/cache.php2
-rw-r--r--lib/private/files/cache/updater.php2
-rw-r--r--lib/private/files/storage/common.php13
-rw-r--r--lib/private/image.php31
-rwxr-xr-xlib/private/request.php3
11 files changed, 38 insertions, 20 deletions
diff --git a/lib/l10n/de.php b/lib/l10n/de.php
index 7ab0345209c..5b09d350a7d 100644
--- a/lib/l10n/de.php
+++ b/lib/l10n/de.php
@@ -16,6 +16,7 @@ $TRANSLATIONS = array(
"Files need to be downloaded one by one." => "Die Dateien müssen einzeln heruntergeladen werden.",
"Back to Files" => "Zurück zu \"Dateien\"",
"Selected files too large to generate zip file." => "Die gewählten Dateien sind zu groß, um eine ZIP-Datei zu erstellen.",
+"Please download the files separately in smaller chunks or kindly ask your administrator." => "Bitte lade die Dateien einzeln in kleineren Teilen herunter oder bitte Deinen Administrator.",
"No source specified when installing app" => "Für die Installation der Applikation wurde keine Quelle angegeben",
"No href specified when installing app from http" => "Der Link (href) wurde nicht angegeben um die Applikation per http zu installieren",
"No path specified when installing app from local file" => "Bei der Installation der Applikation aus einer lokalen Datei wurde kein Pfad angegeben",
diff --git a/lib/l10n/de_DE.php b/lib/l10n/de_DE.php
index b14bafbf69d..e76718b4117 100644
--- a/lib/l10n/de_DE.php
+++ b/lib/l10n/de_DE.php
@@ -16,6 +16,7 @@ $TRANSLATIONS = array(
"Files need to be downloaded one by one." => "Die Dateien müssen einzeln heruntergeladen werden.",
"Back to Files" => "Zurück zu \"Dateien\"",
"Selected files too large to generate zip file." => "Die gewählten Dateien sind zu groß, um eine ZIP-Datei zu erstellen.",
+"Please download the files separately in smaller chunks or kindly ask your administrator." => "Bitte laden Sie die Dateien einzeln in kleineren Teilen herunter oder bitten Sie Ihren Administrator.",
"No source specified when installing app" => "Für die Installation der Applikation wurde keine Quelle angegeben",
"No href specified when installing app from http" => "Der Link (href) wurde nicht angegeben um die Applikation per http zu installieren",
"No path specified when installing app from local file" => "Bei der Installation der Applikation aus einer lokalen Datei wurde kein Pfad angegeben",
diff --git a/lib/l10n/el.php b/lib/l10n/el.php
index f620e1b3542..d536b699a9e 100644
--- a/lib/l10n/el.php
+++ b/lib/l10n/el.php
@@ -42,7 +42,7 @@ $TRANSLATIONS = array(
"Please double check the <a href='%s'>installation guides</a>." => "Ελέγξτε ξανά τις <a href='%s'>οδηγίες εγκατάστασης</a>.",
"Could not find category \"%s\"" => "Αδυναμία εύρεσης κατηγορίας \"%s\"",
"seconds ago" => "δευτερόλεπτα πριν",
-"_%n minute ago_::_%n minutes ago_" => array("",""),
+"_%n minute ago_::_%n minutes ago_" => array("","%n λεπτά πριν"),
"_%n hour ago_::_%n hours ago_" => array("",""),
"today" => "σήμερα",
"yesterday" => "χτες",
diff --git a/lib/l10n/et_EE.php b/lib/l10n/et_EE.php
index 9cdeb390218..7340ee72c28 100644
--- a/lib/l10n/et_EE.php
+++ b/lib/l10n/et_EE.php
@@ -16,6 +16,7 @@ $TRANSLATIONS = array(
"Files need to be downloaded one by one." => "Failid tuleb alla laadida ükshaaval.",
"Back to Files" => "Tagasi failide juurde",
"Selected files too large to generate zip file." => "Valitud failid on ZIP-faili loomiseks liiga suured.",
+"Please download the files separately in smaller chunks or kindly ask your administrator." => "Palun laadi failid alla eraldi väiksemate osadena või palu abi oma süsteemihaldurilt.",
"No source specified when installing app" => "Ühegi lähteallikat pole rakendi paigalduseks määratletud",
"No href specified when installing app from http" => "Ühtegi aadressi pole määratletud rakendi paigalduseks veebist",
"No path specified when installing app from local file" => "Ühtegi teed pole määratletud paigaldamaks rakendit kohalikust failist",
diff --git a/lib/l10n/gl.php b/lib/l10n/gl.php
index d6366022e69..cf13408b2cd 100644
--- a/lib/l10n/gl.php
+++ b/lib/l10n/gl.php
@@ -16,6 +16,7 @@ $TRANSLATIONS = array(
"Files need to be downloaded one by one." => "Os ficheiros necesitan seren descargados dun en un.",
"Back to Files" => "Volver aos ficheiros",
"Selected files too large to generate zip file." => "Os ficheiros seleccionados son demasiado grandes como para xerar un ficheiro zip.",
+"Please download the files separately in smaller chunks or kindly ask your administrator." => "Descargue os ficheiros en fragmentos máis pequenos e por separado, ou pídallos amabelmente ao seu administrador.",
"No source specified when installing app" => "Non foi especificada ningunha orixe ao instalar aplicativos",
"No href specified when installing app from http" => "Non foi especificada ningunha href ao instalar aplicativos",
"No path specified when installing app from local file" => "Non foi especificada ningunha ruta ao instalar aplicativos desde un ficheiro local",
diff --git a/lib/l10n/it.php b/lib/l10n/it.php
index 2a1be30c7c9..b1259a0a874 100644
--- a/lib/l10n/it.php
+++ b/lib/l10n/it.php
@@ -16,6 +16,7 @@ $TRANSLATIONS = array(
"Files need to be downloaded one by one." => "I file devono essere scaricati uno alla volta.",
"Back to Files" => "Torna ai file",
"Selected files too large to generate zip file." => "I file selezionati sono troppo grandi per generare un file zip.",
+"Please download the files separately in smaller chunks or kindly ask your administrator." => "Scarica i file separatamente in blocchi più piccoli o chiedi al tuo amministratore.",
"No source specified when installing app" => "Nessuna fonte specificata durante l'installazione dell'applicazione",
"No href specified when installing app from http" => "Nessun href specificato durante l'installazione dell'applicazione da http",
"No path specified when installing app from local file" => "Nessun percorso specificato durante l'installazione dell'applicazione da file locale",
diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php
index 8c34fa58540..ac50a988e32 100644
--- a/lib/private/files/cache/cache.php
+++ b/lib/private/files/cache/cache.php
@@ -507,7 +507,7 @@ class Cache {
$entry = $this->get($path);
if ($entry && $entry['mimetype'] === 'httpd/unix-directory') {
$id = $entry['fileid'];
- $sql = 'SELECT SUM(`size`), MIN(`size`) FROM `*PREFIX*filecache` '.
+ $sql = 'SELECT SUM(`size`) AS f1, MIN(`size`) AS f2 FROM `*PREFIX*filecache` '.
'WHERE `parent` = ? AND `storage` = ?';
$result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId()));
if ($row = $result->fetchRow()) {
diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php
index da223567001..d45c5e17fc8 100644
--- a/lib/private/files/cache/updater.php
+++ b/lib/private/files/cache/updater.php
@@ -142,7 +142,7 @@ class Updater {
$cache->update($id, array('mtime' => $time, 'etag' => $storage->getETag($internalPath)));
if ($realPath !== '') {
$realPath = dirname($realPath);
- if($realPath === '/') {
+ if($realPath === DIRECTORY_SEPARATOR ) {
$realPath = "";
}
// check storage for parent in case we change the storage in this step
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php
index f99bbc9ae5e..678bf419023 100644
--- a/lib/private/files/storage/common.php
+++ b/lib/private/files/storage/common.php
@@ -51,6 +51,19 @@ abstract class Common implements \OC\Files\Storage\Storage {
}
}
+ public function isReadable($path) {
+ // at least check whether it exists
+ // subclasses might want to implement this more thoroughly
+ return $this->file_exists($path);
+ }
+
+ public function isUpdatable($path) {
+ // at least check whether it exists
+ // subclasses might want to implement this more thoroughly
+ // a non-existing file/folder isn't updatable
+ return $this->file_exists($path);
+ }
+
public function isCreatable($path) {
if ($this->is_dir($path) && $this->isUpdatable($path)) {
return true;
diff --git a/lib/private/image.php b/lib/private/image.php
index b5ae1165f8e..7761a3c7737 100644
--- a/lib/private/image.php
+++ b/lib/private/image.php
@@ -414,61 +414,60 @@ class OC_Image {
*/
public function loadFromFile($imagePath=false) {
// exif_imagetype throws "read error!" if file is less than 12 byte
- $absPath = \OC\Files\Filesystem::getLocalFile($imagePath);
- if(!@is_file($absPath) || !file_exists($absPath) || filesize($absPath) < 12 || !is_readable($absPath)) {
+ if(!@is_file($imagePath) || !file_exists($imagePath) || filesize($imagePath) < 12 || !is_readable($imagePath)) {
// Debug output disabled because this method is tried before loadFromBase64?
- OC_Log::write('core', 'OC_Image->loadFromFile, couldn\'t load: '.$absPath, OC_Log::DEBUG);
+ OC_Log::write('core', 'OC_Image->loadFromFile, couldn\'t load: '.$imagePath, OC_Log::DEBUG);
return false;
}
- $iType = exif_imagetype($absPath);
+ $iType = exif_imagetype($imagePath);
switch ($iType) {
case IMAGETYPE_GIF:
if (imagetypes() & IMG_GIF) {
- $this->resource = imagecreatefromgif($absPath);
+ $this->resource = imagecreatefromgif($imagePath);
} else {
OC_Log::write('core',
- 'OC_Image->loadFromFile, GIF images not supported: '.$absPath,
+ 'OC_Image->loadFromFile, GIF images not supported: '.$imagePath,
OC_Log::DEBUG);
}
break;
case IMAGETYPE_JPEG:
if (imagetypes() & IMG_JPG) {
- $this->resource = imagecreatefromjpeg($absPath);
+ $this->resource = imagecreatefromjpeg($imagePath);
} else {
OC_Log::write('core',
- 'OC_Image->loadFromFile, JPG images not supported: '.$absPath,
+ 'OC_Image->loadFromFile, JPG images not supported: '.$imagePath,
OC_Log::DEBUG);
}
break;
case IMAGETYPE_PNG:
if (imagetypes() & IMG_PNG) {
- $this->resource = imagecreatefrompng($absPath);
+ $this->resource = imagecreatefrompng($imagePath);
} else {
OC_Log::write('core',
- 'OC_Image->loadFromFile, PNG images not supported: '.$absPath,
+ 'OC_Image->loadFromFile, PNG images not supported: '.$imagePath,
OC_Log::DEBUG);
}
break;
case IMAGETYPE_XBM:
if (imagetypes() & IMG_XPM) {
- $this->resource = imagecreatefromxbm($absPath);
+ $this->resource = imagecreatefromxbm($imagePath);
} else {
OC_Log::write('core',
- 'OC_Image->loadFromFile, XBM/XPM images not supported: '.$absPath,
+ 'OC_Image->loadFromFile, XBM/XPM images not supported: '.$imagePath,
OC_Log::DEBUG);
}
break;
case IMAGETYPE_WBMP:
if (imagetypes() & IMG_WBMP) {
- $this->resource = imagecreatefromwbmp($absPath);
+ $this->resource = imagecreatefromwbmp($imagePath);
} else {
OC_Log::write('core',
- 'OC_Image->loadFromFile, WBMP images not supported: '.$absPath,
+ 'OC_Image->loadFromFile, WBMP images not supported: '.$imagePath,
OC_Log::DEBUG);
}
break;
case IMAGETYPE_BMP:
- $this->resource = $this->imagecreatefrombmp($absPath);
+ $this->resource = $this->imagecreatefrombmp($imagePath);
break;
/*
case IMAGETYPE_TIFF_II: // (intel byte order)
@@ -497,7 +496,7 @@ class OC_Image {
default:
// this is mostly file created from encrypted file
- $this->resource = imagecreatefromstring(\OC\Files\Filesystem::file_get_contents($imagePath));
+ $this->resource = imagecreatefromstring(\OC\Files\Filesystem::file_get_contents(\OC\Files\Filesystem::getLocalPath($imagePath)));
$iType = IMAGETYPE_PNG;
OC_Log::write('core', 'OC_Image->loadFromFile, Default', OC_Log::DEBUG);
break;
diff --git a/lib/private/request.php b/lib/private/request.php
index df33217f95d..d11e5b16cfe 100755
--- a/lib/private/request.php
+++ b/lib/private/request.php
@@ -9,6 +9,7 @@
class OC_Request {
/**
* @brief Check overwrite condition
+ * @param string $type
* @returns bool
*/
private static function isOverwriteCondition($type = '') {
@@ -99,7 +100,7 @@ class OC_Request {
public static function scriptName() {
$name = $_SERVER['SCRIPT_NAME'];
if (OC_Config::getValue('overwritewebroot', '') !== '' and self::isOverwriteCondition()) {
- $serverroot = str_replace("\\", '/', substr(__DIR__, 0, -4));
+ $serverroot = str_replace("\\", '/', substr(__DIR__, 0, -strlen('lib/private/')));
$suburi = str_replace("\\", "/", substr(realpath($_SERVER["SCRIPT_FILENAME"]), strlen($serverroot)));
$name = OC_Config::getValue('overwritewebroot', '') . $suburi;
}