From ffae6f4b847e96d691053300c355ab81edc6c1c8 Mon Sep 17 00:00:00 2001
From: Bart Visscher <bartv@thisnet.nl>
Date: Mon, 11 Feb 2013 17:44:02 +0100
Subject: Style-fix: Breakup long lines

---
 lib/template.php | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

(limited to 'lib/template.php')

diff --git a/lib/template.php b/lib/template.php
index fb9f7ad62d9..0230d2f9343 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -192,7 +192,13 @@ class OC_Template{
 
 		// Content Security Policy
 		// If you change the standard policy, please also change it in config.sample.php
-		$policy = OC_Config::getValue('custom_csp_policy',  'default-src \'self\'; script-src \'self\' \'unsafe-eval\'; style-src \'self\' \'unsafe-inline\'; frame-src *; img-src *; font-src \'self\' data:');
+		$policy = OC_Config::getValue('custom_csp_policy',
+			'default-src \'self\'; '
+			.'script-src \'self\' \'unsafe-eval\'; '
+			.'style-src \'self\' \'unsafe-inline\'; '
+			.'frame-src *; '
+			.'img-src *; '
+			.'font-src \'self\' data:');
 		header('Content-Security-Policy:'.$policy); // Standard
 		header('X-WebKit-CSP:'.$policy); // Older webkit browsers
 
@@ -215,7 +221,8 @@ class OC_Template{
 				$mode='tablet';
 			}elseif(stripos($_SERVER['HTTP_USER_AGENT'], 'iphone')>0) {
 				$mode='mobile';
-			}elseif((stripos($_SERVER['HTTP_USER_AGENT'], 'N9')>0) and (stripos($_SERVER['HTTP_USER_AGENT'], 'nokia')>0)) {
+			}elseif((stripos($_SERVER['HTTP_USER_AGENT'], 'N9')>0)
+				and (stripos($_SERVER['HTTP_USER_AGENT'], 'nokia')>0)) {
 				$mode='mobile';
 			}else{
 				$mode='default';
@@ -285,7 +292,8 @@ class OC_Template{
 				if ($this->checkPathForTemplate(OC::$SERVERROOT."/themes/$theme/$app/templates/", $name, $fext)) {
 				}elseif ($this->checkPathForTemplate(OC::$SERVERROOT."/$app/templates/", $name, $fext)) {
 				}else{
-					echo('template not found: template:'.$name.' formfactor:'.$fext.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT);
+					echo('template not found: template:'.$name.' formfactor:'.$fext
+						.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT);
 					die();
 				}
 
@@ -295,7 +303,8 @@ class OC_Template{
 			if ($this->checkPathForTemplate(OC::$SERVERROOT."/themes/$theme/core/templates/", $name, $fext)) {
 			} elseif ($this->checkPathForTemplate(OC::$SERVERROOT."/core/templates/", $name, $fext)) {
 			}else{
-				echo('template not found: template:'.$name.' formfactor:'.$fext.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT);
+				echo('template not found: template:'.$name.' formfactor:'.$fext
+					.' webroot:'.OC::$WEBROOT.' serverroot:'.OC::$SERVERROOT);
 				die();
 			}
 		}
-- 
cgit v1.2.3


From b8e2454f68f745141ff4d302413f28e3f03e95e4 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Fri, 15 Feb 2013 16:10:06 +0100
Subject: Fix strict standard warning in user template

---
 core/templates/layout.user.php | 2 +-
 lib/template.php               | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

(limited to 'lib/template.php')

diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 0d2a9f5d34a..2d00bdb5c8e 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -31,7 +31,7 @@
 
 			<ul id="settings" class="svg">
 				<span id="expand">
-					<?php echo OCP\User::getDisplayName($user=null)?OC_Util::sanitizeHTML(OCP\User::getDisplayName($user=null)):(OC_User::getUser()?OC_User::getUser():'') ?>
+					<?php echo $_['displayname'] ?>
 					<img class="svg" src="<?php echo image_path('', 'actions/caret.svg'); ?>" />
 				</span>
 				<div id="expanddiv">
diff --git a/lib/template.php b/lib/template.php
index 0230d2f9343..3df5a24f946 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -415,6 +415,8 @@ class OC_Template{
 			$page = new OC_TemplateLayout($this->renderas);
 			if($this->renderas == 'user') {
 				$page->assign('requesttoken', $this->vars['requesttoken']);
+				$user = OC_User::getUser();
+				$page->assign('displayname', OCP\User::getDisplayName($user));
 			}
 
 			// Add custom headers
-- 
cgit v1.2.3