summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_encryption/lib/cryptstream.php2
-rw-r--r--apps/files_sharing/get.php2
-rw-r--r--core/css/styles.css4
-rw-r--r--core/templates/layout.user.php2
-rw-r--r--lib/fileproxy/quota.php2
-rw-r--r--lib/helper.php6
-rw-r--r--lib/l10n.php30
-rw-r--r--lib/l10n/string.php25
-rw-r--r--lib/template.php2
9 files changed, 62 insertions, 13 deletions
diff --git a/apps/files_encryption/lib/cryptstream.php b/apps/files_encryption/lib/cryptstream.php
index 56331cbf601..64fec381ded 100644
--- a/apps/files_encryption/lib/cryptstream.php
+++ b/apps/files_encryption/lib/cryptstream.php
@@ -159,7 +159,7 @@ class OC_CryptStream{
public function stream_close(){
$this->flush();
if($this->meta['mode']!='r' and $this->meta['mode']!='rb'){
- OC_FileCache::put($this->path,array('encrypted'=>true));
+ OC_FileCache::put($this->path,array('encrypted'=>true),'');
}
return fclose($this->source);
}
diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php
index e2fcb82750d..a051451d33a 100644
--- a/apps/files_sharing/get.php
+++ b/apps/files_sharing/get.php
@@ -61,7 +61,7 @@ if (isset($_GET['token']) && $source = OC_Share::getSource($_GET['token'])) {
$list->assign("downloadURL", OCP\Util::linkTo("", "public.php")."?service=files&token=".$token."&path=");
$list->assign("readonly", true);
$tmpl = new OCP\Template("files", "index", "user");
- $tmpl->assign("fileList", $list->fetchPage());
+ $tmpl->assign("fileList", $list->fetchPage(), false);
$tmpl->assign("breadcrumb", $breadcrumbNav->fetchPage());
$tmpl->assign("readonly", true);
$tmpl->assign("allowZipDownload", false);
diff --git a/core/css/styles.css b/core/css/styles.css
index 0ff381e9e63..6d272845ebe 100644
--- a/core/css/styles.css
+++ b/core/css/styles.css
@@ -111,8 +111,8 @@ label.infield { cursor: text !important; }
.action, .selectedActions a { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; filter:alpha(opacity=50); opacity:.5; -webkit-transition:opacity 200ms; -moz-transition:opacity 200ms; -o-transition:opacity 200ms; transition:opacity 200ms; }
.action { width: 16px; height: 16px; }
-#logout { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; filter:alpha(opacity=80); opacity:.8; }
-.action:hover, .selectedActions a:hover, #logout:hover { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter:alpha(opacity=100); opacity:1; }
+.header-action { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; filter:alpha(opacity=80); opacity:.8; }
+.action:hover, .selectedActions a:hover, .header-action:hover { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter:alpha(opacity=100); opacity:1; }
table:not(.nostyle) tr { -webkit-transition:background-color 200ms; -moz-transition:background-color 200ms; -o-transition:background-color 200ms; transition:background-color 200ms; }
tbody tr:hover, tr:active { background-color:#f8f8f8; }
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index c6696fc72bf..500ac9beda3 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -45,7 +45,7 @@
<body id="<?php echo $_['bodyid'];?>">
<header><div id="header">
<a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg" src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a>
- <a class="header-right" id="logout" href="<?php echo link_to('', 'index.php'); ?>?logout=true"><img class="svg" alt="<?php echo $l->t('Log out');?>" title="<?php echo $l->t('Log out');?>" src="<?php echo image_path('', 'actions/logout.svg'); ?>" /></a>
+ <a class="header-right header-action" id="logout" href="<?php echo link_to('', 'index.php'); ?>?logout=true"><img class="svg" alt="<?php echo $l->t('Log out');?>" title="<?php echo $l->t('Log out');?>" src="<?php echo image_path('', 'actions/logout.svg'); ?>" /></a>
<form class="searchbox header-right" action="#" method="post">
<input id="searchbox" class="svg" type="search" name="query" value="<?php if(isset($_POST['query'])){echo htmlentities($_POST['query']);};?>" autocomplete="off" />
</form>
diff --git a/lib/fileproxy/quota.php b/lib/fileproxy/quota.php
index f061d48219b..b0c3775b9db 100644
--- a/lib/fileproxy/quota.php
+++ b/lib/fileproxy/quota.php
@@ -55,7 +55,9 @@ class OC_FileProxy_Quota extends OC_FileProxy{
*/
private function getFreeSpace(){
$rootInfo=OC_FileCache_Cached::get('');
+ $sharedInfo=OC_FileCache_Cached::get('/Shared');
$usedSpace=isset($rootInfo['size'])?$rootInfo['size']:0;
+ $usedSpace=isset($sharedInfo['size'])?$usedSpace-$sharedInfo['size']:$usedSpace;
$totalSpace=$this->getQuota();
if($totalSpace==0){
return 0;
diff --git a/lib/helper.php b/lib/helper.php
index 2ded7b13c38..480c3fe930e 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -378,6 +378,12 @@ class OC_Helper {
//trim the character set from the end of the response
$mimeType=substr($reply,0,strrpos($reply,' '));
+
+ //trim ;
+ if (strpos($mimeType, ';') !== false) {
+ $mimeType = strstr($mimeType, ';', true);
+ }
+
}
if ($mimeType=='application/octet-stream') {
// Fallback solution: (try to guess the type by the file extension
diff --git a/lib/l10n.php b/lib/l10n.php
index ba4bf23780e..0f01e927ff9 100644
--- a/lib/l10n.php
+++ b/lib/l10n.php
@@ -40,6 +40,16 @@ class OC_L10N{
protected static $language = '';
/**
+ * App of this object
+ */
+ protected $app;
+
+ /**
+ * Language of this object
+ */
+ protected $lang;
+
+ /**
* Translations
*/
private $translations = array();
@@ -77,10 +87,17 @@ class OC_L10N{
* language.
*/
public function __construct($app, $lang = null){
- $this->init($app, $lang);
+ $this->app = $app;
+ $this->lang = $lang;
}
- protected function init($app, $lang = null){
+ protected function init(){
+ if ($this->app === true) {
+ return;
+ }
+ $app = $this->app;
+ $lang = $this->lang;
+ $this->app = true;
// Find the right language
if(is_null($lang)){
$lang = self::findLanguage($app);
@@ -127,10 +144,7 @@ class OC_L10N{
* returned.
*/
public function t($text, $parameters = array()){
- if(array_key_exists($text, $this->translations)){
- return vsprintf($this->translations[$text], $parameters);
- }
- return vsprintf($text, $parameters);
+ return new OC_L10N_String($this, $text, $parameters);
}
/**
@@ -144,7 +158,7 @@ class OC_L10N{
public function tA($textArray){
$result = array();
foreach($textArray as $key => $text){
- $result[$key] = $this->t($text);
+ $result[$key] = (string)$this->t($text);
}
return $result;
}
@@ -156,6 +170,7 @@ class OC_L10N{
* Returns an associative array with all translations
*/
public function getTranslations(){
+ $this->init();
return $this->translations;
}
@@ -182,6 +197,7 @@ class OC_L10N{
* - params: timestamp (int/string)
*/
public function l($type, $data){
+ $this->init();
switch($type){
// If you add something don't forget to add it to $localizations
// at the top of the page
diff --git a/lib/l10n/string.php b/lib/l10n/string.php
new file mode 100644
index 00000000000..4769790a16d
--- /dev/null
+++ b/lib/l10n/string.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+class OC_L10N_String{
+ protected $l10n;
+ public function __construct($l10n, $text, $parameters){
+ $this->l10n = $l10n;
+ $this->text = $text;
+ $this->parameters = $parameters;
+
+ }
+
+ public function __toString(){
+ $translations = $this->l10n->getTranslations();
+ if(array_key_exists($this->text, $translations)){
+ return vsprintf($translations[$this->text], $this->parameters);
+ }
+ return vsprintf($this->text, $this->parameters);
+ }
+}
diff --git a/lib/template.php b/lib/template.php
index a5d10c45d23..77e9332d5b3 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -326,7 +326,7 @@ class OC_Template{
* This function is internally used to sanitize HTML.
*/
private static function sanitizeHTML( &$value ){
- $value = htmlentities( $value );
+ $value = htmlentities( $value , ENT_QUOTES, 'UTF-8'); //Specify encoding for PHP<5.4
return $value;
}