Completed
Push — 2.x ( a54408...e18f53 )
by Naoki
03:17
created
php/plugins/Sanitizer/plugin.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 	
50 50
 	public function __construct($opts) {
51 51
 		$defaults = array(
52
-			'enable'   => true,  // For control by volume driver
53
-			'targets'  => array('\\','/',':','*','?','"','<','>','|'), // target chars
52
+			'enable'   => true, // For control by volume driver
53
+			'targets'  => array('\\', '/', ':', '*', '?', '"', '<', '>', '|'), // target chars
54 54
 			'replace'  => '_'    // replace to this
55 55
 		);
56 56
 	
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	
60 60
 	public function cmdPreprocess($cmd, &$args, $elfinder, $volume) {
61 61
 		$opts = $this->getOpts($volume);
62
-		if (! $opts['enable']) {
62
+		if (!$opts['enable']) {
63 63
 			return false;
64 64
 		}
65 65
 	
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
 	public function onUpLoadPreSave(&$path, &$name, $src, $elfinder, $volume) {
73 73
 		$opts = $this->getOpts($volume);
74
-		if (! $opts['enable']) {
74
+		if (!$opts['enable']) {
75 75
 			return false;
76 76
 		}
77 77
 	
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	}
95 95
 	
96 96
 	private function sanitizeFileName($filename, $opts, $allows = array()) {
97
-		$targets = $allows? array_diff($opts['targets'], $allows) : $opts['targets'];
97
+		$targets = $allows ? array_diff($opts['targets'], $allows) : $opts['targets'];
98 98
 		return str_replace($targets, $opts['replace'], $filename);
99 99
   	}
100 100
 }
Please login to merge, or discard this patch.
php/plugins/Watermark/plugin.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function __construct($opts) {
59 59
 		$defaults = array(
60
-			'enable'         => true,       // For control by volume driver
60
+			'enable'         => true, // For control by volume driver
61 61
 			'source'         => 'logo.png', // Path to Water mark image
62
-			'marginRight'    => 5,          // Margin right pixel
63
-			'marginBottom'   => 5,          // Margin bottom pixel
64
-			'quality'        => 95,         // JPEG image save quality
65
-			'transparency'   => 70,         // Water mark image transparency ( other than PNG )
66
-			'targetType'     => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP, // Target image formats ( bit-field )
62
+			'marginRight'    => 5, // Margin right pixel
63
+			'marginBottom'   => 5, // Margin bottom pixel
64
+			'quality'        => 95, // JPEG image save quality
65
+			'transparency'   => 70, // Water mark image transparency ( other than PNG )
66
+			'targetType'     => IMG_GIF | IMG_JPG | IMG_PNG | IMG_WBMP, // Target image formats ( bit-field )
67 67
 			'targetMinPixel' => 200         // Target image minimum pixel size
68 68
 		);
69 69
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 			$opts = array_merge($this->opts, $volOpts);
80 80
 		}
81 81
 		
82
-		if (! $opts['enable']) {
82
+		if (!$opts['enable']) {
83 83
 			return false;
84 84
 		}
85 85
 		
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
 		}
95 95
 		
96 96
 		// check water mark image
97
-		if (! file_exists($opts['source'])) {
98
-			$opts['source'] = dirname(__FILE__) . "/" . $opts['source'];
97
+		if (!file_exists($opts['source'])) {
98
+			$opts['source'] = dirname(__FILE__)."/".$opts['source'];
99 99
 		}
100 100
 		if (is_readable($opts['source'])) {
101 101
 			$watermarkImgInfo = @getimagesize($opts['source']);
102
-			if (! $watermarkImgInfo) {
102
+			if (!$watermarkImgInfo) {
103 103
 				return false;
104 104
 			}
105 105
 		} else {
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 			IMAGETYPE_PNG => IMG_PNG,
120 120
 			IMAGETYPE_WBMP => IMG_WBMP,
121 121
 		);
122
-		if (! ($opts['targetType'] & $imgTypes[$srcImgInfo[2]])) {
122
+		if (!($opts['targetType'] & $imgTypes[$srcImgInfo[2]])) {
123 123
 			return false;
124 124
 		}
125 125
 		
@@ -192,14 +192,14 @@  discard block
 block discarded – undo
192 192
 				break;
193 193
 			case 'image/jpeg':
194 194
 				if (@imagetypes() & IMG_JPG) {
195
-					$oWatermarkImg = @imagecreatefromjpeg($watermark) ;
195
+					$oWatermarkImg = @imagecreatefromjpeg($watermark);
196 196
 				} else {
197 197
 					$ermsg = 'JPEG images are not supported';
198 198
 				}
199 199
 				break;
200 200
 			case 'image/png':
201 201
 				if (@imagetypes() & IMG_PNG) {
202
-					$oWatermarkImg = @imagecreatefrompng($watermark) ;
202
+					$oWatermarkImg = @imagecreatefrompng($watermark);
203 203
 				} else {
204 204
 					$ermsg = 'PNG images are not supported';
205 205
 				}
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 				break;
218 218
 		}
219 219
 		
220
-		if (! $ermsg) {
220
+		if (!$ermsg) {
221 221
 			switch ($srcImgInfo['mime']) {
222 222
 				case 'image/gif':
223 223
 					if (@imagetypes() & IMG_GIF) {
@@ -228,14 +228,14 @@  discard block
 block discarded – undo
228 228
 					break;
229 229
 				case 'image/jpeg':
230 230
 					if (@imagetypes() & IMG_JPG) {
231
-						$oSrcImg = @imagecreatefromjpeg($src) ;
231
+						$oSrcImg = @imagecreatefromjpeg($src);
232 232
 					} else {
233 233
 						$ermsg = 'JPEG images are not supported';
234 234
 					}
235 235
 					break;
236 236
 				case 'image/png':
237 237
 					if (@imagetypes() & IMG_PNG) {
238
-						$oSrcImg = @imagecreatefrompng($src) ;
238
+						$oSrcImg = @imagecreatefrompng($src);
239 239
 					} else {
240 240
 						$ermsg = 'PNG images are not supported';
241 241
 					}
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 		if ($srcImgInfo['mime'] === 'image/png') {
262 262
 			if (function_exists('imagecolorallocatealpha')) {
263 263
 				$bg = imagecolorallocatealpha($oSrcImg, 255, 255, 255, 127);
264
-				imagefill($oSrcImg, 0, 0 , $bg);
264
+				imagefill($oSrcImg, 0, 0, $bg);
265 265
 			}
266 266
 		}
267 267
 		
Please login to merge, or discard this patch.
php/plugins/Normalizer/plugin.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 		$defaults = array(
59 59
 			'enable' => true, // For control by volume driver
60 60
 			'nfc'    => true, // Canonical Decomposition followed by Canonical Composition
61
-			'nfkc'   => true,  // Compatibility Decomposition followed by Canonical
61
+			'nfkc'   => true, // Compatibility Decomposition followed by Canonical
62 62
 			'lowercase'   => false  // Make chars lowercase
63 63
 		);
64 64
 	
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	
68 68
 	public function cmdPreprocess($cmd, &$args, $elfinder, $volume) {
69 69
 		$opts = $this->getOpts($volume);
70
-		if (! $opts['enable']) {
70
+		if (!$opts['enable']) {
71 71
 			return false;
72 72
 		}
73 73
 		
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	
80 80
 	public function onUpLoadPreSave(&$path, &$name, $src, $elfinder, $volume) {
81 81
 		$opts = $this->getOpts($volume);
82
-		if (! $opts['enable']) {
82
+		if (!$opts['enable']) {
83 83
 			return false;
84 84
 		}
85 85
 		
@@ -104,12 +104,12 @@  discard block
 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))
107
+				if ($opts['nfc'] && !Normalizer::isNormalized($str, Normalizer::FORM_C))
108 108
 					$str = Normalizer::normalize($str, Normalizer::FORM_C);
109
-				if ($opts['nfkc'] && ! Normalizer::isNormalized($str, Normalizer::FORM_KC))
109
+				if ($opts['nfkc'] && !Normalizer::isNormalized($str, Normalizer::FORM_KC))
110 110
 					$str = Normalizer::normalize($str, Normalizer::FORM_KC);
111 111
 			} else {
112
-				if (! class_exists('I18N_UnicodeNormalizer')) {
112
+				if (!class_exists('I18N_UnicodeNormalizer')) {
113 113
 					@ include_once 'I18N/UnicodeNormalizer.php';
114 114
 				}
115 115
 				if (class_exists('I18N_UnicodeNormalizer')) {
Please login to merge, or discard this patch.