Passed
Pull Request — master (#326)
by
unknown
02:31
created
core/controller/image.php 1 patch
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -250,8 +250,7 @@  discard block
 block discarded – undo
250 250
 			}
251 251
 
252 252
 			$this->loader->load($this->data['image_album_id']);
253
-		}
254
-		catch (\Exception $e)
253
+		} catch (\Exception $e)
255 254
 		{
256 255
 			throw new \phpbb\exception\http_exception(404, 'INVALID_IMAGE');
257 256
 		}
@@ -264,8 +263,7 @@  discard block
 block discarded – undo
264 263
 		if ($this->gallery_auth->acl_check('m_status', $album_id, $album_data['album_user_id']))
265 264
 		{
266 265
 			$image_status_check = '';
267
-		}
268
-		else
266
+		} else
269 267
 		{
270 268
 			$user_id = (int) $this->user->data['user_id'];
271 269
 			$image_status_check = ' AND (image_status = ' . (int) \phpbbgallery\core\block::STATUS_APPROVED . ' OR image_user_id = ' . $user_id . ')';
@@ -322,8 +320,7 @@  discard block
 block discarded – undo
322 320
 		if (in_array($sort_key, array('r', 'ra')))
323 321
 		{
324 322
 			$sql_help_sort = ', image_id ' . (($sort_dir == 'd') ? 'ASC' : 'DESC');
325
-		}
326
-		else
323
+		} else
327 324
 		{
328 325
 			$sql_help_sort = ', image_id ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
329 326
 		}
@@ -551,8 +548,7 @@  discard block
 block discarded – undo
551 548
 			if (isset($album_data['contest_start']))
552 549
 			{
553 550
 				$s_hide_comment_input = (time() < ($album_data['contest_start'] + $album_data['contest_end'])) ? true : false;
554
-			}
555
-			else
551
+			} else
556 552
 			{
557 553
 				$s_hide_comment_input = false;
558 554
 			}
@@ -598,8 +594,7 @@  discard block
 block discarded – undo
598 594
 				//$this->template->assign_var('S_COMMENT_ACTION', append_sid($this->url->path('full') . 'comment/' . $image_id . '/add/0'));
599 595
 				$this->template->assign_var('S_COMMENT_ACTION', $this->helper->route('phpbbgallery_core_comment_add', array('image_id' => $image_id, 'comment_id' => 0)));
600 596
 			}
601
-		}
602
-		else if ($this->gallery_config->get('comment_user_control') && !$image_data['image_allow_comments'])
597
+		} else if ($this->gallery_config->get('comment_user_control') && !$image_data['image_allow_comments'])
603 598
 		{
604 599
 			$this->template->assign_var('S_COMMENTS_DISABLED', true);
605 600
 		}
@@ -790,8 +785,7 @@  discard block
 block discarded – undo
790 785
 								'NAME'      => $field_data['PROFILE_FIELD_NAME'],
791 786
 								'U_CONTACT' => $field_data['PROFILE_FIELD_CONTACT'],
792 787
 							));
793
-						}
794
-						else
788
+						} else
795 789
 						{
796 790
 							$this->template->assign_block_vars('commentrow.custom_fields', $field_data);
797 791
 						}
@@ -917,8 +911,7 @@  discard block
 block discarded – undo
917 911
 					{
918 912
 						$change_image_count = true;
919 913
 					}
920
-				}
921
-				else if ($this->request->variable('change_author', '', true))
914
+				} else if ($this->request->variable('change_author', '', true))
922 915
 				{
923 916
 					$errors[] = $this->language->lang('INVALID_USERNAME');
924 917
 				}
@@ -939,8 +932,7 @@  discard block
 block discarded – undo
939 932
 					{
940 933
 						$personal_album_id = $this->album->generate_personal_album($image_data['image_username'], $image_data['image_user_id'], $image_data['image_user_colour'], $image_user);
941 934
 					}
942
-				}
943
-				else
935
+				} else
944 936
 				{
945 937
 					$personal_album_id = $this->gallery_user->get_data('personal_album_id');
946 938
 					if (!$personal_album_id && $this->gallery_auth->acl_check('i_upload', $this->gallery_auth->get_own_album()))
@@ -1108,8 +1100,7 @@  discard block
 block discarded – undo
1108 1100
 			$this->notification_helper->read('approval', $album_id);
1109 1101
 			$this->url->meta_refresh(3, $album_backlink);
1110 1102
 			trigger_error($message);
1111
-		}
1112
-		else
1103
+		} else
1113 1104
 		{
1114 1105
 			if (isset($_POST['cancel']))
1115 1106
 			{
@@ -1117,8 +1108,7 @@  discard block
 block discarded – undo
1117 1108
 				$message .= '<br />' . sprintf($this->language->lang('CLICK_RETURN_IMAGE'), '<a href="' . $image_backlink . '">', '</a>');
1118 1109
 				$this->url->meta_refresh(3, $image_backlink);
1119 1110
 				trigger_error($message);
1120
-			}
1121
-			else
1111
+			} else
1122 1112
 			{
1123 1113
 				confirm_box(false, 'DELETE_IMAGE2', $s_hidden_fields);
1124 1114
 			}
@@ -1223,8 +1213,7 @@  discard block
 block discarded – undo
1223 1213
 			{
1224 1214
 				// @todo Add "redirect after login" url
1225 1215
 				login_box();
1226
-			}
1227
-			else
1216
+			} else
1228 1217
 			{
1229 1218
 				//return $this->error('NOT_AUTHORISED', 403);
1230 1219
 				redirect('gallery/album/' . $album_id);
Please login to merge, or discard this patch.
core/acp/permissions_module.php 1 patch
Braces   +17 added lines, -34 removed lines patch added patch discarded remove patch
@@ -110,8 +110,7 @@  discard block
 block discarded – undo
110 110
 						if (!$submit)
111 111
 						{
112 112
 							$this->permissions_v_mask();
113
-						}
114
-						else
113
+						} else
115 114
 						{
116 115
 							$this->permissions_p_mask();
117 116
 						}
@@ -449,13 +448,11 @@  discard block
 block discarded – undo
449 448
 		if (!sizeof($group_id) && !sizeof($user_id))
450 449
 		{
451 450
 			trigger_error('NO_VICTIM_SELECTED', E_USER_WARNING);
452
-		}
453
-		else if (sizeof($group_id))
451
+		} else if (sizeof($group_id))
454 452
 		{
455 453
 			$victim_mode = 'group';
456 454
 			$victim_id = $group_id;
457
-		}
458
-		else
455
+		} else
459 456
 		{
460 457
 			$victim_mode = 'user';
461 458
 			$victim_id = $user_id;
@@ -487,8 +484,7 @@  discard block
 block discarded – undo
487 484
 				$victim_list[$row['group_id']] = $victim_row;
488 485
 			}
489 486
 			$db->sql_freeresult($result);
490
-		}
491
-		else
487
+		} else
492 488
 		{
493 489
 			// Get the user information
494 490
 			$sql = 'SELECT username, user_id, user_colour
@@ -571,12 +567,10 @@  discard block
 block discarded – undo
571 567
 								if (isset($roles[$role_id][$permission]) && ($roles[$role_id][$permission] == $phpbb_ext_gallery_core_auth::ACL_YES))
572 568
 								{
573 569
 									$acl_s_yes++;
574
-								}
575
-								else if (isset($roles[$role_id][$permission]) && ($roles[$role_id][$permission] == $phpbb_ext_gallery_core_auth::ACL_NEVER))
570
+								} else if (isset($roles[$role_id][$permission]) && ($roles[$role_id][$permission] == $phpbb_ext_gallery_core_auth::ACL_NEVER))
576 571
 								{
577 572
 									$acl_s_never++;
578
-								}
579
-								else if (isset($roles[$role_id][$permission]) && ($roles[$role_id][$permission] == $phpbb_ext_gallery_core_auth::ACL_NO))
573
+								} else if (isset($roles[$role_id][$permission]) && ($roles[$role_id][$permission] == $phpbb_ext_gallery_core_auth::ACL_NO))
580 574
 								{
581 575
 									$acl_s_no++;
582 576
 								}
@@ -607,8 +601,7 @@  discard block
 block discarded – undo
607 601
 					}
608 602
 				}
609 603
 			}
610
-		}
611
-		else
604
+		} else
612 605
 		{
613 606
 			$template->assign_block_vars('c_mask', array(
614 607
 				'C_MASK_ID'				=> $p_system,
@@ -686,13 +679,11 @@  discard block
 block discarded – undo
686 679
 		if (!sizeof($group_id) && !sizeof($user_id))
687 680
 		{
688 681
 			trigger_error('NO_VICTIM_SELECTED', E_USER_WARNING);
689
-		}
690
-		else if (sizeof($group_id))
682
+		} else if (sizeof($group_id))
691 683
 		{
692 684
 			$victim_mode = 'group';
693 685
 			$victim_id = $group_id;
694
-		}
695
-		else
686
+		} else
696 687
 		{
697 688
 			$victim_mode = 'user';
698 689
 			$victim_id = $user_id;
@@ -741,8 +732,7 @@  discard block
 block discarded – undo
741 732
 						if (substr($p_mask, -6, 6) == '_count')
742 733
 						{
743 734
 							$auth_settings[$c_mask][$v_mask][$p_mask] = $value;
744
-						}
745
-						else
735
+						} else
746 736
 						{
747 737
 							$auth_settings[$c_mask][$v_mask][$p_mask] = ($value == ACL_YES) ? $phpbb_ext_gallery_core_auth::ACL_YES : (($value == ACL_NEVER) ? $phpbb_ext_gallery_core_auth::ACL_NEVER : $phpbb_ext_gallery_core_auth::ACL_NO);
748 738
 							// Do we have moderators?
@@ -792,15 +782,13 @@  discard block
 block discarded – undo
792 782
 								}
793 783
 								// We take all permissions of another c_mask, so:
794 784
 								break;
795
-							}
796
-							else
785
+							} else
797 786
 							{
798 787
 								// The chosen option was disabled: Hacking attempt?!
799 788
 								trigger_error('HACKING_ATTEMPT', E_USER_WARNING);
800 789
 							}
801 790
 						}
802
-					}
803
-					else if ($i_mask)
791
+					} else if ($i_mask)
804 792
 					{
805 793
 						// Inherit permissions of one [c_mask][v_mask]
806 794
 						$v_mask = (int) $v_mask;
@@ -821,8 +809,7 @@  discard block
 block discarded – undo
821 809
 								}
822 810
 								$auth_settings[$c_mask][$v_mask] = $auth_settings[$ci_mask][$vi_mask];
823 811
 								$p_mask_storage[$auth_settings[$c_mask][$v_mask]]['usage'][] = array('c_mask' => $c_mask, 'v_mask' => $v_mask);
824
-							}
825
-							else
812
+							} else
826 813
 							{
827 814
 								// The chosen option was disabled: Hacking attempt?!
828 815
 								trigger_error('HACKING_ATTEMPT', E_USER_WARNING);
@@ -895,8 +882,7 @@  discard block
 block discarded – undo
895 882
 						$victim_names[$row['group_id']] = $row['group_name'];
896 883
 					}
897 884
 					$db->sql_freeresult($result);
898
-				}
899
-				else
885
+				} else
900 886
 				{
901 887
 					// Get username's for the GALLERY_MODSCACHE_TABLE
902 888
 					$sql = 'SELECT user_id, username
@@ -962,8 +948,7 @@  discard block
 block discarded – undo
962 948
 									'group_id'		=> $usage['v_mask'],
963 949
 									'group_name'	=> $victim_names[$usage['v_mask']],
964 950
 								);
965
-							}
966
-							else
951
+							} else
967 952
 							{
968 953
 								$sql_moderators[] = array(
969 954
 									'album_id'		=> $usage['c_mask'],
@@ -972,8 +957,7 @@  discard block
 block discarded – undo
972 957
 								);
973 958
 							}
974 959
 						}
975
-					}
976
-					else
960
+					} else
977 961
 					{
978 962
 						$sql_permissions[] = array(
979 963
 							'perm_role_id'					=> $role_id,
@@ -1097,8 +1081,7 @@  discard block
 block discarded – undo
1097 1081
 				$phpbb_ext_gallery_core_auth->set_user_permissions('all', '');
1098 1082
 
1099 1083
 				trigger_error($this->language->lang('COPY_PERMISSIONS_SUCCESSFUL') . adm_back_link($this->u_action));
1100
-			}
1101
-			else
1084
+			} else
1102 1085
 			{
1103 1086
 				$s_hidden_fields = array(
1104 1087
 					'submit'			=> $submit,
Please login to merge, or discard this patch.
core/acp/albums_module.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -324,8 +324,7 @@  discard block
 block discarded – undo
324 324
 					if (!$update)
325 325
 					{
326 326
 						$album_data = $row;
327
-					}
328
-					else
327
+					} else
329 328
 					{
330 329
 						$album_data['left_id'] = $row['left_id'];
331 330
 						$album_data['right_id'] = $row['right_id'];
@@ -333,8 +332,7 @@  discard block
 block discarded – undo
333 332
 					if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST)
334 333
 					{
335 334
 						$contest_data = $phpbb_gallery_contest->get_contest($album_id, 'album');
336
-					}
337
-					else
335
+					} else
338 336
 					{
339 337
 						// Default values, 3 days later rate and 7 for the end of the contest
340 338
 						$contest_data = array(
@@ -356,8 +354,7 @@  discard block
 block discarded – undo
356 354
 					/*
357 355
 					$album_data['album_password_confirm'] = $album_data['album_password'];
358 356
 					*/
359
-				}
360
-				else
357
+				} else
361 358
 				{
362 359
 					$this->page_title = 'CREATE_ALBUM';
363 360
 
@@ -494,8 +491,7 @@  discard block
 block discarded – undo
494 491
 						'S_HAS_SUBALBUMS'		=> ($album_data['right_id'] - $album_data['left_id'] > 1) ? true : false,
495 492
 						'S_ALBUMS_LIST'			=> $albums_list,
496 493
 					));
497
-				}
498
-				else if ($uploadable_album_exists)
494
+				} else if ($uploadable_album_exists)
499 495
 				{
500 496
 					$template->assign_vars(array(
501 497
 						'S_MOVE_ALBUM_OPTIONS'		=> $phpbb_ext_gallery_core_album->get_albumbox(true, '', $album_data['parent_id'], false, $album_id, 0, (int) \phpbbgallery\core\block::TYPE_UPLOAD),
@@ -635,8 +631,7 @@  discard block
 block discarded – undo
635 631
 		if (!$this->parent_id)
636 632
 		{
637 633
 			$navigation = $user->lang['GALLERY_INDEX'];
638
-		}
639
-		else
634
+		} else
640 635
 		{
641 636
 			$navigation = '<a href="' . $this->u_action . '">' . $user->lang['GALLERY_INDEX'] . '</a>';
642 637
 
@@ -646,8 +641,7 @@  discard block
 block discarded – undo
646 641
 				if ($row['album_id'] == $this->parent_id)
647 642
 				{
648 643
 					$navigation .= ' -&gt; ' . $row['album_name'];
649
-				}
650
-				else
644
+				} else
651 645
 				{
652 646
 					$navigation .= ' -&gt; <a href="' . $this->u_action . '&amp;parent_id=' . $row['album_id'] . '">' . $row['album_name'] . '</a>';
653 647
 				}
@@ -678,8 +672,7 @@  discard block
 block discarded – undo
678 672
 				if ($row['album_status'] == (int) \phpbbgallery\core\block::ALBUM_LOCKED)
679 673
 				{
680 674
 					$folder_image = '<img src="images/icon_folder_lock.gif" alt="' . $user->lang['LOCKED'] . '" />';
681
-				}
682
-				else
675
+				} else
683 676
 				{
684 677
 					$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="' . $user->lang['SUBALBUM'] . '" />' : '<img src="images/icon_folder.gif" alt="' . $user->lang['FOLDER'] . '" />';
685 678
 				}
@@ -705,8 +698,7 @@  discard block
 block discarded – undo
705 698
 				);
706 699
 			}
707 700
 			while ($row = $db->sql_fetchrow($result));
708
-		}
709
-		else if ($this->parent_id)
701
+		} else if ($this->parent_id)
710 702
 		{
711 703
 			$row = $phpbb_ext_gallery_core_album->get_info($this->parent_id);
712 704
 
Please login to merge, or discard this patch.
core/acp/gallery_logs_module.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,7 @@
 block discarded – undo
67 67
 			if (confirm_box(true))
68 68
 			{
69 69
 				$log->delete_logs($marked);
70
-			}
71
-			else
70
+			} else
72 71
 			{
73 72
 				confirm_box(false, $this->language->lang('CONFIRM_OPERATION'), build_hidden_fields([
74 73
 					'page'		=> $page,
Please login to merge, or discard this patch.
core/log.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -209,8 +209,7 @@  discard block
 block discarded – undo
209 209
 					$sql_array['GROUP_BY'] = 'l.description, l.log_id, i.image_id, i.image_album_id';
210 210
 				break;
211 211
 			}
212
-		}
213
-		else
212
+		} else
214 213
 		{
215 214
 			$sql_array['ORDER_BY'] = 'l.log_time ' . (isset($additional['sort_dir']) ? 'ASC' : 'DESC');
216 215
 			$sql_array['GROUP_BY'] = 'l.log_time, l.log_id, i.image_id, i.image_album_id';
@@ -299,8 +298,7 @@  discard block
 block discarded – undo
299 298
 				'params' => array(
300 299
 				),
301 300
 			), 'pagination', 'page', $count, $limit, ($page-1) * $limit);
302
-		}
303
-		else if ($album == -1)
301
+		} else if ($album == -1)
304 302
 		{
305 303
 			$url_array = array(
306 304
 				'i' => '-phpbbgallery-core-acp-gallery_logs_module',
@@ -322,8 +320,7 @@  discard block
 block discarded – undo
322 320
 			$url = http_build_query($url_array,'','&');
323 321
 
324 322
 			$this->pagination->generate_template_pagination(append_sid('index.php?' . $url), 'pagination', 'page', $count, $limit, ($page-1) * $limit);
325
-		}
326
-		else
323
+		} else
327 324
 		{
328 325
 			$this->pagination->generate_template_pagination(array(
329 326
 				'routes' => array(
Please login to merge, or discard this patch.
core/user.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -202,8 +202,7 @@  discard block
 block discarded – undo
202 202
 		if (isset($this->data[$key]))
203 203
 		{
204 204
 			return $this->data[$key];
205
-		}
206
-		else if ($default && $this->get_default_value($key) !== null)
205
+		} else if ($default && $this->get_default_value($key) !== null)
207 206
 		{
208 207
 			return $this->get_default_value($key);
209 208
 		}
@@ -401,12 +400,10 @@  discard block
 block discarded – undo
401 400
 		if (is_array($user_ids) && !empty($user_ids))
402 401
 		{
403 402
 			$sql_where = 'WHERE ' . $this->db->sql_in_set('user_id', array_map('intval', $user_ids));
404
-		}
405
-		else if ($user_ids == 'all')
403
+		} else if ($user_ids == 'all')
406 404
 		{
407 405
 			$sql_where = '';
408
-		}
409
-		else
406
+		} else
410 407
 		{
411 408
 			$sql_where = 'WHERE user_id = ' . (int) $user_ids;
412 409
 		}
@@ -437,8 +434,7 @@  discard block
 block discarded – undo
437 434
 					{
438 435
 						// While incrementing, the images might be lower than 0.
439 436
 						$validated_data[$name] = (int) $value;
440
-					}
441
-					else
437
+					} else
442 438
 					{
443 439
 						$validated_data[$name] = max(0, (int) $value);
444 440
 					}
@@ -584,8 +580,7 @@  discard block
 block discarded – undo
584 580
 					'warnings'            => 0,
585 581
 					'allow_pm'            => 0,
586 582
 				);
587
-			}
588
-			else
583
+			} else
589 584
 			{
590 585
 				$user_sig = '';
591 586
 				// We add the signature to every posters entry because enable_sig is post dependent
@@ -631,8 +626,7 @@  discard block
 block discarded – undo
631 626
 				if ((!empty($row['user_allow_viewemail']) && $this->auth->acl_get('u_sendemail')) || $this->auth->acl_get('a_email'))
632 627
 				{
633 628
 					$user_cache[$user_id]['email'] = ($this->config['board_email_form'] && $this->config['email_enable']) ? append_sid("{$this->root_path}memberlist.$this->php_ext", "mode=email&amp;u=$user_id") : (($this->config['board_hide_emails'] && !$this->auth->acl_get('a_email')) ? '' : 'mailto:' . $row['user_email']);
634
-				}
635
-				else
629
+				} else
636 630
 				{
637 631
 					$user_cache[$user_id]['email'] = '';
638 632
 				}
@@ -645,8 +639,7 @@  discard block
 block discarded – undo
645 639
 						if ($diff == 0)
646 640
 						{
647 641
 							$diff = ($now['mday'] - $bday_day < 0) ? 1 : 0;
648
-						}
649
-						else
642
+						} else
650 643
 						{
651 644
 							$diff = ($diff < 0) ? 1 : 0;
652 645
 						}
Please login to merge, or discard this patch.