Passed
Push — main ( 16d49b...d78e29 )
by TARIQ
111:03
created
brighty/wp-admin/includes/deprecated.php 1 patch
Braces   +98 added lines, -67 removed lines patch added patch discarded remove patch
@@ -136,8 +136,9 @@  discard block
 block discarded – undo
136 136
  */
137 137
 function wp_dropdown_cats( $current_cat = 0, $current_parent = 0, $category_parent = 0, $level = 0, $categories = 0 ) {
138 138
 	_deprecated_function( __FUNCTION__, '3.0.0', 'wp_dropdown_categories()' );
139
-	if (!$categories )
140
-		$categories = get_categories( array('hide_empty' => 0) );
139
+	if (!$categories ) {
140
+			$categories = get_categories( array('hide_empty' => 0) );
141
+	}
141 142
 
142 143
 	if ( $categories ) {
143 144
 		foreach ( $categories as $category ) {
@@ -145,8 +146,9 @@  discard block
 block discarded – undo
145 146
 				$pad = str_repeat( '– ', $level );
146 147
 				$category->name = esc_html( $category->name );
147 148
 				echo "\n\t<option value='$category->term_id'";
148
-				if ( $current_parent == $category->term_id )
149
-					echo " selected='selected'";
149
+				if ( $current_parent == $category->term_id ) {
150
+									echo " selected='selected'";
151
+				}
150 152
 				echo ">$pad$category->name</option>";
151 153
 				wp_dropdown_cats( $current_cat, $current_parent, $category->term_id, $level +1, $categories );
152 154
 			}
@@ -235,10 +237,12 @@  discard block
 block discarded – undo
235 237
 	_deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
236 238
 
237 239
 	global $wpdb;
238
-	if ( !is_multisite() )
239
-		$level_key = $wpdb->get_blog_prefix() . 'user_level';
240
-	else
241
-		$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.
240
+	if ( !is_multisite() ) {
241
+			$level_key = $wpdb->get_blog_prefix() . 'user_level';
242
+	} else {
243
+			$level_key = $wpdb->get_blog_prefix() . 'capabilities';
244
+	}
245
+	// WPMU site admins don't have user_levels.
242 246
 
243 247
 	return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
244 248
 }
@@ -286,25 +290,30 @@  discard block
 block discarded – undo
286 290
 
287 291
 	global $wpdb;
288 292
 
289
-	if ( ! $user = get_userdata( $user_id ) )
290
-		return array();
293
+	if ( ! $user = get_userdata( $user_id ) ) {
294
+			return array();
295
+	}
291 296
 	$post_type_obj = get_post_type_object($post_type);
292 297
 
293 298
 	if ( ! $user->has_cap($post_type_obj->cap->edit_others_posts) ) {
294
-		if ( $user->has_cap($post_type_obj->cap->edit_posts) || ! $exclude_zeros )
295
-			return array($user->ID);
296
-		else
297
-			return array();
299
+		if ( $user->has_cap($post_type_obj->cap->edit_posts) || ! $exclude_zeros ) {
300
+					return array($user->ID);
301
+		} else {
302
+					return array();
303
+		}
298 304
 	}
299 305
 
300
-	if ( !is_multisite() )
301
-		$level_key = $wpdb->get_blog_prefix() . 'user_level';
302
-	else
303
-		$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.
306
+	if ( !is_multisite() ) {
307
+			$level_key = $wpdb->get_blog_prefix() . 'user_level';
308
+	} else {
309
+			$level_key = $wpdb->get_blog_prefix() . 'capabilities';
310
+	}
311
+	// WPMU site admins don't have user_levels.
304 312
 
305 313
 	$query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
306
-	if ( $exclude_zeros )
307
-		$query .= " AND meta_value != '0'";
314
+	if ( $exclude_zeros ) {
315
+			$query .= " AND meta_value != '0'";
316
+	}
308 317
 
309 318
 	return $wpdb->get_col( $query );
310 319
 }
@@ -321,10 +330,12 @@  discard block
 block discarded – undo
321 330
 
322 331
 	global $wpdb;
323 332
 
324
-	if ( !is_multisite() )
325
-		$level_key = $wpdb->get_blog_prefix() . 'user_level';
326
-	else
327
-		$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.
333
+	if ( !is_multisite() ) {
334
+			$level_key = $wpdb->get_blog_prefix() . 'user_level';
335
+	} else {
336
+			$level_key = $wpdb->get_blog_prefix() . 'capabilities';
337
+	}
338
+	// WPMU site admins don't have user_levels.
328 339
 
329 340
 	return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
330 341
 }
@@ -536,8 +547,9 @@  discard block
 block discarded – undo
536 547
 		if ( $this->search_term ) {
537 548
 			$searches = array();
538 549
 			$search_sql = 'AND (';
539
-			foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col )
540
-				$searches[] = $wpdb->prepare( $col . ' LIKE %s', '%' . like_escape($this->search_term) . '%' );
550
+			foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col ) {
551
+							$searches[] = $wpdb->prepare( $col . ' LIKE %s', '%' . like_escape($this->search_term) . '%' );
552
+			}
541 553
 			$search_sql .= implode(' OR ', $searches);
542 554
 			$search_sql .= ')';
543 555
 		}
@@ -568,10 +580,13 @@  discard block
 block discarded – undo
568 580
 
569 581
 		$this->results = $wpdb->get_col("SELECT DISTINCT($wpdb->users.ID)" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit);
570 582
 
571
-		if ( $this->results )
572
-			$this->total_users_for_query = $wpdb->get_var("SELECT COUNT(DISTINCT($wpdb->users.ID))" . $this->query_from . $this->query_where); // No limit.
573
-		else
574
-			$this->search_errors = new WP_Error('no_matching_users_found', __('No users found.'));
583
+		if ( $this->results ) {
584
+					$this->total_users_for_query = $wpdb->get_var("SELECT COUNT(DISTINCT($wpdb->users.ID))" . $this->query_from . $this->query_where);
585
+		}
586
+		// No limit.
587
+		else {
588
+					$this->search_errors = new WP_Error('no_matching_users_found', __('No users found.'));
589
+		}
575 590
 	}
576 591
 
577 592
 	/**
@@ -591,10 +606,12 @@  discard block
 block discarded – undo
591 606
 	public function do_paging() {
592 607
 		if ( $this->total_users_for_query > $this->users_per_page ) { // Have to page the results.
593 608
 			$args = array();
594
-			if ( ! empty($this->search_term) )
595
-				$args['usersearch'] = urlencode($this->search_term);
596
-			if ( ! empty($this->role) )
597
-				$args['role'] = urlencode($this->role);
609
+			if ( ! empty($this->search_term) ) {
610
+							$args['usersearch'] = urlencode($this->search_term);
611
+			}
612
+			if ( ! empty($this->role) ) {
613
+							$args['role'] = urlencode($this->role);
614
+			}
598 615
 
599 616
 			$this->paging_text = paginate_links( array(
600 617
 				'total' => ceil($this->total_users_for_query / $this->users_per_page),
@@ -651,8 +668,9 @@  discard block
 block discarded – undo
651 668
 	 * @return bool
652 669
 	 */
653 670
 	function results_are_paged() {
654
-		if ( $this->paging_text )
655
-			return true;
671
+		if ( $this->paging_text ) {
672
+					return true;
673
+		}
656 674
 		return false;
657 675
 	}
658 676
 
@@ -665,8 +683,9 @@  discard block
 block discarded – undo
665 683
 	 * @return bool
666 684
 	 */
667 685
 	function is_search() {
668
-		if ( $this->search_term )
669
-			return true;
686
+		if ( $this->search_term ) {
687
+					return true;
688
+		}
670 689
 		return false;
671 690
 	}
672 691
 }
@@ -693,10 +712,11 @@  discard block
 block discarded – undo
693 712
 
694 713
 	$editable = get_editable_user_ids( $user_id );
695 714
 
696
-	if ( in_array($type, array('draft', 'pending')) )
697
-		$type_sql = " post_status = '$type' ";
698
-	else
699
-		$type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";
715
+	if ( in_array($type, array('draft', 'pending')) ) {
716
+			$type_sql = " post_status = '$type' ";
717
+	} else {
718
+			$type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";
719
+	}
700 720
 
701 721
 	$dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';
702 722
 
@@ -764,8 +784,9 @@  discard block
 block discarded – undo
764 784
 
765 785
 	static $num = 1;
766 786
 
767
-	if ( ! class_exists( '_WP_Editors', false ) )
768
-		require_once ABSPATH . WPINC . '/class-wp-editor.php';
787
+	if ( ! class_exists( '_WP_Editors', false ) ) {
788
+			require_once ABSPATH . WPINC . '/class-wp-editor.php';
789
+	}
769 790
 
770 791
 	$editor_id = 'content' . $num++;
771 792
 
@@ -821,8 +842,9 @@  discard block
 block discarded – undo
821 842
 
822 843
 	$current_screen = get_current_screen();
823 844
 
824
-	if ( ! $current_screen )
825
-		return '';
845
+	if ( ! $current_screen ) {
846
+			return '';
847
+	}
826 848
 
827 849
 	ob_start();
828 850
 	$current_screen->render_screen_layout();
@@ -841,8 +863,9 @@  discard block
 block discarded – undo
841 863
 
842 864
 	$current_screen = get_current_screen();
843 865
 
844
-	if ( ! $current_screen )
845
-		return '';
866
+	if ( ! $current_screen ) {
867
+			return '';
868
+	}
846 869
 
847 870
 	ob_start();
848 871
 	$current_screen->render_per_page_options();
@@ -992,8 +1015,9 @@  discard block
 block discarded – undo
992 1015
 function add_contextual_help( $screen, $help ) {
993 1016
 	_deprecated_function( __FUNCTION__, '3.3.0', 'get_current_screen()->add_help_tab()' );
994 1017
 
995
-	if ( is_string( $screen ) )
996
-		$screen = convert_to_screen( $screen );
1018
+	if ( is_string( $screen ) ) {
1019
+			$screen = convert_to_screen( $screen );
1020
+	}
997 1021
 
998 1022
 	WP_Screen::add_old_compat_help( $screen, $help );
999 1023
 }
@@ -1157,8 +1181,9 @@  discard block
 block discarded – undo
1157 1181
 function wp_update_core($current, $feedback = '') {
1158 1182
 	_deprecated_function( __FUNCTION__, '3.7.0', 'new Core_Upgrader();' );
1159 1183
 
1160
-	if ( !empty($feedback) )
1161
-		add_filter('update_feedback', $feedback);
1184
+	if ( !empty($feedback) ) {
1185
+			add_filter('update_feedback', $feedback);
1186
+	}
1162 1187
 
1163 1188
 	require ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
1164 1189
 	$upgrader = new Core_Upgrader();
@@ -1180,8 +1205,9 @@  discard block
 block discarded – undo
1180 1205
 function wp_update_plugin($plugin, $feedback = '') {
1181 1206
 	_deprecated_function( __FUNCTION__, '3.7.0', 'new Plugin_Upgrader();' );
1182 1207
 
1183
-	if ( !empty($feedback) )
1184
-		add_filter('update_feedback', $feedback);
1208
+	if ( !empty($feedback) ) {
1209
+			add_filter('update_feedback', $feedback);
1210
+	}
1185 1211
 
1186 1212
 	require ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
1187 1213
 	$upgrader = new Plugin_Upgrader();
@@ -1202,8 +1228,9 @@  discard block
 block discarded – undo
1202 1228
 function wp_update_theme($theme, $feedback = '') {
1203 1229
 	_deprecated_function( __FUNCTION__, '3.7.0', 'new Theme_Upgrader();' );
1204 1230
 
1205
-	if ( !empty($feedback) )
1206
-		add_filter('update_feedback', $feedback);
1231
+	if ( !empty($feedback) ) {
1232
+			add_filter('update_feedback', $feedback);
1233
+	}
1207 1234
 
1208 1235
 	require ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
1209 1236
 	$upgrader = new Theme_Upgrader();
@@ -1334,16 +1361,18 @@  discard block
 block discarded – undo
1334 1361
 	echo '<ul>';
1335 1362
 
1336 1363
 	foreach ( array( $popular ) as $feed ) {
1337
-		if ( is_wp_error( $feed ) || ! $feed->get_item_quantity() )
1338
-			continue;
1364
+		if ( is_wp_error( $feed ) || ! $feed->get_item_quantity() ) {
1365
+					continue;
1366
+		}
1339 1367
 
1340 1368
 		$items = $feed->get_items(0, 5);
1341 1369
 
1342 1370
 		// Pick a random, non-installed plugin.
1343 1371
 		while ( true ) {
1344 1372
 			// Abort this foreach loop iteration if there's no plugins left of this type.
1345
-			if ( 0 === count($items) )
1346
-				continue 2;
1373
+			if ( 0 === count($items) ) {
1374
+							continue 2;
1375
+			}
1347 1376
 
1348 1377
 			$item_key = array_rand($items);
1349 1378
 			$item = $items[$item_key];
@@ -1351,9 +1380,9 @@  discard block
 block discarded – undo
1351 1380
 			list($link, $frag) = explode( '#', $item->get_link() );
1352 1381
 
1353 1382
 			$link = esc_url($link);
1354
-			if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) )
1355
-				$slug = $matches[1];
1356
-			else {
1383
+			if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) ) {
1384
+							$slug = $matches[1];
1385
+			} else {
1357 1386
 				unset( $items[$item_key] );
1358 1387
 				continue;
1359 1388
 			}
@@ -1372,11 +1401,13 @@  discard block
 block discarded – undo
1372 1401
 		}
1373 1402
 
1374 1403
 		// Eliminate some common badly formed plugin descriptions.
1375
-		while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )
1376
-			unset($items[$item_key]);
1404
+		while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) ) {
1405
+					unset($items[$item_key]);
1406
+		}
1377 1407
 
1378
-		if ( !isset($items[$item_key]) )
1379
-			continue;
1408
+		if ( !isset($items[$item_key]) ) {
1409
+					continue;
1410
+		}
1380 1411
 
1381 1412
 		$raw_title = $item->get_title();
1382 1413
 
Please login to merge, or discard this patch.
brighty/wp-admin/includes/network.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -630,9 +630,11 @@
 block discarded – undo
630 630
 		);
631 631
 		echo '</p></li>';
632 632
 
633
-	else : // End $is_nginx. Construct an .htaccess file instead:
633
+	else {
634
+	    : // End $is_nginx. Construct an .htaccess file instead:
634 635
 
635 636
 		$ms_files_rewriting = '';
637
+	}
636 638
 		if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {
637 639
 			$ms_files_rewriting  = "\n# uploaded files\nRewriteRule ^";
638 640
 			$ms_files_rewriting .= $subdir_match . "files/(.+) {$rewrite_base}" . WPINC . "/ms-files.php?file={$subdir_replacement_12} [L]" . "\n";
Please login to merge, or discard this patch.
brighty/wp-admin/includes/class-wp-posts-list-table.php 1 patch
Braces   +20 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1624,10 +1624,13 @@  discard block
 block discarded – undo
1624 1624
 							<div id="bulk-titles"></div>
1625 1625
 						</div>
1626 1626
 
1627
-					<?php else : // $bulk ?>
1627
+					<?php else {
1628
+    : // $bulk ?>
1628 1629
 
1629 1630
 						<label>
1630
-							<span class="title"><?php _e( 'Title' ); ?></span>
1631
+							<span class="title"><?php _e( 'Title' );
1632
+}
1633
+?></span>
1631 1634
 							<span class="input-text-wrap"><input type="text" name="post_title" class="ptitle" value="" /></span>
1632 1635
 						</label>
1633 1636
 
@@ -1881,7 +1884,8 @@  discard block
 block discarded – undo
1881 1884
 
1882 1885
 						</div>
1883 1886
 
1884
-					<?php else : // $bulk ?>
1887
+					<?php else {
1888
+    : // $bulk ?>
1885 1889
 
1886 1890
 						<div class="inline-edit-group wp-clearfix">
1887 1891
 
@@ -1889,7 +1893,9 @@  discard block
 block discarded – undo
1889 1893
 
1890 1894
 							<label class="alignleft">
1891 1895
 								<input type="checkbox" name="comment_status" value="open" />
1892
-								<span class="checkbox-title"><?php _e( 'Allow Comments' ); ?></span>
1896
+								<span class="checkbox-title"><?php _e( 'Allow Comments' );
1897
+}
1898
+?></span>
1893 1899
 							</label>
1894 1900
 
1895 1901
 						<?php endif; ?>
@@ -1944,11 +1950,14 @@  discard block
 block discarded – undo
1944 1950
 									</select>
1945 1951
 								</label>
1946 1952
 
1947
-							<?php else : // $bulk ?>
1953
+							<?php else {
1954
+    : // $bulk ?>
1948 1955
 
1949 1956
 								<label class="alignleft">
1950 1957
 									<input type="checkbox" name="sticky" value="sticky" />
1951
-									<span class="checkbox-title"><?php _e( 'Make this post sticky' ); ?></span>
1958
+									<span class="checkbox-title"><?php _e( 'Make this post sticky' );
1959
+}
1960
+?></span>
1952 1961
 								</label>
1953 1962
 
1954 1963
 							<?php endif; // $bulk ?>
@@ -2017,8 +2026,11 @@  discard block
 block discarded – undo
2017 2026
 				<?php if ( ! $bulk ) : ?>
2018 2027
 					<?php wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ); ?>
2019 2028
 					<button type="button" class="button button-primary save"><?php _e( 'Update' ); ?></button>
2020
-				<?php else : ?>
2021
-					<?php submit_button( __( 'Update' ), 'primary', 'bulk_edit', false ); ?>
2029
+				<?php else {
2030
+    : ?>
2031
+					<?php submit_button( __( 'Update' ), 'primary', 'bulk_edit', false );
2032
+}
2033
+?>
2022 2034
 				<?php endif; ?>
2023 2035
 
2024 2036
 				<button type="button" class="button cancel"><?php _e( 'Cancel' ); ?></button>
Please login to merge, or discard this patch.
brighty/wp-admin/includes/upgrade.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -900,8 +900,10 @@
 block discarded – undo
900 900
 			$done_posts[] = $done_id->post_id;
901 901
 		endforeach;
902 902
 		$catwhere = ' AND ID NOT IN (' . implode( ',', $done_posts ) . ')';
903
-	else :
903
+	else {
904
+	    :
904 905
 		$catwhere = '';
906
+	}
905 907
 	endif;
906 908
 
907 909
 	$allposts = $wpdb->get_results( "SELECT ID, post_category FROM $wpdb->posts WHERE post_category != '0' $catwhere" );
Please login to merge, or discard this patch.
brighty/wp-admin/includes/class-ftp-pure.php 1 patch
Braces   +44 added lines, -16 removed lines patch added patch discarded remove patch
@@ -71,10 +71,14 @@  discard block
 block discarded – undo
71 71
 				$this->PushError($fnction,'Read failed');
72 72
 			} else {
73 73
 				$this->_message.=$tmp;
74
-				if(preg_match("/^([0-9]{3})(-(.*[".CRLF."]{1,2})+\\1)? [^".CRLF."]+[".CRLF."]{1,2}$/", $this->_message, $regs)) $go=false;
74
+				if(preg_match("/^([0-9]{3})(-(.*[".CRLF."]{1,2})+\\1)? [^".CRLF."]+[".CRLF."]{1,2}$/", $this->_message, $regs)) {
75
+				    $go=false;
76
+				}
75 77
 			}
76 78
 		} while($go);
77
-		if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF;
79
+		if($this->LocalEcho) {
80
+		    echo "GET < ".rtrim($this->_message, CRLF).CRLF;
81
+		}
78 82
 		$this->_code=(int)$regs[1];
79 83
 		return $result;
80 84
 	}
@@ -84,19 +88,25 @@  discard block
 block discarded – undo
84 88
 			$this->PushError($fnction,'Connect first');
85 89
 			return FALSE;
86 90
 		}
87
-		if($this->LocalEcho) echo "PUT > ",$cmd,CRLF;
91
+		if($this->LocalEcho) {
92
+		    echo "PUT > ",$cmd,CRLF;
93
+		}
88 94
 		$status=@fputs($this->_ftp_control_sock, $cmd.CRLF);
89 95
 		if($status===false) {
90 96
 			$this->PushError($fnction,'socket write failed');
91 97
 			return FALSE;
92 98
 		}
93 99
 		$this->_lastaction=time();
94
-		if(!$this->_readmsg($fnction)) return FALSE;
100
+		if(!$this->_readmsg($fnction)) {
101
+		    return FALSE;
102
+		}
95 103
 		return TRUE;
96 104
 	}
97 105
 
98 106
 	function _data_prepare($mode=FTP_ASCII) {
99
-		if(!$this->_settype($mode)) return FALSE;
107
+		if(!$this->_settype($mode)) {
108
+		    return FALSE;
109
+		}
100 110
 		if($this->_passive) {
101 111
 			if(!$this->_exec("PASV", "pasv")) {
102 112
 				$this->_data_close();
@@ -115,8 +125,9 @@  discard block
 block discarded – undo
115 125
 				$this->PushError("_data_prepare","fsockopen fails", $errstr." (".$errno.")");
116 126
 				$this->_data_close();
117 127
 				return FALSE;
128
+			} else {
129
+			    $this->_ftp_data_sock;
118 130
 			}
119
-			else $this->_ftp_data_sock;
120 131
 		} else {
121 132
 			$this->SendMSG("Only passive connections available!");
122 133
 			return FALSE;
@@ -125,24 +136,35 @@  discard block
 block discarded – undo
125 136
 	}
126 137
 
127 138
 	function _data_read($mode=FTP_ASCII, $fp=NULL) {
128
-		if(is_resource($fp)) $out=0;
129
-		else $out="";
139
+		if(is_resource($fp)) {
140
+		    $out=0;
141
+		} else {
142
+		    $out="";
143
+		}
130 144
 		if(!$this->_passive) {
131 145
 			$this->SendMSG("Only passive connections available!");
132 146
 			return FALSE;
133 147
 		}
134 148
 		while (!feof($this->_ftp_data_sock)) {
135 149
 			$block=fread($this->_ftp_data_sock, $this->_ftp_buff_size);
136
-			if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block);
137
-			if(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block));
138
-			else $out.=$block;
150
+			if($mode!=FTP_BINARY) {
151
+			    $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block);
152
+			}
153
+			if(is_resource($fp)) {
154
+			    $out+=fwrite($fp, $block, strlen($block));
155
+			} else {
156
+			    $out.=$block;
157
+			}
139 158
 		}
140 159
 		return $out;
141 160
 	}
142 161
 
143 162
 	function _data_write($mode=FTP_ASCII, $fp=NULL) {
144
-		if(is_resource($fp)) $out=0;
145
-		else $out="";
163
+		if(is_resource($fp)) {
164
+		    $out=0;
165
+		} else {
166
+		    $out="";
167
+		}
146 168
 		if(!$this->_passive) {
147 169
 			$this->SendMSG("Only passive connections available!");
148 170
 			return FALSE;
@@ -150,14 +172,20 @@  discard block
 block discarded – undo
150 172
 		if(is_resource($fp)) {
151 173
 			while(!feof($fp)) {
152 174
 				$block=fread($fp, $this->_ftp_buff_size);
153
-				if(!$this->_data_write_block($mode, $block)) return false;
175
+				if(!$this->_data_write_block($mode, $block)) {
176
+				    return false;
177
+				}
154 178
 			}
155
-		} elseif(!$this->_data_write_block($mode, $fp)) return false;
179
+		} elseif(!$this->_data_write_block($mode, $fp)) {
180
+		    return false;
181
+		}
156 182
 		return TRUE;
157 183
 	}
158 184
 
159 185
 	function _data_write_block($mode, $block) {
160
-		if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block);
186
+		if($mode!=FTP_BINARY) {
187
+		    $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block);
188
+		}
161 189
 		do {
162 190
 			if(($t=@fwrite($this->_ftp_data_sock, $block))===FALSE) {
163 191
 				$this->PushError("_data_write","Can't write to socket");
Please login to merge, or discard this patch.
brighty/wp-admin/includes/theme-install.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -119,8 +119,11 @@
 block discarded – undo
119 119
 		}
120 120
 		?>
121 121
 	</label>
122
-	<?php else : ?>
123
-	<label class="screen-reader-text" for="s"><?php _e( 'Search by keyword' ); ?></label>
122
+	<?php else {
123
+    : ?>
124
+	<label class="screen-reader-text" for="s"><?php _e( 'Search by keyword' );
125
+}
126
+?></label>
124 127
 	<?php endif; ?>
125 128
 	<input type="search" name="s" id="s" size="30" value="<?php echo esc_attr( $term ); ?>" autofocus="autofocus" />
126 129
 	<?php submit_button( __( 'Search' ), '', 'search', false ); ?>
Please login to merge, or discard this patch.
brighty/wp-admin/includes/class-ftp-sockets.php 1 patch
Braces   +47 added lines, -17 removed lines patch added patch discarded remove patch
@@ -55,7 +55,9 @@  discard block
 block discarded – undo
55 55
 			$this->PushError('_connect','socket create failed',socket_strerror(socket_last_error($sock)));
56 56
 			return FALSE;
57 57
 		}
58
-		if(!$this->_settimeout($sock)) return FALSE;
58
+		if(!$this->_settimeout($sock)) {
59
+		    return FALSE;
60
+		}
59 61
 		$this->SendMSG("Connecting to \"".$host.":".$port."\"");
60 62
 		if (!($res = @socket_connect($sock, $host, $port))) {
61 63
 			$this->PushError('_connect','socket connect failed',socket_strerror(socket_last_error($sock)));
@@ -85,7 +87,9 @@  discard block
 block discarded – undo
85 87
 				$go = !preg_match("/^([0-9]{3})(-.+\\1)? [^".CRLF."]+".CRLF."$/Us", $this->_message, $regs);
86 88
 			}
87 89
 		} while($go);
88
-		if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF;
90
+		if($this->LocalEcho) {
91
+		    echo "GET < ".rtrim($this->_message, CRLF).CRLF;
92
+		}
89 93
 		$this->_code=(int)$regs[1];
90 94
 		return $result;
91 95
 	}
@@ -95,19 +99,25 @@  discard block
 block discarded – undo
95 99
 			$this->PushError($fnction,'Connect first');
96 100
 			return FALSE;
97 101
 		}
98
-		if($this->LocalEcho) echo "PUT > ",$cmd,CRLF;
102
+		if($this->LocalEcho) {
103
+		    echo "PUT > ",$cmd,CRLF;
104
+		}
99 105
 		$status=@socket_write($this->_ftp_control_sock, $cmd.CRLF);
100 106
 		if($status===false) {
101 107
 			$this->PushError($fnction,'socket write failed', socket_strerror(socket_last_error($this->stream)));
102 108
 			return FALSE;
103 109
 		}
104 110
 		$this->_lastaction=time();
105
-		if(!$this->_readmsg($fnction)) return FALSE;
111
+		if(!$this->_readmsg($fnction)) {
112
+		    return FALSE;
113
+		}
106 114
 		return TRUE;
107 115
 	}
108 116
 
109 117
 	function _data_prepare($mode=FTP_ASCII) {
110
-		if(!$this->_settype($mode)) return FALSE;
118
+		if(!$this->_settype($mode)) {
119
+		    return FALSE;
120
+		}
111 121
 		$this->SendMSG("Creating data socket");
112 122
 		$this->_ftp_data_sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
113 123
 		if ($this->_ftp_data_sock < 0) {
@@ -135,8 +145,9 @@  discard block
 block discarded – undo
135 145
 				$this->PushError("_data_prepare","socket_connect", socket_strerror(socket_last_error($this->_ftp_data_sock)));
136 146
 				$this->_data_close();
137 147
 				return FALSE;
148
+			} else {
149
+			    $this->_ftp_temp_sock=$this->_ftp_data_sock;
138 150
 			}
139
-			else $this->_ftp_temp_sock=$this->_ftp_data_sock;
140 151
 		} else {
141 152
 			if(!@socket_getsockname($this->_ftp_control_sock, $addr, $port)) {
142 153
 				$this->PushError("_data_prepare","cannot get control socket information", socket_strerror(socket_last_error($this->_ftp_control_sock)));
@@ -172,8 +183,11 @@  discard block
 block discarded – undo
172 183
 
173 184
 	function _data_read($mode=FTP_ASCII, $fp=NULL) {
174 185
 		$NewLine=$this->_eol_code[$this->OS_local];
175
-		if(is_resource($fp)) $out=0;
176
-		else $out="";
186
+		if(is_resource($fp)) {
187
+		    $out=0;
188
+		} else {
189
+		    $out="";
190
+		}
177 191
 		if(!$this->_passive) {
178 192
 			$this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
179 193
 			$this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock);
@@ -185,18 +199,28 @@  discard block
 block discarded – undo
185 199
 		}
186 200
 
187 201
 		while(($block=@socket_read($this->_ftp_temp_sock, $this->_ftp_buff_size, PHP_BINARY_READ))!==false) {
188
-			if($block==="") break;
189
-			if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block);
190
-			if(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block));
191
-			else $out.=$block;
202
+			if($block==="") {
203
+			    break;
204
+			}
205
+			if($mode!=FTP_BINARY) {
206
+			    $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block);
207
+			}
208
+			if(is_resource($fp)) {
209
+			    $out+=fwrite($fp, $block, strlen($block));
210
+			} else {
211
+			    $out.=$block;
212
+			}
192 213
 		}
193 214
 		return $out;
194 215
 	}
195 216
 
196 217
 	function _data_write($mode=FTP_ASCII, $fp=NULL) {
197 218
 		$NewLine=$this->_eol_code[$this->OS_local];
198
-		if(is_resource($fp)) $out=0;
199
-		else $out="";
219
+		if(is_resource($fp)) {
220
+		    $out=0;
221
+		} else {
222
+		    $out="";
223
+		}
200 224
 		if(!$this->_passive) {
201 225
 			$this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
202 226
 			$this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock);
@@ -209,14 +233,20 @@  discard block
 block discarded – undo
209 233
 		if(is_resource($fp)) {
210 234
 			while(!feof($fp)) {
211 235
 				$block=fread($fp, $this->_ftp_buff_size);
212
-				if(!$this->_data_write_block($mode, $block)) return false;
236
+				if(!$this->_data_write_block($mode, $block)) {
237
+				    return false;
238
+				}
213 239
 			}
214
-		} elseif(!$this->_data_write_block($mode, $fp)) return false;
240
+		} elseif(!$this->_data_write_block($mode, $fp)) {
241
+		    return false;
242
+		}
215 243
 		return true;
216 244
 	}
217 245
 
218 246
 	function _data_write_block($mode, $block) {
219
-		if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block);
247
+		if($mode!=FTP_BINARY) {
248
+		    $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block);
249
+		}
220 250
 		do {
221 251
 			if(($t=@socket_write($this->_ftp_temp_sock, $block))===FALSE) {
222 252
 				$this->PushError("_data_write","socket_write", socket_strerror(socket_last_error($this->_ftp_temp_sock)));
Please login to merge, or discard this patch.
brighty/wp-admin/includes/meta-boxes.php 1 patch
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -148,8 +148,11 @@  discard block
 block discarded – undo
148 148
 							<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e( 'Pending Review' ); ?></option>
149 149
 						<?php if ( 'auto-draft' === $post->post_status ) : ?>
150 150
 							<option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option>
151
-						<?php else : ?>
152
-							<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option>
151
+						<?php else {
152
+    : ?>
153
+							<option<?php selected( $post->post_status, 'draft' );
154
+}
155
+?> value='draft'><?php _e( 'Draft' ); ?></option>
153 156
 						<?php endif; ?>
154 157
 					</select>
155 158
 					<a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e( 'OK' ); ?></a>
@@ -354,15 +357,21 @@  discard block
 block discarded – undo
354 357
 					<input name="original_publish" type="hidden" id="original_publish" value="<?php echo esc_attr_x( 'Schedule', 'post action/button label' ); ?>" />
355 358
 					<?php submit_button( _x( 'Schedule', 'post action/button label' ), 'primary large', 'publish', false ); ?>
356 359
 					<?php
357
-				else :
360
+				else {
361
+				    :
358 362
 					?>
359
-					<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Publish' ); ?>" />
363
+					<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Publish' );
364
+				}
365
+				?>" />
360 366
 					<?php submit_button( __( 'Publish' ), 'primary large', 'publish', false ); ?>
361 367
 					<?php
362 368
 				endif;
363
-			else :
369
+			else {
370
+			    :
364 371
 				?>
365
-				<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Submit for Review' ); ?>" />
372
+				<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Submit for Review' );
373
+			}
374
+			?>" />
366 375
 				<?php submit_button( __( 'Submit for Review' ), 'primary large', 'publish', false ); ?>
367 376
 				<?php
368 377
 			endif;
Please login to merge, or discard this patch.
brighty/wp-admin/includes/template.php 1 patch
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -451,9 +451,12 @@  discard block
 block discarded – undo
451 451
 <form method="get">
452 452
 	<?php if ( $table_row ) : ?>
453 453
 <table style="display:none;"><tbody id="com-reply"><tr id="replyrow" class="inline-edit-row" style="display:none;"><td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="colspanchange">
454
-<?php else : ?>
454
+<?php else {
455
+    : ?>
455 456
 <div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;">
456
-<?php endif; ?>
457
+<?php endif;
458
+}
459
+?>
457 460
 	<fieldset class="comment-reply">
458 461
 	<legend>
459 462
 		<span class="hidden" id="editlegend"><?php _e( 'Edit Comment' ); ?></span>
@@ -525,9 +528,12 @@  discard block
 block discarded – undo
525 528
 	</fieldset>
526 529
 	<?php if ( $table_row ) : ?>
527 530
 </td></tr></tbody></table>
528
-	<?php else : ?>
531
+	<?php else {
532
+    : ?>
529 533
 </div></div>
530
-	<?php endif; ?>
534
+	<?php endif;
535
+}
536
+?>
531 537
 </form>
532 538
 	<?php
533 539
 }
@@ -979,9 +985,12 @@  discard block
 block discarded – undo
979 985
 		<div class="error"><p><?php _e( 'Before you can upload your import file, you will need to fix the following error:' ); ?></p>
980 986
 		<p><strong><?php echo $upload_dir['error']; ?></strong></p></div>
981 987
 		<?php
982
-	else :
988
+	else {
989
+	    :
983 990
 		?>
984
-<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) ); ?>">
991
+<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) );
992
+	}
993
+	?>">
985 994
 <p>
986 995
 		<?php
987 996
 		printf(
Please login to merge, or discard this patch.