Passed
Push — master ( 3dc8c5...dc57d3 )
by Stanislav
02:37
created
core/controller/search.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -232,8 +232,7 @@  discard block
 block discarded – undo
232 232
 				if ($search_terms == 'all')
233 233
 				{
234 234
 					$keywords .= ' ' . $add_keywords;
235
-				}
236
-				else
235
+				} else
237 236
 				{
238 237
 					$search_terms = 'all';
239 238
 					$keywords = preg_replace('#\s+#u', ' |', $keywords) . ' ' .$add_keywords;
@@ -271,8 +270,7 @@  discard block
 block discarded – undo
271 270
 			if (empty($search_album))
272 271
 			{
273 272
 				$sql_where[] = $this->db->sql_in_set('i.image_album_id', $this->gallery_auth->acl_album_ids('i_view'));
274
-			}
275
-			else
273
+			} else
276 274
 			{
277 275
 				$sql_where[] = $this->db->sql_in_set('i.image_album_id', $search_album);
278 276
 			}
Please login to merge, or discard this patch.
core/controller/index.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -131,8 +131,7 @@  discard block
 block discarded – undo
131 131
 		if ($this->gallery_config->get('pegas_index_album'))
132 132
 		{
133 133
 			$this->display->display_albums('personal', $this->config['load_moderators']);
134
-		}
135
-		else
134
+		} else
136 135
 		{
137 136
 			$last_image = $this->image->get_last_image();
138 137
 			if (empty($last_image))
@@ -347,8 +346,7 @@  discard block
 block discarded – undo
347 346
 				FROM ' . GROUPS_TABLE . '
348 347
 				WHERE group_legend > 0
349 348
 				ORDER BY ' . $order_legend . ' ASC';
350
-		}
351
-		else
349
+		} else
352 350
 		{
353 351
 			$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_legend
354 352
 				FROM ' . GROUPS_TABLE . ' g
@@ -373,8 +371,7 @@  discard block
 block discarded – undo
373 371
 			if ($row['group_name'] == 'BOTS' || ($this->user->data['user_id'] != ANONYMOUS && !$this->auth->acl_get('u_viewprofile')))
374 372
 			{
375 373
 				$legend[] = '<span' . $colour_text . '>' . $group_name . '</span>';
376
-			}
377
-			else
374
+			} else
378 375
 			{
379 376
 				$legend[] = '<a' . $colour_text . ' href="' . append_sid($this->root_path . 'memberlist.' . $this->php_ext, 'mode=group&amp;g=' . $row['group_id']) . '">' . $group_name . '</a>';
380 377
 			}
Please login to merge, or discard this patch.
core/controller/comment.php 1 patch
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -213,8 +213,7 @@  discard block
 block discarded – undo
213 213
 		if (isset($album_data['contest_start']))
214 214
 		{
215 215
 			$s_hide_comment_input = (time() < ($album_data['contest_start'] + $album_data['contest_end'])) ? true : false;
216
-		}
217
-		else
216
+		} else
218 217
 		{
219 218
 			$s_hide_comment_input = false;
220 219
 		}
@@ -338,14 +337,12 @@  discard block
 block discarded – undo
338 337
 				$this->notification_helper->notify('new_comment', $data);
339 338
 				//$phpbb_gallery_notification->send_notification('image', $image_id, $image_data['image_name']);
340 339
 				$message .= $this->language->lang('COMMENT_STORED') . '<br />';
341
-			}
342
-			else if ($this->misc->display_captcha('comment'))
340
+			} else if ($this->misc->display_captcha('comment'))
343 341
 			{
344 342
 				$s_captcha_hidden_fields = ($captcha->is_solved()) ? build_hidden_fields($captcha->get_hidden_fields()) : '';
345 343
 			}
346 344
 			$sig_checked = ($this->auth->acl_get('u_sig') && isset($_POST['attach_sig']));
347
-		}
348
-		else
345
+		} else
349 346
 		{
350 347
 			if ($comment_id != 0)
351 348
 			{
@@ -439,8 +436,7 @@  discard block
 block discarded – undo
439 436
 			$comment_data = $this->db->sql_fetchrow($result);
440 437
 			$this->db->sql_freeresult($result);
441 438
 			$image_id = (int) $comment_data['comment_image_id'];
442
-		}
443
-		else
439
+		} else
444 440
 		{
445 441
 			$this->misc->not_authorised($image_backlink, $image_loginlink);
446 442
 		}
@@ -451,8 +447,7 @@  discard block
 block discarded – undo
451 447
 			{
452 448
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
453 449
 			}
454
-		}
455
-		else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id']))
450
+		} else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id']))
456 451
 		{
457 452
 			$this->misc->not_authorised($image_backlink, $image_loginlink);
458 453
 		}
@@ -485,8 +480,7 @@  discard block
 block discarded – undo
485 480
 		if (isset($album_data['contest_start']))
486 481
 		{
487 482
 			$s_hide_comment_input = (time() < ($album_data['contest_start'] + $album_data['contest_end'])) ? true : false;
488
-		}
489
-		else
483
+		} else
490 484
 		{
491 485
 			$s_hide_comment_input = false;
492 486
 		}
@@ -578,8 +572,7 @@  discard block
 block discarded – undo
578 572
 					$this->gallery_log->add_log('moderator', 'c_edit', $image_data['image_album_id'], $image_data['image_id'], array('LOG_GALLERY_COMMENT_EDITED', $image_data['image_name']));
579 573
 				}
580 574
 			}
581
-		}
582
-		else
575
+		} else
583 576
 		{
584 577
 			$sig_checked = (bool) $comment_data['comment_signature'];
585 578
 
@@ -653,8 +646,7 @@  discard block
 block discarded – undo
653 646
 			$comment_data = $this->db->sql_fetchrow($result);
654 647
 			$this->db->sql_freeresult($result);
655 648
 			$image_id = (int) $comment_data['comment_image_id'];
656
-		}
657
-		else
649
+		} else
658 650
 		{
659 651
 			$this->misc->not_authorised($image_backlink, $image_loginlink);
660 652
 		}
@@ -665,8 +657,7 @@  discard block
 block discarded – undo
665 657
 			{
666 658
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
667 659
 			}
668
-		}
669
-		else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id']))
660
+		} else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id']))
670 661
 		{
671 662
 			$this->misc->not_authorised($image_backlink, $image_loginlink);
672 663
 		}
@@ -731,15 +722,13 @@  discard block
 block discarded – undo
731 722
 
732 723
 			$message = $this->language->lang('DELETED_COMMENT') . '<br />';
733 724
 			$submit = true;
734
-		}
735
-		else
725
+		} else
736 726
 		{
737 727
 			if (isset($_POST['cancel']))
738 728
 			{
739 729
 				$message = $this->language->lang('DELETED_COMMENT_NOT') . '<br />';
740 730
 				$submit = true;
741
-			}
742
-			else
731
+			} else
743 732
 			{
744 733
 				confirm_box(false, 'DELETE_COMMENT2', $s_hidden_fields);
745 734
 			}
Please login to merge, or discard this patch.
core/controller/image.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -245,8 +245,7 @@  discard block
 block discarded – undo
245 245
 			}
246 246
 
247 247
 			$this->loader->load($this->data['image_album_id']);
248
-		}
249
-		catch (\Exception $e)
248
+		} catch (\Exception $e)
250 249
 		{
251 250
 			throw new \phpbb\exception\http_exception(404, 'INVALID_IMAGE');
252 251
 		}
@@ -306,8 +305,7 @@  discard block
 block discarded – undo
306 305
 		if (in_array($sort_key, array('r', 'ra')))
307 306
 		{
308 307
 			$sql_help_sort = ', image_id ' . (($sort_dir == 'd') ? 'ASC' : 'DESC');
309
-		}
310
-		else
308
+		} else
311 309
 		{
312 310
 			$sql_help_sort = ', image_id ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
313 311
 		}
@@ -532,8 +530,7 @@  discard block
 block discarded – undo
532 530
 			if (isset($album_data['contest_start']))
533 531
 			{
534 532
 				$s_hide_comment_input = (time() < ($album_data['contest_start'] + $album_data['contest_end'])) ? true : false;
535
-			}
536
-			else
533
+			} else
537 534
 			{
538 535
 				$s_hide_comment_input = false;
539 536
 			}
@@ -579,8 +576,7 @@  discard block
 block discarded – undo
579 576
 				//$this->template->assign_var('S_COMMENT_ACTION', append_sid($this->url->path('full') . 'comment/' . $image_id . '/add/0'));
580 577
 				$this->template->assign_var('S_COMMENT_ACTION', $this->helper->route('phpbbgallery_core_comment_add', array('image_id' => $image_id, 'comment_id' => 0)));
581 578
 			}
582
-		}
583
-		else if ($this->gallery_config->get('comment_user_control') && !$image_data['image_allow_comments'])
579
+		} else if ($this->gallery_config->get('comment_user_control') && !$image_data['image_allow_comments'])
584 580
 		{
585 581
 			$this->template->assign_var('S_COMMENTS_DISABLED', true);
586 582
 		}
@@ -770,8 +766,7 @@  discard block
 block discarded – undo
770 766
                                 'NAME'		=> $field_data['PROFILE_FIELD_NAME'],
771 767
                                 'U_CONTACT'	=> $field_data['PROFILE_FIELD_CONTACT'],
772 768
                             ));
773
-                        }
774
-                        else
769
+                        } else
775 770
                         {
776 771
                             $this->template->assign_block_vars('commentrow.custom_fields', $field_data);
777 772
                         }
@@ -899,8 +894,7 @@  discard block
 block discarded – undo
899 894
 					{
900 895
 						$change_image_count = true;
901 896
 					}
902
-				}
903
-				else if ($this->request->variable('change_author', '', true))
897
+				} else if ($this->request->variable('change_author', '', true))
904 898
 				{
905 899
 					$errors[] = $this->language->lang('INVALID_USERNAME');
906 900
 				}
@@ -921,8 +915,7 @@  discard block
 block discarded – undo
921 915
 					{
922 916
 						$personal_album_id = $this->album->generate_personal_album($image_data['image_username'], $image_data['image_user_id'], $image_data['image_user_colour'], $image_user);
923 917
 					}
924
-				}
925
-				else
918
+				} else
926 919
 				{
927 920
 					$personal_album_id = $this->gallery_user->get_data('personal_album_id');
928 921
 					if (!$personal_album_id && $this->gallery_auth->acl_check('i_upload', $this->gallery_auth->get_own_album()))
@@ -1090,8 +1083,7 @@  discard block
 block discarded – undo
1090 1083
 			$this->notification_helper->read('approval', $album_id);
1091 1084
 			$this->url->meta_refresh(3, $album_backlink);
1092 1085
 			trigger_error($message);
1093
-		}
1094
-		else
1086
+		} else
1095 1087
 		{
1096 1088
 			if (isset($_POST['cancel']))
1097 1089
 			{
@@ -1099,8 +1091,7 @@  discard block
 block discarded – undo
1099 1091
 				$message .= '<br />' . sprintf($this->language->lang('CLICK_RETURN_IMAGE'), '<a href="' . $image_backlink . '">', '</a>');
1100 1092
 				$this->url->meta_refresh(3, $image_backlink);
1101 1093
 				trigger_error($message);
1102
-			}
1103
-			else
1094
+			} else
1104 1095
 			{
1105 1096
 				confirm_box(false, 'DELETE_IMAGE2', $s_hidden_fields);
1106 1097
 			}
@@ -1204,8 +1195,7 @@  discard block
 block discarded – undo
1204 1195
 			{
1205 1196
 				// @todo Add "redirect after login" url
1206 1197
 				login_box();
1207
-			}
1208
-			else
1198
+			} else
1209 1199
 			{
1210 1200
 				//return $this->error('NOT_AUTHORISED', 403);
1211 1201
 				redirect('/gallery/album/' . $album_id);
Please login to merge, or discard this patch.
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/moderate.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,8 +83,7 @@  discard block
 block discarded – undo
83 83
 			{
84 84
 				$mod_array[] = 0;
85 85
 			}
86
-		}
87
-		else
86
+		} else
88 87
 		{
89 88
 			$mod_array = array($album);
90 89
 		}
@@ -161,8 +160,7 @@  discard block
 block discarded – undo
161 160
 			$this->template->assign_vars(array(
162 161
 				'TOTAL_PAGES'				=> $this->lang->lang('PAGE_TITLE_NUMBER', $page + 1),
163 162
 			));
164
-		}
165
-		else
163
+		} else
166 164
 		{
167 165
 			$this->pagination->generate_template_pagination(array(
168 166
 				'routes' => array(
Please login to merge, or discard this patch.