Completed
Push — 2.x ( 6ff22e...55a998 )
by Naoki
04:44
created
php/elFinder.class.php 1 patch
Braces   +19 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1241,8 +1241,12 @@  discard block
 block discarded – undo
1241 1241
 		
1242 1242
 		$query = $method.' '.$uri." HTTP/1.0\r\n";
1243 1243
 		$query .= "Host: ".$arr['host']."\r\n";
1244
-		if (!empty($ua)) $query .= "User-Agent: ".$ua."\r\n";
1245
-		if (!is_null($getSize)) $query .= 'Range: bytes=0-' . ($getSize - 1) . "\r\n";
1244
+		if (!empty($ua)) {
1245
+			$query .= "User-Agent: ".$ua."\r\n";
1246
+		}
1247
+		if (!is_null($getSize)) {
1248
+			$query .= 'Range: bytes=0-' . ($getSize - 1) . "\r\n";
1249
+		}
1246 1250
 		
1247 1251
 		$query .= $headers;
1248 1252
 
@@ -1257,7 +1261,9 @@  discard block
 block discarded – undo
1257 1261
 			$arr['https'].$arr['host'],
1258 1262
 			$arr['port'],
1259 1263
 			$errno,$errstr,$connect_timeout);
1260
-			if ($fp) break;
1264
+			if ($fp) {
1265
+				break;
1266
+			}
1261 1267
 			$connect_try_count++;
1262 1268
 			if (connection_aborted()) {
1263 1269
 				exit();
@@ -1574,7 +1580,9 @@  discard block
 block discarded – undo
1574 1580
 		$tempDir = '';
1575 1581
 		$test = DIRECTORY_SEPARATOR . microtime(true);
1576 1582
 		foreach($testDirs as $testDir) {
1577
-			if (!$testDir || !is_dir($testDir)) continue;
1583
+			if (!$testDir || !is_dir($testDir)) {
1584
+				continue;
1585
+			}
1578 1586
 			$testFile = $testDir.$test;
1579 1587
 			if (touch($testFile)) {
1580 1588
 				unlink($testFile);
@@ -1810,7 +1818,9 @@  discard block
 block discarded – undo
1810 1818
 				$result['warning'] = $this->error(self::ERROR_UPLOAD_FILE, $name, self::ERROR_UPLOAD_TRANSFER);
1811 1819
 				$this->uploadDebug = 'Upload error: unable open tmp file';
1812 1820
 				if (! is_uploaded_file($tmpname)) {
1813
-					if (@ unlink($tmpname)) unset($GLOBALS['elFinderTempFiles'][$tmpfname]);
1821
+					if (@ unlink($tmpname)) {
1822
+						unset($GLOBALS['elFinderTempFiles'][$tmpfname]);
1823
+					}
1814 1824
 					continue;
1815 1825
 				}
1816 1826
 				break;
@@ -1824,7 +1834,10 @@  discard block
 block discarded – undo
1824 1834
 				$result['warning'] = $this->error(self::ERROR_UPLOAD_FILE, $name, $volume->error());
1825 1835
 				fclose($fp);
1826 1836
 				if (! is_uploaded_file($tmpname)) {
1827
-					if (@ unlink($tmpname)) unset($GLOBALS['elFinderTempFiles'][$tmpname]);;
1837
+					if (@ unlink($tmpname)) {
1838
+						unset($GLOBALS['elFinderTempFiles'][$tmpname]);
1839
+					}
1840
+					;
1828 1841
 					continue;
1829 1842
 				}
1830 1843
 				break;
Please login to merge, or discard this patch.
php/elFinderConnector.class.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -212,8 +212,9 @@
 block discarded – undo
212 212
 	protected function input_filter($args) {
213 213
 		static $magic_quotes_gpc = NULL;
214 214
 		
215
-		if ($magic_quotes_gpc === NULL)
216
-			$magic_quotes_gpc = (version_compare(PHP_VERSION, '5.4', '<') && get_magic_quotes_gpc());
215
+		if ($magic_quotes_gpc === NULL) {
216
+					$magic_quotes_gpc = (version_compare(PHP_VERSION, '5.4', '<') && get_magic_quotes_gpc());
217
+		}
217 218
 		
218 219
 		if (is_array($args)) {
219 220
 			return array_map(array(& $this, 'input_filter'), $args);
Please login to merge, or discard this patch.
php/elFinderVolumeDriver.class.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -859,7 +859,9 @@  discard block
 block discarded – undo
859 859
 
860 860
 		// This get's triggered if $this->root == '/' and alias is empty.
861 861
 		// Maybe modify _basename instead?
862
-		if ($this->rootName === '') $this->rootName = $this->separator;
862
+		if ($this->rootName === '') {
863
+			$this->rootName = $this->separator;
864
+		}
863 865
 
864 866
 		$root = $this->stat($this->root);
865 867
 		
@@ -2938,7 +2940,9 @@  discard block
 block discarded – undo
2938 2940
 		if ($this->mimeDetect == 'finfo') {
2939 2941
 			if ($type = @finfo_file($this->finfo, $path)) {
2940 2942
 				if ($ext && preg_match('~^application/(?:octet-stream|(?:x-)?zip)~', $type)) {
2941
-					if (isset(elFinderVolumeDriver::$mimetypes[$ext])) $type = elFinderVolumeDriver::$mimetypes[$ext];
2943
+					if (isset(elFinderVolumeDriver::$mimetypes[$ext])) {
2944
+						$type = elFinderVolumeDriver::$mimetypes[$ext];
2945
+					}
2942 2946
 				} else if ($ext === 'js' && preg_match('~^text/~', $type)) {
2943 2947
 					$type = 'text/javascript';
2944 2948
 				}
@@ -4013,7 +4017,7 @@  discard block
 block discarded – undo
4013 4017
 			imagesavealpha($image,true);
4014 4018
 			$bgcolor1 = imagecolorallocatealpha($image, 255, 255, 255, 127);
4015 4019
 
4016
-		}else{
4020
+		} else{
4017 4021
 			list($r, $g, $b) = sscanf($bgcolor, "#%02x%02x%02x");
4018 4022
 			$bgcolor1 = imagecolorallocate($image, $r, $g, $b);
4019 4023
 		}
@@ -4203,7 +4207,9 @@  discard block
 block discarded – undo
4203 4207
 		}
4204 4208
 		
4205 4209
 		// 'Here'
4206
-		if ($path === '' || $path === '.' . $separator) return $base;
4210
+		if ($path === '' || $path === '.' . $separator) {
4211
+			return $base;
4212
+		}
4207 4213
 		
4208 4214
 		// Absolute path
4209 4215
 		if ($path[0] === $separator || strpos($path, $systemroot) === 0) {
Please login to merge, or discard this patch.
php/elFinderVolumeDropbox.class.php 1 patch
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -132,8 +132,12 @@  discard block
 block discarded – undo
132 132
 	 * @author Naoki Sawada
133 133
 	 **/
134 134
 	public function netmountPrepare($options) {
135
-		if (empty($options['consumerKey']) && defined('ELFINDER_DROPBOX_CONSUMERKEY')) $options['consumerKey'] = ELFINDER_DROPBOX_CONSUMERKEY;
136
-		if (empty($options['consumerSecret']) && defined('ELFINDER_DROPBOX_CONSUMERSECRET')) $options['consumerSecret'] = ELFINDER_DROPBOX_CONSUMERSECRET;
135
+		if (empty($options['consumerKey']) && defined('ELFINDER_DROPBOX_CONSUMERKEY')) {
136
+			$options['consumerKey'] = ELFINDER_DROPBOX_CONSUMERKEY;
137
+		}
138
+		if (empty($options['consumerSecret']) && defined('ELFINDER_DROPBOX_CONSUMERSECRET')) {
139
+			$options['consumerSecret'] = ELFINDER_DROPBOX_CONSUMERSECRET;
140
+		}
137 141
 		
138 142
 		if ($options['user'] === 'init') {
139 143
 
@@ -616,8 +620,12 @@  discard block
 block discarded – undo
616 620
 		} else {
617 621
 			$stat['url'] = '1';
618 622
 		}
619
-		if (isset($raw['width'])) $stat['width'] = $raw['width'];
620
-		if (isset($raw['height'])) $stat['height'] = $raw['height'];
623
+		if (isset($raw['width'])) {
624
+			$stat['width'] = $raw['width'];
625
+		}
626
+		if (isset($raw['height'])) {
627
+			$stat['height'] = $raw['height'];
628
+		}
621 629
 		
622 630
 		return $stat;
623 631
 	}
@@ -1061,7 +1069,9 @@  discard block
 block discarded – undo
1061 1069
 	 * @author Dmitry (dio) Levashov
1062 1070
 	 **/
1063 1071
 	protected function _dimensions($path, $mime) {
1064
-		if (strpos($mime, 'image') !== 0) return '';
1072
+		if (strpos($mime, 'image') !== 0) {
1073
+			return '';
1074
+		}
1065 1075
 		$cache = $this->getDBdat($path);
1066 1076
 		if (isset($cache['width']) && isset($cache['height'])) {
1067 1077
 			return $cache['width'].'x'.$cache['height'];
@@ -1281,7 +1291,9 @@  discard block
 block discarded – undo
1281 1291
 	 * @author Dmitry (dio) Levashov
1282 1292
 	 **/
1283 1293
 	protected function _save($fp, $path, $name, $stat) {
1284
-		if ($name) $path .= '/'.$name;
1294
+		if ($name) {
1295
+			$path .= '/'.$name;
1296
+		}
1285 1297
 		$path = $this->_normpath($path);
1286 1298
 		try {
1287 1299
 			$this->dropbox->putFile($path, $fp);
@@ -1291,8 +1303,12 @@  discard block
 block discarded – undo
1291 1303
 		$this->deltaCheck();
1292 1304
 		if (is_array($stat)) {
1293 1305
 			$raw = $this->getDBdat($path);
1294
-			if (isset($stat['width'])) $raw['width'] = $stat['width'];
1295
-			if (isset($stat['height'])) $raw['height'] = $stat['height'];
1306
+			if (isset($stat['width'])) {
1307
+				$raw['width'] = $stat['width'];
1308
+			}
1309
+			if (isset($stat['height'])) {
1310
+				$raw['height'] = $stat['height'];
1311
+			}
1296 1312
 			$this->updateDBdat($path, $raw);
1297 1313
 		}
1298 1314
 		return $path;
Please login to merge, or discard this patch.
php/elFinderVolumeS3.class.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -386,7 +386,7 @@
 block discarded – undo
386 386
 
387 387
 			try {
388 388
 				$obj = $this->s3->GetObject(array('Bucket' => $this->options['bucket'], 'Key' => $this->_normpath($path) , 'GetMetadata' => true, 'InlineData' => true, 'GetData' => true));
389
-			}	catch (Exception $e) {
389
+			} catch (Exception $e) {
390 390
 		
391 391
 			}
392 392
 				
Please login to merge, or discard this patch.
php/plugins/Normalizer/plugin.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -104,20 +104,24 @@
 block discarded – undo
104 104
 	private function normalize($str, $opts) {
105 105
 		if ($opts['nfc'] || $opts['nfkc']) {
106 106
 			if (class_exists('Normalizer')) {
107
-				if ($opts['nfc'] && ! Normalizer::isNormalized($str, Normalizer::FORM_C))
108
-					$str = Normalizer::normalize($str, Normalizer::FORM_C);
109
-				if ($opts['nfkc'] && ! Normalizer::isNormalized($str, Normalizer::FORM_KC))
110
-					$str = Normalizer::normalize($str, Normalizer::FORM_KC);
107
+				if ($opts['nfc'] && ! Normalizer::isNormalized($str, Normalizer::FORM_C)) {
108
+									$str = Normalizer::normalize($str, Normalizer::FORM_C);
109
+				}
110
+				if ($opts['nfkc'] && ! Normalizer::isNormalized($str, Normalizer::FORM_KC)) {
111
+									$str = Normalizer::normalize($str, Normalizer::FORM_KC);
112
+				}
111 113
 			} else {
112 114
 				if (! class_exists('I18N_UnicodeNormalizer')) {
113 115
 					@ include_once 'I18N/UnicodeNormalizer.php';
114 116
 				}
115 117
 				if (class_exists('I18N_UnicodeNormalizer')) {
116 118
 					$normalizer = new I18N_UnicodeNormalizer();
117
-					if ($opts['nfc'])
118
-						$str = $normalizer->normalize($str, 'NFC');
119
-					if ($opts['nfkc'])
120
-						$str = $normalizer->normalize($str, 'NFKC');
119
+					if ($opts['nfc']) {
120
+											$str = $normalizer->normalize($str, 'NFC');
121
+					}
122
+					if ($opts['nfkc']) {
123
+											$str = $normalizer->normalize($str, 'NFKC');
124
+					}
121 125
 				}
122 126
 			}
123 127
 		}
Please login to merge, or discard this patch.