Completed
Pull Request — stable9 (#4226)
by Lukas
11:11
created
settings/help.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -31,28 +31,28 @@
 block discarded – undo
31 31
 OC_Util::checkLoggedIn();
32 32
 
33 33
 // Load the files we need
34
-OC_Util::addStyle( "settings", "settings" );
34
+OC_Util::addStyle("settings", "settings");
35 35
 \OC::$server->getNavigationManager()->setActiveEntry('help');
36 36
 
37 37
 
38
-if(isset($_GET['mode']) and $_GET['mode'] === 'admin') {
39
-	$url=\OCP\Util::linkToAbsolute( 'core', 'doc/admin/index.html' );
40
-	$style1='';
41
-	$style2=' active';
42
-}else{
43
-	$url=\OCP\Util::linkToAbsolute( 'core', 'doc/user/index.html' );
44
-	$style1=' active';
45
-	$style2='';
38
+if (isset($_GET['mode']) and $_GET['mode'] === 'admin') {
39
+	$url = \OCP\Util::linkToAbsolute('core', 'doc/admin/index.html');
40
+	$style1 = '';
41
+	$style2 = ' active';
42
+} else {
43
+	$url = \OCP\Util::linkToAbsolute('core', 'doc/user/index.html');
44
+	$style1 = ' active';
45
+	$style2 = '';
46 46
 }
47 47
 
48
-$url1=\OC::$server->getURLGenerator()->linkToRoute('settings_help').'?mode=user';
49
-$url2=\OC::$server->getURLGenerator()->linkToRoute('settings_help').'?mode=admin';
48
+$url1 = \OC::$server->getURLGenerator()->linkToRoute('settings_help').'?mode=user';
49
+$url2 = \OC::$server->getURLGenerator()->linkToRoute('settings_help').'?mode=admin';
50 50
 
51
-$tmpl = new OC_Template( "settings", "help", "user" );
52
-$tmpl->assign( "admin", OC_User::isAdminUser(OC_User::getUser()));
53
-$tmpl->assign( "url", $url );
54
-$tmpl->assign( "url1", $url1 );
55
-$tmpl->assign( "url2", $url2 );
56
-$tmpl->assign( "style1", $style1 );
57
-$tmpl->assign( "style2", $style2 );
51
+$tmpl = new OC_Template("settings", "help", "user");
52
+$tmpl->assign("admin", OC_User::isAdminUser(OC_User::getUser()));
53
+$tmpl->assign("url", $url);
54
+$tmpl->assign("url1", $url1);
55
+$tmpl->assign("url2", $url2);
56
+$tmpl->assign("style1", $style1);
57
+$tmpl->assign("style2", $style2);
58 58
 $tmpl->printPage();
Please login to merge, or discard this patch.
apps/files_external/templates/list.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 		<tr>
18 18
 			<th id='headerName' class="hidden column-name">
19 19
 				<div id="headerName-container">
20
-					<a class="name sort columntitle" data-sort="name"><span><?php p($l->t( 'Name' )); ?></span><span class="sort-indicator"></span></a>
20
+					<a class="name sort columntitle" data-sort="name"><span><?php p($l->t('Name')); ?></span><span class="sort-indicator"></span></a>
21 21
 				</div>
22 22
 			</th>
23 23
 			<th id="headerBackend" class="hidden column-backend">
Please login to merge, or discard this patch.
apps/files_sharing/ajax/publicpreview.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 $token = array_key_exists('t', $_GET) ? (string) $_GET['t'] : '';
37 37
 $keepAspect = array_key_exists('a', $_GET) ? true : false;
38 38
 
39
-if($token === ''){
39
+if ($token === '') {
40 40
 	\OC_Response::setStatus(\OC_Response::STATUS_BAD_REQUEST);
41 41
 	\OCP\Util::writeLog('core-preview', 'No token parameter was passed', \OCP\Util::DEBUG);
42 42
 	exit;
@@ -45,20 +45,20 @@  discard block
 block discarded – undo
45 45
 $linkedItem = \OCP\Share::getShareByToken($token);
46 46
 $shareManager = \OC::$server->getShareManager();
47 47
 $share = $shareManager->getShareByToken($token);
48
-if(!($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) {
48
+if (!($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) {
49 49
 	OCP\JSON::error(array('data' => 'Share is not readable.'));
50 50
 	exit();
51 51
 }
52 52
 
53
-if($linkedItem === false || ($linkedItem['item_type'] !== 'file' && $linkedItem['item_type'] !== 'folder')) {
53
+if ($linkedItem === false || ($linkedItem['item_type'] !== 'file' && $linkedItem['item_type'] !== 'folder')) {
54 54
 	\OC_Response::setStatus(\OC_Response::STATUS_NOT_FOUND);
55 55
 	\OCP\Util::writeLog('core-preview', 'Passed token parameter is not valid', \OCP\Util::DEBUG);
56 56
 	exit;
57 57
 }
58 58
 
59
-if(!isset($linkedItem['uid_owner']) || !isset($linkedItem['file_source'])) {
59
+if (!isset($linkedItem['uid_owner']) || !isset($linkedItem['file_source'])) {
60 60
 	\OC_Response::setStatus(\OC_Response::STATUS_INTERNAL_SERVER_ERROR);
61
-	\OCP\Util::writeLog('core-preview', 'Passed token seems to be valid, but it does not contain all necessary information . ("' . $token . '")', \OCP\Util::WARN);
61
+	\OCP\Util::writeLog('core-preview', 'Passed token seems to be valid, but it does not contain all necessary information . ("'.$token.'")', \OCP\Util::WARN);
62 62
 	exit;
63 63
 }
64 64
 
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
 OCP\JSON::checkUserExists($rootLinkItem['uid_owner']);
69 69
 \OC_Util::setupFS($userId);
70 70
 \OC\Files\Filesystem::initMountPoints($userId);
71
-$view = new \OC\Files\View('/' . $userId . '/files');
71
+$view = new \OC\Files\View('/'.$userId.'/files');
72 72
 
73 73
 $pathId = $linkedItem['file_source'];
74 74
 $path = $view->getPath($pathId);
75 75
 
76
-if($path === null) {
76
+if ($path === null) {
77 77
 	\OC_Response::setStatus(\OC_Response::STATUS_NOT_FOUND);
78 78
 	\OCP\Util::writeLog('core-preview', 'Could not resolve file for shared item', \OCP\Util::WARN);
79 79
 	exit;
@@ -82,36 +82,36 @@  discard block
 block discarded – undo
82 82
 $pathInfo = $view->getFileInfo($path);
83 83
 $sharedFile = null;
84 84
 
85
-if($linkedItem['item_type'] === 'folder') {
85
+if ($linkedItem['item_type'] === 'folder') {
86 86
 	$isValid = \OC\Files\Filesystem::isValidPath($file);
87
-	if(!$isValid) {
87
+	if (!$isValid) {
88 88
 		\OC_Response::setStatus(\OC_Response::STATUS_BAD_REQUEST);
89
-		\OCP\Util::writeLog('core-preview', 'Passed filename is not valid, might be malicious (file:"' . $file . '";ip:"' . \OC::$server->getRequest()->getRemoteAddress() . '")', \OCP\Util::WARN);
89
+		\OCP\Util::writeLog('core-preview', 'Passed filename is not valid, might be malicious (file:"'.$file.'";ip:"'.\OC::$server->getRequest()->getRemoteAddress().'")', \OCP\Util::WARN);
90 90
 		exit;
91 91
 	}
92 92
 	$sharedFile = \OC\Files\Filesystem::normalizePath($file);
93 93
 }
94 94
 
95
-if($linkedItem['item_type'] === 'file') {
95
+if ($linkedItem['item_type'] === 'file') {
96 96
 	$parent = $pathInfo['parent'];
97 97
 	$path = $view->getPath($parent);
98 98
 	$sharedFile = $pathInfo['name'];
99 99
 }
100 100
 
101 101
 $path = \OC\Files\Filesystem::normalizePath($path, false);
102
-if(substr($path, 0, 1) === '/') {
102
+if (substr($path, 0, 1) === '/') {
103 103
 	$path = substr($path, 1);
104 104
 }
105 105
 
106
-if($maxX === 0 || $maxY === 0) {
106
+if ($maxX === 0 || $maxY === 0) {
107 107
 	\OC_Response::setStatus(\OC_Response::STATUS_BAD_REQUEST);
108 108
 	\OCP\Util::writeLog('core-preview', 'x and/or y set to 0', \OCP\Util::DEBUG);
109 109
 	exit;
110 110
 }
111 111
 
112
-$root = 'files/' . $path;
112
+$root = 'files/'.$path;
113 113
 
114
-try{
114
+try {
115 115
 	$preview = new \OC\Preview($userId, $root);
116 116
 	$preview->setFile($sharedFile);
117 117
 	$preview->setMaxX($maxX);
Please login to merge, or discard this patch.
apps/files_sharing/lib/share/file.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	public function generateTarget($filePath, $shareWith, $exclude = null) {
98 98
 		$shareFolder = \OCA\Files_Sharing\Helper::getShareFolder();
99
-		$target = \OC\Files\Filesystem::normalizePath($shareFolder . '/' . basename($filePath));
99
+		$target = \OC\Files\Filesystem::normalizePath($shareFolder.'/'.basename($filePath));
100 100
 
101 101
 		// for group shares we return the target right away
102 102
 		if ($shareWith === false) {
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
 		}
105 105
 
106 106
 		\OC\Files\Filesystem::initMountPoints($shareWith);
107
-		$view = new \OC\Files\View('/' . $shareWith . '/files');
107
+		$view = new \OC\Files\View('/'.$shareWith.'/files');
108 108
 
109 109
 		if (!$view->is_dir($shareFolder)) {
110 110
 			$dir = '';
111 111
 			$subdirs = explode('/', $shareFolder);
112 112
 			foreach ($subdirs as $subdir) {
113
-				$dir = $dir . '/' . $subdir;
113
+				$dir = $dir.'/'.$subdir;
114 114
 				if (!$view->is_dir($dir)) {
115 115
 					$view->mkdir($dir);
116 116
 				}
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 		if ($share['item_type'] === 'folder' && $target !== '') {
238 238
 			// note: in case of ext storage mount points the path might be empty
239 239
 			// which would cause a leading slash to appear
240
-			$share['path'] = ltrim($share['path'] . '/' . $target, '/');
240
+			$share['path'] = ltrim($share['path'].'/'.$target, '/');
241 241
 		}
242 242
 		return self::resolveReshares($share);
243 243
 	}
Please login to merge, or discard this patch.
apps/files_sharing/appinfo/routes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 /** @var $this \OCP\Route\IRouter */
46 46
 $this->create('core_ajax_public_preview', '/publicpreview')->action(
47 47
 	function() {
48
-		require_once __DIR__ . '/../ajax/publicpreview.php';
48
+		require_once __DIR__.'/../ajax/publicpreview.php';
49 49
 	});
50 50
 
51 51
 $this->create('files_sharing_ajax_list', 'ajax/list.php')
Please login to merge, or discard this patch.
apps/dav/templates/exception.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	<ul>
16 16
 		<li><?php p($l->t('Remote Address: %s', $_['remoteAddr'])) ?></li>
17 17
 		<li><?php p($l->t('Request ID: %s', $_['requestID'])) ?></li>
18
-		<?php if($_['debugMode']): ?>
18
+		<?php if ($_['debugMode']): ?>
19 19
 			<li><?php p($l->t('Type: %s', $_['errorClass'])) ?></li>
20 20
 			<li><?php p($l->t('Code: %s', $_['errorCode'])) ?></li>
21 21
 			<li><?php p($l->t('Message: %s', $_['errorMsg'])) ?></li>
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 		<?php endif; ?>
25 25
 	</ul>
26 26
 
27
-	<?php if($_['debugMode']): ?>
27
+	<?php if ($_['debugMode']): ?>
28 28
 		<br />
29 29
 		<h2><strong><?php p($l->t('Trace')) ?></strong></h2>
30 30
 		<pre><?php p($_['trace']) ?></pre>
Please login to merge, or discard this patch.
apps/files/ajax/upload.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -50,14 +50,14 @@  discard block
 block discarded – undo
50 50
 if (empty($_POST['dirToken'])) {
51 51
 	// The standard case, files are uploaded through logged in users :)
52 52
 	OCP\JSON::checkLoggedIn();
53
-	$dir = isset($_POST['dir']) ? (string)$_POST['dir'] : '';
53
+	$dir = isset($_POST['dir']) ? (string) $_POST['dir'] : '';
54 54
 	if (!$dir || empty($dir) || $dir === false) {
55 55
 		OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Unable to set upload directory.')))));
56 56
 		die();
57 57
 	}
58 58
 } else {
59 59
 	$shareManager = \OC::$server->getShareManager();
60
-	$share = $shareManager->getShareByToken((string)$_POST['dirToken']);
60
+	$share = $shareManager->getShareByToken((string) $_POST['dirToken']);
61 61
 
62 62
 	// TODO: ideally this code should be in files_sharing/ajax/upload.php
63 63
 	// and the upload/file transfer code needs to be refactored into a utility method
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
 	// If it is a write-only folder no subdirectory can be specified
69 69
 	$publicDirectory = '';
70 70
 	if ($share->getPermissions() & \OCP\Constants::PERMISSION_READ) {
71
-		$publicDirectory = !empty($_POST['subdir']) ? (string)$_POST['subdir'] : '/';
71
+		$publicDirectory = !empty($_POST['subdir']) ? (string) $_POST['subdir'] : '/';
72 72
 	} else {
73 73
 		$_POST['file_directory'] = '';
74 74
 	}
75 75
 
76
-	$linkItem = OCP\Share::getShareByToken((string)$_POST['dirToken']);
76
+	$linkItem = OCP\Share::getShareByToken((string) $_POST['dirToken']);
77 77
 	if ($linkItem === false) {
78 78
 		OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Invalid Token')))));
79 79
 		die();
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
 		// The token defines the target directory (security reasons)
94 94
 		$path = \OC\Files\Filesystem::getPath($linkItem['file_source']);
95
-		if($path === null) {
95
+		if ($path === null) {
96 96
 			OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Unable to set upload directory.')))));
97 97
 			die();
98 98
 		}
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 			$resolution = null;
173 173
 		}
174 174
 
175
-		if(isset($_POST['dirToken'])) {
175
+		if (isset($_POST['dirToken'])) {
176 176
 			// If it is a read only share the resolution will always be autorename
177 177
 			if (!($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) {
178 178
 				$resolution = 'autorename';
@@ -181,25 +181,25 @@  discard block
 block discarded – undo
181 181
 
182 182
 		// target directory for when uploading folders
183 183
 		$relativePath = '';
184
-		if(!empty($_POST['file_directory'])) {
184
+		if (!empty($_POST['file_directory'])) {
185 185
 			$relativePath = '/'.$_POST['file_directory'];
186 186
 		}
187 187
 
188 188
 		// $path needs to be normalized - this failed within drag'n'drop upload to a sub-folder
189 189
 		if ($resolution === 'autorename') {
190 190
 			// append a number in brackets like 'filename (2).ext'
191
-			$target = OCP\Files::buildNotExistingFileName($dir . $relativePath, $files['name'][$i]);
191
+			$target = OCP\Files::buildNotExistingFileName($dir.$relativePath, $files['name'][$i]);
192 192
 		} else {
193
-			$target = \OC\Files\Filesystem::normalizePath($dir . $relativePath.'/'.$files['name'][$i]);
193
+			$target = \OC\Files\Filesystem::normalizePath($dir.$relativePath.'/'.$files['name'][$i]);
194 194
 		}
195 195
 
196 196
 		// relative dir to return to the client
197 197
 		if (isset($publicDirectory)) {
198 198
 			// path relative to the public root
199
-			$returnedDir = $publicDirectory . $relativePath;
199
+			$returnedDir = $publicDirectory.$relativePath;
200 200
 		} else {
201 201
 			// full path
202
-			$returnedDir = $dir . $relativePath;
202
+			$returnedDir = $dir.$relativePath;
203 203
 		}
204 204
 		$returnedDir = \OC\Files\Filesystem::normalizePath($returnedDir);
205 205
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 		if ($exists) {
209 209
 			$updatable = \OC\Files\Filesystem::isUpdatable($target);
210 210
 		}
211
-		if ( ! $exists || ($updatable && $resolution === 'replace' ) ) {
211
+		if (!$exists || ($updatable && $resolution === 'replace')) {
212 212
 			// upload and overwrite file
213 213
 			try
214 214
 			{
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 					$error = $l->t('Upload failed. Could not find uploaded file');
237 237
 					$errorFileName = $files['name'][$i];
238 238
 				}
239
-			} catch(Exception $ex) {
239
+			} catch (Exception $ex) {
240 240
 				$error = $ex->getMessage();
241 241
 			}
242 242
 
@@ -267,12 +267,12 @@  discard block
 block discarded – undo
267 267
 
268 268
 if ($error === false) {
269 269
 	// Do not leak file information if it is a read-only share
270
-	if(isset($_POST['dirToken'])) {
270
+	if (isset($_POST['dirToken'])) {
271 271
 		$shareManager = \OC::$server->getShareManager();
272
-		$share = $shareManager->getShareByToken((string)$_POST['dirToken']);
272
+		$share = $shareManager->getShareByToken((string) $_POST['dirToken']);
273 273
 		if (!($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) {
274 274
 			$newResults = [];
275
-			foreach($result as $singleResult) {
275
+			foreach ($result as $singleResult) {
276 276
 				$fileName = $singleResult['originalname'];
277 277
 				$newResults['filename'] = $fileName;
278 278
 				$newResults['mimetype'] = \OC::$server->getMimeTypeDetector()->detectPath($fileName);
Please login to merge, or discard this patch.
apps/files/list.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 $config = \OC::$server->getConfig();
25 25
 // TODO: move this to the generated config.js
26 26
 $publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes');
27
-$uploadLimit=OCP\Util::uploadLimit();
27
+$uploadLimit = OCP\Util::uploadLimit();
28 28
 
29 29
 // renders the controls and table headers template
30 30
 $tmpl = new OCP\Template('files', 'list', '');
Please login to merge, or discard this patch.
apps/encryption/templates/mail.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 	<tr><td>
7 7
 			<table cellspacing="0" cellpadding="0" border="0" width="600px">
8 8
 				<tr>
9
-					<td bgcolor="<?php p($theme->getMailHeaderColor());?>" width="20px">&nbsp;</td>
10
-					<td bgcolor="<?php p($theme->getMailHeaderColor());?>">
9
+					<td bgcolor="<?php p($theme->getMailHeaderColor()); ?>" width="20px">&nbsp;</td>
10
+					<td bgcolor="<?php p($theme->getMailHeaderColor()); ?>">
11 11
 						<img src="<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL(image_path('', 'logo-mail.gif'))); ?>" alt="<?php p($theme->getName()); ?>"/>
12 12
 					</td>
13 13
 				</tr>
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 					<td style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">--<br>
29 29
 						<?php p($theme->getName()); ?> -
30 30
 						<?php p($theme->getSlogan()); ?>
31
-						<br><a href="<?php p($theme->getBaseUrl()); ?>"><?php p($theme->getBaseUrl());?></a>
31
+						<br><a href="<?php p($theme->getBaseUrl()); ?>"><?php p($theme->getBaseUrl()); ?></a>
32 32
 					</td>
33 33
 				</tr>
34 34
 				<tr>
Please login to merge, or discard this patch.