Passed
Push — master ( 4c9f6d...9f98fb )
by Stanislav
03:51 queued 01:00
created
core/migrations/release_1_2_0_add_bbcode.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
 				{
54 54
 					$bbcode_id = NUM_CORE_BBCODES + 1;
55 55
 				}
56
-			}
57
-			else
56
+			} else
58 57
 			{
59 58
 				$bbcode_id = NUM_CORE_BBCODES + 1;
60 59
 			}
@@ -63,8 +62,7 @@  discard block
 block discarded – undo
63 62
 			if ($this->config['enable_mod_rewrite'])
64 63
 			{
65 64
 				$url .= 'gallery/image/';
66
-			}
67
-			else
65
+			} else
68 66
 			{
69 67
 				$url .= 'app.php/gallery/image/';
70 68
 			}
Please login to merge, or discard this patch.
core/migrations/release_1_2_0.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,8 +118,7 @@
 block discarded – undo
118 118
 			if (isset(self::$is_dynamic[$name]))
119 119
 			{
120 120
 				$config->set('phpbb_gallery_' . $name, $value, true);
121
-			}
122
-			else
121
+			} else
123 122
 			{
124 123
 				$config->set('phpbb_gallery_' . $name, $value);
125 124
 			}
Please login to merge, or discard this patch.
core/migrations/release_1_2_0_create_filesystem.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,8 +89,7 @@
 block discarded – undo
89 89
 			if (is_dir($file))
90 90
 			{
91 91
 				$this->recursiveRemoveDirectory($file);
92
-			}
93
-			else
92
+			} else
94 93
 			{
95 94
 				unlink($file);
96 95
 			}
Please login to merge, or discard this patch.
core/ext.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -111,8 +111,7 @@
 block discarded – undo
111 111
 					$phpbb_notifications->purge_notifications('phpbbgallery.core.notification.new_image');
112 112
 					$phpbb_notifications->purge_notifications('phpbbgallery.core.notification.new_comment');
113 113
 					$phpbb_notifications->purge_notifications('phpbbgallery.core.notification.new_report');
114
-				}
115
-				catch (\phpbb\notification\exception $e)
114
+				} catch (\phpbb\notification\exception $e)
116 115
 				{
117 116
 					// continue
118 117
 				}
Please login to merge, or discard this patch.
core/config.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -147,8 +147,7 @@  discard block
 block discarded – undo
147 147
 			if (isset($this->config['phpbb_gallery_' . $option]))
148 148
 			{
149 149
 				$config_ary[$option] = $this->config['phpbb_gallery_' . $option];
150
-			}
151
-			else
150
+			} else
152 151
 			{
153 152
 				$config_ary[$option] = $default;
154 153
 			}
@@ -161,8 +160,7 @@  discard block
 block discarded – undo
161 160
 		if (isset($this->config['phpbb_gallery_' . $key]))
162 161
 		{
163 162
 			return $this->config['phpbb_gallery_' . $key];
164
-		}
165
-		else
163
+		} else
166 164
 		{
167 165
 			return $this->configs_array[$key];
168 166
 		}
Please login to merge, or discard this patch.
core/album/manage.php 1 patch
Braces   +26 added lines, -52 removed lines patch added patch discarded remove patch
@@ -150,8 +150,7 @@  discard block
 block discarded – undo
150 150
 			if ($this->user->data['user_timezone'] == '')
151 151
 			{
152 152
 				$timezone = 'UTC';
153
-			}
154
-			else
153
+			} else
155 154
 			{
156 155
 				$timezone = $this->user->data['user_timezone'];
157 156
 			}
@@ -163,8 +162,7 @@  discard block
 block discarded – undo
163 162
 			{
164 163
 				$errors[] = sprintf($this->language->lang('CONTEST_START_INVALID'), $contest_data['contest_start']);
165 164
 				$start_date_error = true;
166
-			}
167
-			else
165
+			} else
168 166
 			{
169 167
 				$contest_data['contest_start'] = gmmktime((int) $m[4], (int) $m[5], 0, (int) $m[2], (int) $m[3], (int) $m[1]) - $time->getOffset();// - $offset;
170 168
 			}
@@ -172,8 +170,7 @@  discard block
 block discarded – undo
172 170
 			{
173 171
 				$errors[] = sprintf($this->language->lang('CONTEST_RATING_INVALID'), $contest_data['contest_rating']);
174 172
 				$date_error = true;
175
-			}
176
-			else if (!$start_date_error)
173
+			} else if (!$start_date_error)
177 174
 			{
178 175
 				$contest_data['contest_rating'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset();//- $offset;
179 176
 			}
@@ -181,8 +178,7 @@  discard block
 block discarded – undo
181 178
 			{
182 179
 				$errors[] = sprintf($this->language->lang('CONTEST_END_INVALID'), $contest_data['contest_end']);
183 180
 				$date_error = true;
184
-			}
185
-			else if (!$start_date_error)
181
+			} else if (!$start_date_error)
186 182
 			{
187 183
 				$contest_data['contest_end'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset();//- $offset;
188 184
 			}
@@ -270,8 +266,7 @@  discard block
 block discarded – undo
270 266
 
271 267
 					$album_data_sql['left_id'] = $row['right_id'];
272 268
 					$album_data_sql['right_id'] = $row['right_id'] + 1;
273
-				}
274
-				else
269
+				} else
275 270
 				{
276 271
 					$sql = 'UPDATE ' . $this->albums_table . ' 
277 272
 						SET left_id = left_id + 2, right_id = right_id + 2
@@ -288,8 +283,7 @@  discard block
 block discarded – undo
288 283
 					$album_data_sql['left_id'] = $row['left_id'] + 1;
289 284
 					$album_data_sql['right_id'] = $row['left_id'] + 2;
290 285
 				}
291
-			}
292
-			else
286
+			} else
293 287
 			{
294 288
 				if (!$add_on_top)
295 289
 				{
@@ -302,8 +296,7 @@  discard block
 block discarded – undo
302 296
 
303 297
 					$album_data_sql['left_id'] = $row['right_id'] + 1;
304 298
 					$album_data_sql['right_id'] = $row['right_id'] + 2;
305
-				}
306
-				else
299
+				} else
307 300
 				{
308 301
 					$sql = 'UPDATE ' . $this->albums_table . ' 
309 302
 						SET left_id = left_id + 2, right_id = right_id + 2
@@ -336,8 +329,7 @@  discard block
 block discarded – undo
336 329
 				$this->db->sql_query($sql);
337 330
 			}
338 331
 			$this->gallery_log->add_log('admin', 'add', $album_data['album_id'], 0, array('LOG_ALBUM_ADD', $album_data['album_name']));
339
-		}
340
-		else
332
+		} else
341 333
 		{
342 334
 			$row = $this->gallery_album->get_info($album_data_sql['album_id']);
343 335
 			$reset_marked_images = false;
@@ -348,22 +340,19 @@  discard block
 block discarded – undo
348 340
 				// Changing a contest to category? No!
349 341
 				$errors[] = $this->language->lang('ALBUM_WITH_CONTEST_NO_TYPE_CHANGE');
350 342
 				return $errors;
351
-			}
352
-			else if ($row['album_type'] != \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST)
343
+			} else if ($row['album_type'] != \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST)
353 344
 			{
354 345
 				// Changing a album to contest? No!
355 346
 				// Changing a category to contest? No!
356 347
 				$errors[] = $this->language->lang('ALBUM_NO_TYPE_CHANGE_TO_CONTEST');
357 348
 				return $errors;
358
-			}
359
-			else if ($row['album_type'] == \phpbbgallery\core\block::TYPE_CAT && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_UPLOAD)
349
+			} else if ($row['album_type'] == \phpbbgallery\core\block::TYPE_CAT && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_UPLOAD)
360 350
 			{
361 351
 				// Changing a category to a album? Yes!
362 352
 				// Reset the data (you couldn't upload directly in a cat, you must use a album)
363 353
 				$album_data_sql['album_images'] = $album_data_sql['album_images_real'] = $album_data_sql['album_last_image_id'] = $album_data_sql['album_last_user_id'] = $album_data_sql['album_last_image_time'] = $album_data_sql['album_contest'] = 0;
364 354
 				$album_data_sql['album_last_username'] = $album_data_sql['album_last_user_colour'] = $album_data_sql['album_last_image_name'] = '';
365
-			}
366
-			else if ($row['album_type'] == \phpbbgallery\core\block::TYPE_UPLOAD && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_CAT)
355
+			} else if ($row['album_type'] == \phpbbgallery\core\block::TYPE_UPLOAD && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_CAT)
367 356
 			{
368 357
 				// Changing a album to a category? Yes!
369 358
 				// we're turning a uploadable album into a non-uploadable album
@@ -374,22 +363,18 @@  discard block
 block discarded – undo
374 363
 					if ($to_album_id)
375 364
 					{
376 365
 						$errors = $this->move_album_content($album_data_sql['album_id'], $to_album_id);
377
-					}
378
-					else
366
+					} else
379 367
 					{
380 368
 						return array($this->language->lang('NO_DESTINATION_ALBUM'));
381 369
 					}
382
-				}
383
-				else if ($album_data_sql['type_action'] == 'delete')
370
+				} else if ($album_data_sql['type_action'] == 'delete')
384 371
 				{
385 372
 					$errors = $this->delete_album_content($album_data_sql['album_id']);
386
-				}
387
-				else
373
+				} else
388 374
 				{
389 375
 					return array($this->language->lang('NO_ALBUM_ACTION'));
390 376
 				}
391
-			}
392
-			else if ($row['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST)
377
+			} else if ($row['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST)
393 378
 			{
394 379
 				// Changing a contest to contest? Yes!
395 380
 				// We need to check for the contest_data
@@ -417,8 +402,7 @@  discard block
 block discarded – undo
417 402
 				if ($row['album_id'] != $album_data_sql['parent_id'])
418 403
 				{
419 404
 					$errors = $this->move_album($album_data_sql['album_id'], $album_data_sql['parent_id']);
420
-				}
421
-				else
405
+				} else
422 406
 				{
423 407
 					$album_data_sql['parent_id'] = $row['parent_id'];
424 408
 				}
@@ -561,13 +545,11 @@  discard block
 block discarded – undo
561 545
 			if ($to_data['right_id'] > $from_data['right_id'])
562 546
 			{
563 547
 				$diff = '+ ' . ($to_data['right_id'] - $from_data['right_id'] - 1);
564
-			}
565
-			else
548
+			} else
566 549
 			{
567 550
 				$diff = '- ' . abs($to_data['right_id'] - $from_data['right_id'] - 1);
568 551
 			}
569
-		}
570
-		else
552
+		} else
571 553
 		{
572 554
 			$sql = 'SELECT MAX(right_id) AS right_id
573 555
 				FROM ' . $this->albums_table . ' 
@@ -613,14 +595,12 @@  discard block
 block discarded – undo
613 595
 		{
614 596
 			$log_action_images = 'IMAGES';
615 597
 			$errors = array_merge($errors, $this->delete_album_content($album_id));
616
-		}
617
-		else if ($action_images == 'move')
598
+		} else if ($action_images == 'move')
618 599
 		{
619 600
 			if (!$images_to_id)
620 601
 			{
621 602
 				$errors[] = $this->language->lang('NO_DESTINATION_ALBUM');
622
-			}
623
-			else
603
+			} else
624 604
 			{
625 605
 				$log_action_images = 'MOVE_IMAGES';
626 606
 
@@ -634,8 +614,7 @@  discard block
 block discarded – undo
634 614
 				if (!$row)
635 615
 				{
636 616
 					$errors[] = $this->language->lang('NO_ALBUM');
637
-				}
638
-				else
617
+				} else
639 618
 				{
640 619
 					$images_to_name = $row['album_name'];
641 620
 					$errors = array_merge($errors, $this->move_album_content($album_id, $images_to_id));
@@ -669,14 +648,12 @@  discard block
 block discarded – undo
669 648
 			$sql = 'DELETE FROM ' . $this->albums_table . ' 
670 649
 				WHERE ' . $this->db->sql_in_set('album_id', $album_ids);
671 650
 			$this->db->sql_query($sql);
672
-		}
673
-		else if ($action_subalbums == 'move')
651
+		} else if ($action_subalbums == 'move')
674 652
 		{
675 653
 			if (!$subalbums_to_id)
676 654
 			{
677 655
 				$errors[] = $this->language->lang('NO_DESTINATION_ALBUM');
678
-			}
679
-			else
656
+			} else
680 657
 			{
681 658
 				$log_action_albums = 'MOVE_ALBUMS';
682 659
 
@@ -690,8 +667,7 @@  discard block
 block discarded – undo
690 667
 				if (!$row)
691 668
 				{
692 669
 					$errors[] = $this->language->lang('NO_ALBUM');
693
-				}
694
-				else
670
+				} else
695 671
 				{
696 672
 					$subalbums_to_name = $row['album_name'];
697 673
 
@@ -726,8 +702,7 @@  discard block
 block discarded – undo
726 702
 			{
727 703
 				return $errors;
728 704
 			}
729
-		}
730
-		else
705
+		} else
731 706
 		{
732 707
 			$diff = 2;
733 708
 			$sql = 'DELETE FROM ' . $this->albums_table . '  
@@ -1021,8 +996,7 @@  discard block
 block discarded – undo
1021 996
 
1022 997
 			$move_up_left = $album_row['left_id'];
1023 998
 			$move_up_right = $album_row['right_id'];
1024
-		}
1025
-		else
999
+		} else
1026 1000
 		{
1027 1001
 			$left_id = $album_row['left_id'];
1028 1002
 			$right_id = $target['right_id'];
Please login to merge, or discard this patch.
core/search.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -149,8 +149,7 @@  discard block
 block discarded – undo
149 149
 		if (!$sql_limit)
150 150
 		{
151 151
 			$result = $this->db->sql_query($sql);
152
-		}
153
-		else
152
+		} else
154 153
 		{
155 154
 			$result = $this->db->sql_query_limit($sql, $sql_limit);
156 155
 		}
@@ -446,8 +445,7 @@  discard block
 block discarded – undo
446 445
 				'BLOCK_NAME'	=> $block_name ? $block_name : '' ,
447 446
 				'U_BLOCK'	=> $u_block ? $u_block : $this->helper->route('phpbbgallery_core_search_egosearch'),
448 447
 			));
449
-		}
450
-		else
448
+		} else
451 449
 		{
452 450
 			$this->template->assign_block_vars('imageblock', array(
453 451
 				'BLOCK_NAME'	=>  $block_name ? $block_name : $this->language->lang('RECENT_IMAGES'),
@@ -505,8 +503,7 @@  discard block
 block discarded – undo
505 503
 					'phpbbgallery_core_search_egosearch_page',),
506 504
 					'params' => array()), 'pagination', 'page', $count, $limit, $start
507 505
 			);
508
-		}
509
-		else
506
+		} else
510 507
 		{
511 508
 			$this->template->assign_vars(array(
512 509
 				'TOTAL_IMAGES'				=> $this->language->lang('VIEW_ALBUM_IMAGES', $count),
Please login to merge, or discard this patch.
core/file/file.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -161,8 +161,7 @@  discard block
 block discarded – undo
161 161
 		if (isset($this->image_size['file']))
162 162
 		{
163 163
 			$file_size = $this->image_size['file'];
164
-		}
165
-		else if ($force_filesize)
164
+		} else if ($force_filesize)
166 165
 		{
167 166
 			$file_size = @filesize($this->image_source);
168 167
 		}
@@ -296,8 +295,7 @@  discard block
 block discarded – undo
296 295
 		{
297 296
 			$this->thumb_height	= $max_height;
298 297
 			$this->thumb_width	= round($max_width * (($this->image_size['width'] / $max_width) / ($this->image_size['height'] / $max_height)));
299
-		}
300
-		else
298
+		} else
301 299
 		{
302 300
 			$this->thumb_height	= round($max_height * (($this->image_size['height'] / $max_height) / ($this->image_size['width'] / $max_width)));
303 301
 			$this->thumb_width	= $max_width;
@@ -407,8 +405,7 @@  discard block
 block discarded – undo
407 405
 		{
408 406
 			$this->image_source = $get_wm_name;
409 407
 			$this->read_image();
410
-		}
411
-		else
408
+		} else
412 409
 		{
413 410
 			$this->watermark_size = getimagesize($this->watermark_source);
414 411
 			switch ($this->watermark_size['mime'])
@@ -437,16 +434,14 @@  discard block
 block discarded – undo
437 434
 			if ($watermark_position & $phpbb_gallery_constants::WATERMARK_LEFT)
438 435
 			{
439 436
 				$dst_x = 5;
440
-			}
441
-			else if ($watermark_position & $phpbb_gallery_constants::WATERMARK_RIGHT)
437
+			} else if ($watermark_position & $phpbb_gallery_constants::WATERMARK_RIGHT)
442 438
 			{
443 439
 				$dst_x = ($this->image_size['width'] - $this->watermark_size[0] - 5);
444 440
 			}
445 441
 			if ($watermark_position & $phpbb_gallery_constants::WATERMARK_TOP)
446 442
 			{
447 443
 				$dst_y = 5;
448
-			}
449
-			else if ($watermark_position & $phpbb_gallery_constants::WATERMARK_MIDDLE)
444
+			} else if ($watermark_position & $phpbb_gallery_constants::WATERMARK_MIDDLE)
450 445
 			{
451 446
 				$dst_y = (($this->image_size['height'] * 0.5) - ($this->watermark_size[1] * 0.5));
452 447
 			}
Please login to merge, or discard this patch.
core/event/main_listener.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -146,8 +146,7 @@
 block discarded – undo
146 146
 					'U_GALLERY_IMAGES_ALLOW'	=> true,
147 147
 					'U_GALLERY_IMAGES'	=> $user_info['user_images'],
148 148
 				));
149
-			}
150
-			else
149
+			} else
151 150
 			{
152 151
 				$this->template->assign_vars(array(
153 152
 					'U_GALLERY_IMAGES_ALLOW'	=> true,
Please login to merge, or discard this patch.