summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2013-07-03 17:03:47 +0200
committerThomas Mueller <thomas.mueller@tmit.eu>2013-07-03 17:03:47 +0200
commit32d69f68896c08e216bc0e84db409d00ec654856 (patch)
treebdc5d05a851eeeb0828f01dd9925f9c2ea0f0683 /lib
parente789e056759aedb93d9eba3a8598acea67c842c6 (diff)
parent33e1ced53c31443ad9918d6bdd7d20afc628ccbd (diff)
downloadnextcloud-server-32d69f68896c08e216bc0e84db409d00ec654856.tar.gz
nextcloud-server-32d69f68896c08e216bc0e84db409d00ec654856.zip
Merge branch 'master' into convert-oc_config
Diffstat (limited to 'lib')
-rw-r--r--lib/app.php1
-rw-r--r--lib/files/view.php24
-rwxr-xr-xlib/request.php22
3 files changed, 36 insertions, 11 deletions
diff --git a/lib/app.php b/lib/app.php
index f974dd9f594..f9b1c5ca7b5 100644
--- a/lib/app.php
+++ b/lib/app.php
@@ -259,6 +259,7 @@ class OC_App{
*/
public static function disable( $app ) {
// check if app is a shipped app or not. if not delete
+ \OC_Hook::emit('OC_App', 'pre_disable', array('app' => $app));
OC_Appconfig::setValue( $app, 'enabled', 'no' );
// check if app is a shipped app or not. if not delete
diff --git a/lib/files/view.php b/lib/files/view.php
index d8d99698023..c9727fe4984 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -353,7 +353,16 @@ class View {
return false;
}
$run = true;
- if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isPartialFile($path1)) {
+ if ($this->fakeRoot == Filesystem::getRoot() && (Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2))) {
+ // if it was a rename from a part file to a regular file it was a write and not a rename operation
+ \OC_Hook::emit(
+ Filesystem::CLASSNAME, Filesystem::signal_write,
+ array(
+ Filesystem::signal_param_path => $path2,
+ Filesystem::signal_param_run => &$run
+ )
+ );
+ } elseif ($this->fakeRoot == Filesystem::getRoot()) {
\OC_Hook::emit(
Filesystem::CLASSNAME, Filesystem::signal_rename,
array(
@@ -398,7 +407,16 @@ class View {
}
}
}
- if ($this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isPartialFile($path1) && $result !== false) {
+ if ($this->fakeRoot == Filesystem::getRoot() && (Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2)) && $result !== false) {
+ // if it was a rename from a part file to a regular file it was a write and not a rename operation
+ \OC_Hook::emit(
+ Filesystem::CLASSNAME,
+ Filesystem::signal_post_write,
+ array(
+ Filesystem::signal_param_path => $path2,
+ )
+ );
+ } elseif ($this->fakeRoot == Filesystem::getRoot() && $result !== false) {
\OC_Hook::emit(
Filesystem::CLASSNAME,
Filesystem::signal_post_rename,
@@ -670,7 +688,7 @@ class View {
private function runHooks($hooks, $path, $post = false) {
$prefix = ($post) ? 'post_' : '';
$run = true;
- if (Filesystem::$loaded and $this->fakeRoot == Filesystem::getRoot()) {
+ if (Filesystem::$loaded and $this->fakeRoot == Filesystem::getRoot() && !Cache\Scanner::isPartialFile($path)) {
foreach ($hooks as $hook) {
if ($hook != 'read') {
\OC_Hook::emit(
diff --git a/lib/request.php b/lib/request.php
index 4d8380eb9ac..df33217f95d 100755
--- a/lib/request.php
+++ b/lib/request.php
@@ -9,7 +9,7 @@
class OC_Request {
/**
* @brief Check overwrite condition
- * @returns true/false
+ * @returns bool
*/
private static function isOverwriteCondition($type = '') {
$regex = '/' . OC_Config::getValue('overwritecondaddr', '') . '/';
@@ -19,7 +19,7 @@ class OC_Request {
/**
* @brief Returns the server host
- * @returns the server host
+ * @returns string the server host
*
* Returns the server host, even if the website uses one or more
* reverse proxies
@@ -40,7 +40,13 @@ class OC_Request {
}
}
else{
- $host = $_SERVER['HTTP_HOST'];
+ if (isset($_SERVER['HTTP_HOST'])) {
+ return $_SERVER['HTTP_HOST'];
+ }
+ if (isset($_SERVER['SERVER_NAME'])) {
+ return $_SERVER['SERVER_NAME'];
+ }
+ return 'localhost';
}
return $host;
}
@@ -48,7 +54,7 @@ class OC_Request {
/**
* @brief Returns the server protocol
- * @returns the server protocol
+ * @returns string the server protocol
*
* Returns the server protocol. It respects reverse proxy servers and load balancers
*/
@@ -70,7 +76,7 @@ class OC_Request {
/**
* @brief Returns the request uri
- * @returns the request uri
+ * @returns string the request uri
*
* Returns the request uri, even if the website uses one or more
* reverse proxies
@@ -85,7 +91,7 @@ class OC_Request {
/**
* @brief Returns the script name
- * @returns the script name
+ * @returns string the script name
*
* Returns the script name, even if the website uses one or more
* reverse proxies
@@ -139,7 +145,7 @@ class OC_Request {
/**
* @brief Check if this is a no-cache request
- * @returns true for no-cache
+ * @returns boolean true for no-cache
*/
static public function isNoCache() {
if (!isset($_SERVER['HTTP_CACHE_CONTROL'])) {
@@ -150,7 +156,7 @@ class OC_Request {
/**
* @brief Check if the requestor understands gzip
- * @returns true for gzip encoding supported
+ * @returns boolean true for gzip encoding supported
*/
static public function acceptGZip() {
if (!isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {