aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-10-11 22:54:39 +0200
committerRobin Appelman <icewind@owncloud.com>2012-10-11 22:54:39 +0200
commitfb2d2bc2011c371ff1e4334f84494f15a84a07a2 (patch)
treeb5c20c842441ce4288038909daa5a158c8e74e80 /lib/base.php
parent5c6e9518edde10e0c23d0d734d2cc6d161fc15c0 (diff)
parentee28e35ba93032a3d43601c030d3d44df9b092f0 (diff)
downloadnextcloud-server-fb2d2bc2011c371ff1e4334f84494f15a84a07a2.tar.gz
nextcloud-server-fb2d2bc2011c371ff1e4334f84494f15a84a07a2.zip
merge master into filesystem
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/base.php b/lib/base.php
index 8133882811f..2704cdecf7a 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -72,11 +72,14 @@ class OC{
*/
public static function autoload($className) {
if(array_key_exists($className, OC::$CLASSPATH)) {
+ $path = OC::$CLASSPATH[$className];
/** @TODO: Remove this when necessary
Remove "apps/" from inclusion path for smooth migration to mutli app dir
*/
- $path = str_replace('apps/', '', OC::$CLASSPATH[$className]);
- require_once $path;
+ if (strpos($path, 'apps/')===0) {
+ OC_Log::write('core', 'include path for class "'.$className.'" starts with "apps/"', OC_Log::DEBUG);
+ $path = str_replace('apps/', '', $path);
+ }
}
elseif(strpos($className, 'OC_')===0) {
$path = strtolower(str_replace('_', '/', substr($className, 3)) . '.php');
@@ -110,7 +113,7 @@ class OC{
public static function initPaths() {
// calculate the root directories
- OC::$SERVERROOT=str_replace("\\", '/', substr(__FILE__, 0, -13));
+ OC::$SERVERROOT=str_replace("\\", '/', substr(__DIR__, 0, -4));
OC::$SUBURI= str_replace("\\", "/", substr(realpath($_SERVER["SCRIPT_FILENAME"]), strlen(OC::$SERVERROOT)));
$scriptName=$_SERVER["SCRIPT_NAME"];
if(substr($scriptName, -1)=='/') {
@@ -199,6 +202,7 @@ class OC{
public static function checkSSL() {
// redirect to https site if configured
if( OC_Config::getValue( "forcessl", false )) {
+ header('Strict-Transport-Security: max-age=31536000');
ini_set("session.cookie_secure", "on");
if(OC_Request::serverProtocol()<>'https' and !OC::$CLI) {
$url = "https://". OC_Request::serverHost() . $_SERVER['REQUEST_URI'];