Passed
Push — master ( 78d882...8f7473 )
by Stanislav
24:11 queued 08:57
created
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
 			}
@@ -580,8 +577,7 @@  discard block
 block discarded – undo
580 577
 				//$this->template->assign_var('S_COMMENT_ACTION', append_sid($this->url->path('full') . 'comment/' . $image_id . '/add/0'));
581 578
 				$this->template->assign_var('S_COMMENT_ACTION', $this->helper->route('phpbbgallery_core_comment_add', array('image_id' => $image_id, 'comment_id' => 0)));
582 579
 			}
583
-		}
584
-		else if ($this->gallery_config->get('comment_user_control') && !$image_data['image_allow_comments'])
580
+		} else if ($this->gallery_config->get('comment_user_control') && !$image_data['image_allow_comments'])
585 581
 		{
586 582
 			$this->template->assign_var('S_COMMENTS_DISABLED', true);
587 583
 		}
@@ -772,8 +768,7 @@  discard block
 block discarded – undo
772 768
 								'NAME'      => $field_data['PROFILE_FIELD_NAME'],
773 769
 								'U_CONTACT' => $field_data['PROFILE_FIELD_CONTACT'],
774 770
 							));
775
-						}
776
-						else
771
+						} else
777 772
 						{
778 773
 							$this->template->assign_block_vars('commentrow.custom_fields', $field_data);
779 774
 						}
@@ -901,8 +896,7 @@  discard block
 block discarded – undo
901 896
 					{
902 897
 						$change_image_count = true;
903 898
 					}
904
-				}
905
-				else if ($this->request->variable('change_author', '', true))
899
+				} else if ($this->request->variable('change_author', '', true))
906 900
 				{
907 901
 					$errors[] = $this->language->lang('INVALID_USERNAME');
908 902
 				}
@@ -923,8 +917,7 @@  discard block
 block discarded – undo
923 917
 					{
924 918
 						$personal_album_id = $this->album->generate_personal_album($image_data['image_username'], $image_data['image_user_id'], $image_data['image_user_colour'], $image_user);
925 919
 					}
926
-				}
927
-				else
920
+				} else
928 921
 				{
929 922
 					$personal_album_id = $this->gallery_user->get_data('personal_album_id');
930 923
 					if (!$personal_album_id && $this->gallery_auth->acl_check('i_upload', $this->gallery_auth->get_own_album()))
@@ -1092,8 +1085,7 @@  discard block
 block discarded – undo
1092 1085
 			$this->notification_helper->read('approval', $album_id);
1093 1086
 			$this->url->meta_refresh(3, $album_backlink);
1094 1087
 			trigger_error($message);
1095
-		}
1096
-		else
1088
+		} else
1097 1089
 		{
1098 1090
 			if (isset($_POST['cancel']))
1099 1091
 			{
@@ -1101,8 +1093,7 @@  discard block
 block discarded – undo
1101 1093
 				$message .= '<br />' . sprintf($this->language->lang('CLICK_RETURN_IMAGE'), '<a href="' . $image_backlink . '">', '</a>');
1102 1094
 				$this->url->meta_refresh(3, $image_backlink);
1103 1095
 				trigger_error($message);
1104
-			}
1105
-			else
1096
+			} else
1106 1097
 			{
1107 1098
 				confirm_box(false, 'DELETE_IMAGE2', $s_hidden_fields);
1108 1099
 			}
@@ -1207,8 +1198,7 @@  discard block
 block discarded – undo
1207 1198
 			{
1208 1199
 				// @todo Add "redirect after login" url
1209 1200
 				login_box();
1210
-			}
1211
-			else
1201
+			} else
1212 1202
 			{
1213 1203
 				//return $this->error('NOT_AUTHORISED', 403);
1214 1204
 				redirect('/gallery/album/' . $album_id);
Please login to merge, or discard this patch.
core/album/album.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -222,8 +222,7 @@  discard block
 block discarded – undo
222 222
 			{
223 223
 				$padding .= '&nbsp; &nbsp;';
224 224
 				$padding_store[$row['parent_id']] = $padding;
225
-			}
226
-			else if ($row['left_id'] > $right + 1)
225
+			} else if ($row['left_id'] > $right + 1)
227 226
 			{
228 227
 				$padding = (isset($padding_store[$row['parent_id']])) ? $padding_store[$row['parent_id']] : '';
229 228
 			}
@@ -249,15 +248,13 @@  discard block
 block discarded – undo
249 248
 			if (($select_id == $this->gallery_auth->get_setting_permissions()) && !$row['album_user_id'])
250 249
 			{
251 250
 				$list = true;
252
-			}
253
-			else if (!$row['album_user_id'])
251
+			} else if (!$row['album_user_id'])
254 252
 			{
255 253
 				if ($this->gallery_auth->acl_check('a_list', $row['album_id'], $row['album_user_id']) || defined('IN_ADMIN'))
256 254
 				{
257 255
 					$list = true;
258 256
 				}
259
-			}
260
-			else if (!$ignore_personals)
257
+			} else if (!$ignore_personals)
261 258
 			{
262 259
 				if ($row['album_user_id'] == $this->user->data['user_id'])
263 260
 				{
@@ -268,16 +265,14 @@  discard block
 block discarded – undo
268 265
 						if ($requested_permission)
269 266
 						{
270 267
 							$requested_own = !$this->gallery_auth->acl_check($requested_permission, $this->gallery_auth->get_own_album());
271
-						}
272
-						else
268
+						} else
273 269
 						{
274 270
 							$requested_own = false; // We need the negated version of true here
275 271
 						}
276 272
 					}
277 273
 					$list = (!$list) ? $access_own : $list;
278 274
 					$disabled = (!$disabled) ? $requested_own : $disabled;
279
-				}
280
-				else if ($row['album_user_id'])
275
+				} else if ($row['album_user_id'])
281 276
 				{
282 277
 					if (!$c_access_personal)
283 278
 					{
@@ -286,8 +281,7 @@  discard block
 block discarded – undo
286 281
 						if ($requested_permission)
287 282
 						{
288 283
 							$requested_personal = !$this->gallery_auth->acl_check($requested_permission, $this->gallery_auth->get_personal_album());
289
-						}
290
-						else
284
+						} else
291 285
 						{
292 286
 							$requested_personal = false; // We need the negated version of true here
293 287
 						}
@@ -299,8 +293,7 @@  discard block
 block discarded – undo
299 293
 			if (($album_user_id != \phpbbgallery\core\block::PUBLIC_ALBUM) && ($album_user_id != $row['album_user_id']))
300 294
 			{
301 295
 				$list = false;
302
-			}
303
-			else if (($album_user_id != \phpbbgallery\core\block::PUBLIC_ALBUM) && ($row['parent_id'] == 0))
296
+			} else if (($album_user_id != \phpbbgallery\core\block::PUBLIC_ALBUM) && ($row['parent_id'] == 0))
304 297
 			{
305 298
 				$disabled = true;
306 299
 			}
@@ -318,8 +311,7 @@  discard block
 block discarded – undo
318 311
 			$gallery_albumbox = "<select name='$select_name' id='$select_name'>";
319 312
 			$gallery_albumbox .= $album_list;
320 313
 			$gallery_albumbox .= '</select>';
321
-		}
322
-		else
314
+		} else
323 315
 		{
324 316
 			$gallery_albumbox = $album_list;
325 317
 		}
@@ -388,8 +380,7 @@  discard block
 block discarded – undo
388 380
 				'album_last_user_colour' => $row['image_user_colour'],
389 381
 				'album_last_user_id'     => $row['image_user_id'],
390 382
 			);
391
-		}
392
-		else
383
+		} else
393 384
 		{
394 385
 			// No approved image, so we clear the columns
395 386
 			$sql_ary = array(
Please login to merge, or discard this patch.
core/log.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -204,8 +204,7 @@  discard block
 block discarded – undo
204 204
 					$sql_array['GROUP_BY'] = 'l.description, l.log_id, i.image_id';
205 205
 				break;
206 206
 			}
207
-		}
208
-		else
207
+		} else
209 208
 		{
210 209
 			$sql_array['ORDER_BY'] = 'l.log_time ' . (isset($additional['sort_dir']) ? 'ASC' : 'DESC');
211 210
 			$sql_array['GROUP_BY'] = 'l.log_time, l.log_id, i.image_id';
@@ -219,8 +218,7 @@  discard block
 block discarded – undo
219 218
 		if ($row)
220 219
 		{
221 220
 			$count = $row['count'];
222
-		}
223
-		else
221
+		} else
224 222
 		{
225 223
 			$count = 0;
226 224
 		}
@@ -281,8 +279,7 @@  discard block
 block discarded – undo
281 279
 				'params' => array(
282 280
 				),
283 281
 			), 'pagination', 'page', $count, $limit, ($page-1) * $limit);
284
-		}
285
-		else if ($album == -1)
282
+		} else if ($album == -1)
286 283
 		{
287 284
 			$url_array = array(
288 285
 				'i' => '-phpbbgallery-core-acp-gallery_logs_module',
@@ -303,8 +300,7 @@  discard block
 block discarded – undo
303 300
 			$url = http_build_query($url_array,'','&');
304 301
 
305 302
 			$this->pagination->generate_template_pagination(append_sid('index.php?' . $url), 'pagination', 'page', $count, $limit, ($page-1) * $limit);
306
-		}
307
-		else
303
+		} else
308 304
 		{
309 305
 			$this->pagination->generate_template_pagination(array(
310 306
 				'routes' => array(
Please login to merge, or discard this patch.
core/controller/file.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
 			$this->data['album_user_id'] = 1;
233 233
 			$this->data['image_filemissing'] = 0;
234 234
 			$this->data['album_watermark'] = 0;
235
-		}
236
-		else
235
+		} else
237 236
 		{
238 237
 			$sql = 'SELECT *
239 238
 				FROM ' . $this->table_images . ' i
@@ -394,8 +393,7 @@  discard block
 block discarded – undo
394 393
 			{
395 394
 				$response->headers->set('expires', '-1');
396 395
 			}
397
-		}
398
-		else
396
+		} else
399 397
 		{
400 398
 			$response->headers->set('Content-Disposition', 'inline; ' . $this->tool->header_filename(htmlspecialchars_decode($this->tool->image_name)) . '.' . ($this->tool->image_type == 'jpeg' ? 'jpg' : $this->tool->image_type));
401 399
 			if ($this->tool->is_ie_greater7($this->user->browser))
Please login to merge, or discard this patch.
core/image/image.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -363,8 +363,7 @@  discard block
 block discarded – undo
363 363
 				{
364 364
 					$url = $this->url->append_sid('image_page', "album_id=$album_id&amp;image_id=$next_image{$additional_parameters}");
365 365
 					$tpl = '<a href="{IMAGE_URL}" title="{IMAGE_NAME}">{CONTENT}</a>';
366
-				}
367
-				else
366
+				} else
368 367
 				{
369 368
 					$tpl = '{CONTENT}';
370 369
 				}
@@ -440,8 +439,7 @@  discard block
 block discarded – undo
440 439
 		{
441 440
 			$this->gallery_config->inc('num_images', (int) $num_images);
442 441
 			$this->gallery_config->inc('num_comments', (int) $num_comments);
443
-		}
444
-		else
442
+		} else
445 443
 		{
446 444
 			$this->gallery_config->dec('num_images', (int) $num_images);
447 445
 			$this->gallery_config->dec('num_comments', (int) $num_comments);
Please login to merge, or discard this patch.
core/album/display.php 1 patch
Braces   +15 added lines, -25 removed lines patch added patch discarded remove patch
@@ -222,8 +222,7 @@  discard block
 block discarded – undo
222 222
 					SET album_parents = '" . $this->db->sql_escape($album_data['album_parents']) . "'
223 223
 					WHERE parent_id = " . (int) $album_data['parent_id'];
224 224
 				$this->db->sql_query($sql);
225
-			}
226
-			else
225
+			} else
227 226
 			{
228 227
 				$album_parents = unserialize($album_data['album_parents']);
229 228
 			}
@@ -291,16 +290,14 @@  discard block
 block discarded – undo
291 290
 			if (!empty($row['user_id']))
292 291
 			{
293 292
 				$album_moderators[$a_id][] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
294
-			}
295
-			else
293
+			} else
296 294
 			{
297 295
 				$group_name = (($row['group_type'] == GROUP_SPECIAL) ? $this->language->lang('G_' . $row['group_name']) : $row['group_name']);
298 296
 
299 297
 				if ($this->user->data['user_id'] != ANONYMOUS && !$this->auth->acl_get('u_viewprofile'))
300 298
 				{
301 299
 					$album_moderators[$a_id][] = '<span' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . '>' . $group_name . '</span>';
302
-				}
303
-				else
300
+				} else
304 301
 				{
305 302
 					$album_moderators[$a_id][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid($this->root_path . 'memberlist.' . $this->php_ext, 'mode=group&amp;g=' . $row['group_id']) . '">' . $group_name . '</a>';
306 303
 				}
@@ -344,8 +341,7 @@  discard block
 block discarded – undo
344 341
 			}
345 342
 			$root_data = array('album_id' => \phpbbgallery\core\block::PUBLIC_ALBUM);
346 343
 			$sql_where = 'a.album_user_id = ' . \phpbbgallery\core\block::PUBLIC_ALBUM;
347
-		}
348
-		else if ($root_data == 'personal')
344
+		} else if ($root_data == 'personal')
349 345
 		{
350 346
 			if ($mark_read == 'albums')
351 347
 			{
@@ -362,8 +358,7 @@  discard block
 block discarded – undo
362 358
 				{
363 359
 					$sql_where .= ' AND u.username_clean NOT ' . $this->db->sql_like_expression(chr($i) . $this->db->any_char);
364 360
 				}
365
-			}
366
-			else if ($first_char)
361
+			} else if ($first_char)
367 362
 			{
368 363
 				$sql_where .= ' AND u.username_clean ' . $this->db->sql_like_expression(substr($first_char, 0, 1) . $this->db->any_char);
369 364
 			}
@@ -407,8 +402,7 @@  discard block
 block discarded – undo
407 402
 					'phpbbgallery_core_search_recent_page',),
408 403
 					'params' => array()), 'pagination', 'page', $num_pegas, $limit, $start
409 404
 			);*/
410
-		}
411
-		else
405
+		} else
412 406
 		{
413 407
 			$sql_where = 'a.left_id > ' . $root_data['left_id'] . ' AND a.left_id < ' . $root_data['right_id'] . ' AND a.album_user_id = ' . $root_data['album_user_id'];
414 408
 		}
@@ -496,10 +490,12 @@  discard block
 block discarded – undo
496 490
 				continue;
497 491
 			}
498 492
 
499
-			if (false)//@todo !$this->gallery_auth->acl_check('a_list', $album_id, $row['album_user_id']))
493
+			if (false) {
494
+				//@todo !$this->gallery_auth->acl_check('a_list', $album_id, $row['album_user_id']))
500 495
 			{
501 496
 				// if the user does not have permissions to list this album, skip everything until next branch
502 497
 				$right_id = $row['right_id'];
498
+			}
503 499
 				continue;
504 500
 			}
505 501
 
@@ -524,8 +520,7 @@  discard block
 block discarded – undo
524 520
 				$album_rows[$parent_id]['album_type_last_image'] = $row['album_type'];
525 521
 				$album_rows[$parent_id]['album_contest_marked'] = $row['contest_marked'];
526 522
 				$album_rows[$parent_id]['orig_album_last_image_time'] = $row['album_last_image_time'];
527
-			}
528
-			else if ($row['album_type'])
523
+			} else if ($row['album_type'])
529 524
 			{
530 525
 				$subalbums[$parent_id][$album_id]['display'] = ($row['display_on_index']) ? true : false;
531 526
 				$subalbums[$parent_id][$album_id]['name'] = $row['album_name'];
@@ -567,16 +562,14 @@  discard block
 block discarded – undo
567 562
 				{
568 563
 					$this->misc->markread('all');
569 564
 					$message = $this->language->lang('RETURN_INDEX', '<a href="' . $redirect . '">', '</a>');
570
-				}
571
-				else
565
+				} else
572 566
 				{
573 567
 					$this->misc->markread('albums', $album_ids);
574 568
 					$message = $this->language->lang('RETURN_ALBUM', '<a href="' . $redirect . '">', '</a>');
575 569
 				}
576 570
 				meta_refresh(3, $redirect);
577 571
 				trigger_error($this->language->lang('ALBUMS_MARKED') . '<br /><br />' . $message);
578
-			}
579
-			else
572
+			} else
580 573
 			{
581 574
 				$message = $this->language->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>');
582 575
 				meta_refresh(3, $redirect);
@@ -654,8 +647,7 @@  discard block
 block discarded – undo
654 647
 							'name'		=> $subalbum_row['name'],
655 648
 							'unread'	=> $subalbum_unread,
656 649
 						);
657
-					}
658
-					else
650
+					} else
659 651
 					{
660 652
 						unset($subalbums[$album_id][$subalbum_id]);
661 653
 					}
@@ -668,8 +660,7 @@  discard block
 block discarded – undo
668 660
 
669 661
 				$l_subalbums = (sizeof($subalbums[$album_id]) == 1) ? $this->language->lang('SUBALBUM') : $this->language->lang('SUBALBUMS');
670 662
 				$folder_image = ($album_unread) ? 'forum_unread_subforum' : 'forum_read_subforum';
671
-			}
672
-			else
663
+			} else
673 664
 			{
674 665
 				$folder_alt = ($album_unread) ? 'NEW_IMAGES' : 'NO_NEW_IMAGES';
675 666
 				$folder_image = ($album_unread) ? 'forum_unread' : 'forum_read';
@@ -695,8 +686,7 @@  discard block
 block discarded – undo
695 686
 				$lastimage_uc_name = '';//@todo phpbb_ext_gallery_core_image::generate_link('image_name', $phpbb_ext_gallery->config->get('link_image_name'), $lastimage_image_id, $lastimage_name, $lastimage_album_id);
696 687
 				// phpbb_ext_gallery_core_image::generate_link('lastimage_icon', $phpbb_ext_gallery->config->get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id);
697 688
 				$lastimage_uc_icon = '';//@todo phpbb_ext_gallery_core_image::generate_link('lastimage_icon', $phpbb_ext_gallery->config->get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id);
698
-			}
699
-			else
689
+			} else
700 690
 			{
701 691
 				$lastimage_time = $lastimage_album_type = $lastimage_contest_marked = 0;
702 692
 				$lastimage_uc_fake_thumbnail = $lastimage_uc_fake_thumbnail_url = $lastimage_uc_thumbnail = $lastimage_uc_name = $lastimage_uc_icon = '';
Please login to merge, or discard this patch.