Passed
Push — master ( 44a638...ee3dc5 )
by Roeland
17:20 queued 13s
created
lib/private/Security/CertificateManager.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			return [];
88 88
 		}
89 89
 
90
-		$path = $this->getPathToCertificates() . 'uploads/';
90
+		$path = $this->getPathToCertificates().'uploads/';
91 91
 		if (!$this->view->is_dir($path)) {
92 92
 			return [];
93 93
 		}
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 		while (false !== ($file = readdir($handle))) {
100 100
 			if ($file != '.' && $file != '..') {
101 101
 				try {
102
-					$result[] = new Certificate($this->view->file_get_contents($path . $file), $file);
102
+					$result[] = new Certificate($this->view->file_get_contents($path.$file), $file);
103 103
 				} catch (\Exception $e) {
104 104
 				}
105 105
 			}
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 			return false;
114 114
 		}
115 115
 
116
-		$path = $this->getPathToCertificates() . 'uploads/';
116
+		$path = $this->getPathToCertificates().'uploads/';
117 117
 		if (!$this->view->is_dir($path)) {
118 118
 			return false;
119 119
 		}
@@ -142,20 +142,20 @@  discard block
 block discarded – undo
142 142
 			$this->view->mkdir($path);
143 143
 		}
144 144
 
145
-		$defaultCertificates = file_get_contents(\OC::$SERVERROOT . '/resources/config/ca-bundle.crt');
145
+		$defaultCertificates = file_get_contents(\OC::$SERVERROOT.'/resources/config/ca-bundle.crt');
146 146
 		if (strlen($defaultCertificates) < 1024) { // sanity check to verify that we have some content for our bundle
147 147
 			// log as exception so we have a stacktrace
148 148
 			$this->logger->logException(new \Exception('Shipped ca-bundle is empty, refusing to create certificate bundle'));
149 149
 			return;
150 150
 		}
151 151
 
152
-		$certPath = $path . 'rootcerts.crt';
153
-		$tmpPath = $certPath . '.tmp' . $this->random->generate(10, ISecureRandom::CHAR_DIGITS);
152
+		$certPath = $path.'rootcerts.crt';
153
+		$tmpPath = $certPath.'.tmp'.$this->random->generate(10, ISecureRandom::CHAR_DIGITS);
154 154
 		$fhCerts = $this->view->fopen($tmpPath, 'w');
155 155
 
156 156
 		// Write user certificates
157 157
 		foreach ($certs as $cert) {
158
-			$file = $path . '/uploads/' . $cert->getName();
158
+			$file = $path.'/uploads/'.$cert->getName();
159 159
 			$data = $this->view->file_get_contents($file);
160 160
 			if (strpos($data, 'BEGIN CERTIFICATE')) {
161 161
 				fwrite($fhCerts, $data);
@@ -191,13 +191,13 @@  discard block
 block discarded – undo
191 191
 			throw new \Exception('Filename is not valid');
192 192
 		}
193 193
 
194
-		$dir = $this->getPathToCertificates() . 'uploads/';
194
+		$dir = $this->getPathToCertificates().'uploads/';
195 195
 		if (!$this->view->file_exists($dir)) {
196 196
 			$this->view->mkdir($dir);
197 197
 		}
198 198
 
199 199
 		try {
200
-			$file = $dir . $name;
200
+			$file = $dir.$name;
201 201
 			$certificateObject = new Certificate($certificate, $name);
202 202
 			$this->view->file_put_contents($file, $certificate);
203 203
 			$this->createCertificateBundle();
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
 		if (!Filesystem::isValidPath($name)) {
218 218
 			return false;
219 219
 		}
220
-		$path = $this->getPathToCertificates() . 'uploads/';
221
-		if ($this->view->file_exists($path . $name)) {
222
-			$this->view->unlink($path . $name);
220
+		$path = $this->getPathToCertificates().'uploads/';
221
+		if ($this->view->file_exists($path.$name)) {
222
+			$this->view->unlink($path.$name);
223 223
 			$this->createCertificateBundle();
224 224
 		}
225 225
 		return true;
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 	 * @return string
232 232
 	 */
233 233
 	public function getCertificateBundle(): string {
234
-		return $this->getPathToCertificates() . 'rootcerts.crt';
234
+		return $this->getPathToCertificates().'rootcerts.crt';
235 235
 	}
236 236
 
237 237
 	/**
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 	 */
242 242
 	public function getAbsoluteBundlePath(): string {
243 243
 		if (!$this->hasCertificates()) {
244
-			return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
244
+			return \OC::$SERVERROOT.'/resources/config/ca-bundle.crt';
245 245
 		}
246 246
 
247 247
 		if ($this->needsRebundling()) {
@@ -279,6 +279,6 @@  discard block
 block discarded – undo
279 279
 	 * @return int
280 280
 	 */
281 281
 	protected function getFilemtimeOfCaBundle(): int {
282
-		return filemtime(\OC::$SERVERROOT . '/resources/config/ca-bundle.crt');
282
+		return filemtime(\OC::$SERVERROOT.'/resources/config/ca-bundle.crt');
283 283
 	}
284 284
 }
Please login to merge, or discard this patch.