diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 11 | ||||
-rw-r--r-- | lib/files/filesystem.php | 4 | ||||
-rw-r--r-- | lib/json.php | 2 |
3 files changed, 12 insertions, 5 deletions
diff --git a/lib/base.php b/lib/base.php index e3b6a58bb2d..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; diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php index edd37d7b468..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 */ 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; } } |