Better handling of core.css and core.js

Fixes calling remote.php on install.
Fixes http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-933
remotes/origin/stable45
Bart Visscher 13 years ago
parent d4f6f3e935
commit 4260dce826
  1. 4
      core/templates/layout.guest.php
  2. 4
      core/templates/layout.user.php
  3. 5
      lib/app.php
  4. 7
      lib/base.php

@ -4,7 +4,7 @@
<title>ownCloud</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="<?php echo image_path('', 'favicon.png'); ?>" /><link rel="apple-touch-icon-precomposed" href="<?php echo image_path('', 'favicon-touch.png'); ?>" />
<?php if (!defined('DEBUG') || !DEBUG): ?>
<?php if (!empty(OC_Util::$core_styles)): ?>
<link rel="stylesheet" href="<?php echo OC_Helper::linkToRemote('core.css', false) ?>" type="text/css" media="screen" />
<?php endif ?>
<?php foreach($_['cssfiles'] as $cssfile): ?>
@ -14,7 +14,7 @@
var oc_webroot = '<?php echo OC::$WEBROOT; ?>';
var oc_appswebroot = '<?php echo OC::$APPSWEBROOT; ?>';
</script>
<?php if (!defined('DEBUG') || !DEBUG): ?>
<?php if (!empty(OC_Util::$core_scripts)): ?>
<script type="text/javascript" src="<?php echo OC_Helper::linkToRemote('core.js', false) ?>"></script>
<?php endif ?>
<?php foreach($_['jsfiles'] as $jsfile): ?>

@ -4,7 +4,7 @@
<title><?php echo isset($_['application']) && !empty($_['application'])?$_['application'].' | ':'' ?>ownCloud <?php echo OC_User::getUser()?' ('.OC_User::getUser().') ':'' ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="<?php echo image_path('', 'favicon.png'); ?>" /><link rel="apple-touch-icon-precomposed" href="<?php echo image_path('', 'favicon-touch.png'); ?>" />
<?php if (!defined('DEBUG') || !DEBUG): ?>
<?php if (!empty(OC_Util::$core_styles)): ?>
<link rel="stylesheet" href="<?php echo OC_Helper::linkToRemote('core.css', false) ?>" type="text/css" media="screen" />
<?php endif ?>
<?php foreach($_['cssfiles'] as $cssfile): ?>
@ -15,7 +15,7 @@
var oc_appswebroot = '<?php echo OC::$APPSWEBROOT; ?>';
var oc_current_user = '<?php echo OC_User::getUser() ?>';
</script>
<?php if (!defined('DEBUG') || !DEBUG): ?>
<?php if (!empty(OC_Util::$core_scripts)): ?>
<script type="text/javascript" src="<?php echo OC_Helper::linkToRemote('core.js', false) ?>"></script>
<?php endif ?>
<?php foreach($_['jsfiles'] as $jsfile): ?>

@ -67,6 +67,11 @@ class OC_App{
OC_Util::$scripts = array();
OC_Util::$core_styles = OC_Util::$styles;
OC_Util::$styles = array();
if (!OC_AppConfig::getValue('core', 'remote_core.css', false)) {
OC_AppConfig::setValue('core', 'remote_core.css', '/core/minimizer.php');
OC_AppConfig::setValue('core', 'remote_core.js', '/core/minimizer.php');
}
}
}
// return

@ -426,13 +426,6 @@ class OC{
//make sure temporary files are cleaned up
register_shutdown_function(array('OC_Helper','cleanTmp'));
if (OC_Config::getValue('installed', false)) {
if (!OC_AppConfig::getValue('core', 'remote_core.css', false)) {
OC_AppConfig::setValue('core', 'remote_core.css', '/core/minimizer.php');
OC_AppConfig::setValue('core', 'remote_core.js', '/core/minimizer.php');
}
}
//parse the given parameters
self::$REQUESTEDAPP = (isset($_GET['app'])?str_replace(array('\0', '/', '\\', '..'), '', strip_tags($_GET['app'])):OC_Config::getValue('defaultapp', 'files'));
if(substr_count(self::$REQUESTEDAPP, '?') != 0){

Loading…
Cancel
Save