Passed
Push — main ( aaef5c...e4c121 )
by TARIQ
71:39
created
wp/wp-admin/users.php 1 patch
Braces   +30 added lines, -12 removed lines patch added patch discarded remove patch
@@ -326,8 +326,11 @@  discard block
 block discarded – undo
326 326
 
327 327
 		<?php if ( 1 === count( $all_userids ) ) : ?>
328 328
 	<p><?php _e( 'You have specified this user for deletion:' ); ?></p>
329
-		<?php else : ?>
330
-	<p><?php _e( 'You have specified these users for deletion:' ); ?></p>
329
+		<?php else {
330
+    : ?>
331
+	<p><?php _e( 'You have specified these users for deletion:' );
332
+}
333
+?></p>
331 334
 		<?php endif; ?>
332 335
 
333 336
 <ul>
@@ -352,11 +355,17 @@  discard block
 block discarded – undo
352 355
 			if ( ! $users_have_content ) :
353 356
 				?>
354 357
 			<input type="hidden" name="delete_option" value="delete" />
355
-			<?php else : ?>
358
+			<?php else {
359
+    : ?>
356 360
 				<?php if ( 1 == $go_delete ) : ?>
357
-			<fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p>
358
-		<?php else : ?>
359
-			<fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p>
361
+			<fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' );
362
+}
363
+?></legend></p>
364
+		<?php else {
365
+    : ?>
366
+			<fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' );
367
+}
368
+?></legend></p>
360 369
 		<?php endif; ?>
361 370
 		<ul style="list-style:none;">
362 371
 			<li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" />
@@ -389,8 +398,11 @@  discard block
 block discarded – undo
389 398
 			?>
390 399
 	<input type="hidden" name="action" value="dodelete" />
391 400
 			<?php submit_button( __( 'Confirm Deletion' ), 'primary' ); ?>
392
-	<?php else : ?>
393
-	<p><?php _e( 'There are no valid users selected for deletion.' ); ?></p>
401
+	<?php else {
402
+    : ?>
403
+	<p><?php _e( 'There are no valid users selected for deletion.' );
404
+}
405
+?></p>
394 406
 	<?php endif; ?>
395 407
 	</div>
396 408
 	</form>
@@ -463,8 +475,11 @@  discard block
 block discarded – undo
463 475
 
464 476
 		<?php if ( 1 === count( $userids ) ) : ?>
465 477
 	<p><?php _e( 'You have specified this user for removal:' ); ?></p>
466
-		<?php else : ?>
467
-	<p><?php _e( 'You have specified these users for removal:' ); ?></p>
478
+		<?php else {
479
+    : ?>
480
+	<p><?php _e( 'You have specified these users for removal:' );
481
+}
482
+?></p>
468 483
 		<?php endif; ?>
469 484
 
470 485
 <ul>
@@ -487,8 +502,11 @@  discard block
 block discarded – undo
487 502
 		<?php if ( $go_remove ) : ?>
488 503
 		<input type="hidden" name="action" value="doremove" />
489 504
 			<?php submit_button( __( 'Confirm Removal' ), 'primary' ); ?>
490
-	<?php else : ?>
491
-	<p><?php _e( 'There are no valid users selected for removal.' ); ?></p>
505
+	<?php else {
506
+    : ?>
507
+	<p><?php _e( 'There are no valid users selected for removal.' );
508
+}
509
+?></p>
492 510
 	<?php endif; ?>
493 511
 	</div>
494 512
 	</form>
Please login to merge, or discard this patch.
wp/wp-admin/my-sites.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,8 @@  discard block
 block discarded – undo
77 77
 	echo '<p>';
78 78
 	_e( 'You must be a member of at least one site to use this page.' );
79 79
 	echo '</p>';
80
-else :
80
+else {
81
+    :
81 82
 	?>
82 83
 
83 84
 <hr class="wp-header-end">
@@ -85,6 +86,7 @@  discard block
 block discarded – undo
85 86
 <form id="myblogs" method="post">
86 87
 	<?php
87 88
 	choose_primary_blog();
89
+}
88 90
 	/**
89 91
 	 * Fires before the sites list on the My Sites screen.
90 92
 	 *
Please login to merge, or discard this patch.
wp/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.
wp/wp-admin/includes/ms.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -872,8 +872,11 @@  discard block
 block discarded – undo
872 872
 
873 873
 	<?php if ( 1 === count( $users ) ) : ?>
874 874
 		<p><?php _e( 'You have chosen to delete the user from all networks and sites.' ); ?></p>
875
-	<?php else : ?>
876
-		<p><?php _e( 'You have chosen to delete the following users from all networks and sites.' ); ?></p>
875
+	<?php else {
876
+    : ?>
877
+		<p><?php _e( 'You have chosen to delete the following users from all networks and sites.' );
878
+}
879
+?></p>
877 880
 	<?php endif; ?>
878 881
 
879 882
 	<form action="users.php?action=dodelete" method="post">
@@ -991,8 +994,11 @@  discard block
 block discarded – undo
991 994
 	if ( 1 === count( $users ) ) :
992 995
 		?>
993 996
 		<p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, the user will be permanently removed.' ); ?></p>
994
-	<?php else : ?>
995
-		<p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, these users will be permanently removed.' ); ?></p>
997
+	<?php else {
998
+    : ?>
999
+		<p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, these users will be permanently removed.' );
1000
+}
1001
+?></p>
996 1002
 		<?php
997 1003
 	endif;
998 1004
 
Please login to merge, or discard this patch.
wp/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.
wp/wp-admin/includes/class-custom-image-header.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -697,8 +697,11 @@
 block discarded – undo
697 697
 <td>
698 698
 			<?php if ( current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
699 699
 	<p><?php _e( 'If you don&lsquo;t want to upload your own image, you can use one of these cool headers, or show a random one.' ); ?></p>
700
-	<?php else : ?>
701
-	<p><?php _e( 'You can use one of these cool headers or show a random one on each page.' ); ?></p>
700
+	<?php else {
701
+    : ?>
702
+	<p><?php _e( 'You can use one of these cool headers or show a random one on each page.' );
703
+}
704
+?></p>
702 705
 	<?php endif; ?>
703 706
 			<?php
704 707
 			$this->show_header_selector( 'default' );
Please login to merge, or discard this patch.
wp/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( '&#8211; ', $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.
wp/wp-admin/includes/class-pclzip.php 1 patch
Braces   +121 added lines, -170 removed lines patch added patch discarded remove patch
@@ -328,8 +328,7 @@  discard block
 block discarded – undo
328 328
         // ----- Look for the optional second argument
329 329
         if ($v_size == 2) {
330 330
           $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];
331
-        }
332
-        else if ($v_size > 2) {
331
+        } else if ($v_size > 2) {
333 332
           PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,
334 333
 		                       "Invalid number / type of arguments");
335 334
           return 0;
@@ -378,8 +377,7 @@  discard block
 block discarded – undo
378 377
       foreach ($v_string_list as $v_string) {
379 378
         if ($v_string != '') {
380 379
           $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
381
-        }
382
-        else {
380
+        } else {
383 381
         }
384 382
       }
385 383
     }
@@ -513,8 +511,7 @@  discard block
 block discarded – undo
513 511
         // ----- Look for the optional second argument
514 512
         if ($v_size == 2) {
515 513
           $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];
516
-        }
517
-        else if ($v_size > 2) {
514
+        } else if ($v_size > 2) {
518 515
           // ----- Error log
519 516
           PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
520 517
 
@@ -790,8 +787,7 @@  discard block
 block discarded – undo
790 787
         // ----- Look for the optional second argument
791 788
         if ($v_size == 2) {
792 789
           $v_remove_path = $v_arg_list[1];
793
-        }
794
-        else if ($v_size > 2) {
790
+        } else if ($v_size > 2) {
795 791
           // ----- Error log
796 792
           PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
797 793
 
@@ -935,8 +931,7 @@  discard block
 block discarded – undo
935 931
         }
936 932
         if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) {
937 933
           $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
938
-        }
939
-        else {
934
+        } else {
940 935
         }
941 936
       }
942 937
 
@@ -951,8 +946,7 @@  discard block
 block discarded – undo
951 946
         // ----- Look for the optional second argument
952 947
         if ($v_size == 2) {
953 948
           $v_remove_path = $v_arg_list[1];
954
-        }
955
-        else if ($v_size > 2) {
949
+        } else if ($v_size > 2) {
956 950
           // ----- Error log
957 951
           PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
958 952
 
@@ -1188,8 +1182,7 @@  discard block
 block discarded – undo
1188 1182
         // ----- Error log
1189 1183
         PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'");
1190 1184
         $v_result = PCLZIP_ERR_MISSING_FILE;
1191
-      }
1192
-      else {
1185
+      } else {
1193 1186
         // ----- Duplicate the archive
1194 1187
         $v_result = $this->privDuplicate($p_archive);
1195 1188
       }
@@ -1277,8 +1270,7 @@  discard block
 block discarded – undo
1277 1270
   {
1278 1271
     if (PCLZIP_ERROR_EXTERNAL == 1) {
1279 1272
       return(PclErrorCode());
1280
-    }
1281
-    else {
1273
+    } else {
1282 1274
       return($this->error_code);
1283 1275
     }
1284 1276
   }
@@ -1316,15 +1308,13 @@  discard block
 block discarded – undo
1316 1308
 
1317 1309
     if (isset($v_name[$this->error_code])) {
1318 1310
       $v_value = $v_name[$this->error_code];
1319
-    }
1320
-    else {
1311
+    } else {
1321 1312
       $v_value = 'NoName';
1322 1313
     }
1323 1314
 
1324 1315
     if ($p_with_code) {
1325 1316
       return($v_value.' ('.$this->error_code.')');
1326
-    }
1327
-    else {
1317
+    } else {
1328 1318
       return($v_value);
1329 1319
     }
1330 1320
   }
@@ -1339,12 +1329,10 @@  discard block
 block discarded – undo
1339 1329
   {
1340 1330
     if (PCLZIP_ERROR_EXTERNAL == 1) {
1341 1331
       return(PclErrorString());
1342
-    }
1343
-    else {
1332
+    } else {
1344 1333
       if ($p_full) {
1345 1334
         return($this->errorName(true)." : ".$this->error_string);
1346
-      }
1347
-      else {
1335
+      } else {
1348 1336
         return($this->error_string." [code ".$this->error_code."]");
1349 1337
       }
1350 1338
     }
@@ -1529,8 +1517,7 @@  discard block
 block discarded – undo
1529 1517
               && ($p_options_list[$i+1] != '')) {
1530 1518
             $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE);
1531 1519
             $i++;
1532
-          }
1533
-          else {
1520
+          } else {
1534 1521
           }
1535 1522
         break;
1536 1523
 
@@ -1548,11 +1535,9 @@  discard block
 block discarded – undo
1548 1535
           // ----- Get the value
1549 1536
           if (is_string($p_options_list[$i+1])) {
1550 1537
               $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1];
1551
-          }
1552
-          else if (is_array($p_options_list[$i+1])) {
1538
+          } else if (is_array($p_options_list[$i+1])) {
1553 1539
               $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
1554
-          }
1555
-          else {
1540
+          } else {
1556 1541
             // ----- Error log
1557 1542
             PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
1558 1543
 
@@ -1581,8 +1566,7 @@  discard block
 block discarded – undo
1581 1566
           // ----- Get the value
1582 1567
           if (is_string($p_options_list[$i+1])) {
1583 1568
               $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
1584
-          }
1585
-          else {
1569
+          } else {
1586 1570
             // ----- Error log
1587 1571
             PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
1588 1572
 
@@ -1611,8 +1595,7 @@  discard block
 block discarded – undo
1611 1595
           // ----- Get the value
1612 1596
           if (is_string($p_options_list[$i+1])) {
1613 1597
               $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
1614
-          }
1615
-          else {
1598
+          } else {
1616 1599
             // ----- Error log
1617 1600
             PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE,
1618 1601
 			                     "Wrong parameter value for option '"
@@ -1645,14 +1628,11 @@  discard block
 block discarded – undo
1645 1628
 
1646 1629
               // ----- Parse items
1647 1630
               $v_work_list = explode(",", $p_options_list[$i+1]);
1648
-          }
1649
-          else if (is_integer($p_options_list[$i+1])) {
1631
+          } else if (is_integer($p_options_list[$i+1])) {
1650 1632
               $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1];
1651
-          }
1652
-          else if (is_array($p_options_list[$i+1])) {
1633
+          } else if (is_array($p_options_list[$i+1])) {
1653 1634
               $v_work_list = $p_options_list[$i+1];
1654
-          }
1655
-          else {
1635
+          } else {
1656 1636
             // ----- Error log
1657 1637
             PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'");
1658 1638
 
@@ -1679,13 +1659,11 @@  discard block
 block discarded – undo
1679 1659
                   // ----- Set the option value
1680 1660
                   $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0];
1681 1661
                   $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[0];
1682
-              }
1683
-              elseif ($v_size_item_list == 2) {
1662
+              } elseif ($v_size_item_list == 2) {
1684 1663
                   // ----- Set the option value
1685 1664
                   $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0];
1686 1665
                   $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[1];
1687
-              }
1688
-              else {
1666
+              } else {
1689 1667
                   // ----- Error log
1690 1668
                   PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Too many values in index range for option '".PclZipUtilOptionText($p_options_list[$i])."'");
1691 1669
 
@@ -1842,14 +1820,17 @@  discard block
 block discarded – undo
1842 1820
     $v_memory_limit_int = (int) $v_memory_limit;
1843 1821
     $last = strtolower(substr($v_memory_limit, -1));
1844 1822
 
1845
-    if($last == 'g')
1846
-        //$v_memory_limit_int = $v_memory_limit_int*1024*1024*1024;
1823
+    if($last == 'g') {
1824
+            //$v_memory_limit_int = $v_memory_limit_int*1024*1024*1024;
1847 1825
         $v_memory_limit_int = $v_memory_limit_int*1073741824;
1848
-    if($last == 'm')
1849
-        //$v_memory_limit_int = $v_memory_limit_int*1024*1024;
1826
+    }
1827
+    if($last == 'm') {
1828
+            //$v_memory_limit_int = $v_memory_limit_int*1024*1024;
1850 1829
         $v_memory_limit_int = $v_memory_limit_int*1048576;
1851
-    if($last == 'k')
1852
-        $v_memory_limit_int = $v_memory_limit_int*1024;
1830
+    }
1831
+    if($last == 'k') {
1832
+            $v_memory_limit_int = $v_memory_limit_int*1024;
1833
+    }
1853 1834
 
1854 1835
     $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit_int*PCLZIP_TEMPORARY_FILE_RATIO);
1855 1836
 
@@ -2022,15 +2003,12 @@  discard block
 block discarded – undo
2022 2003
       if (file_exists($v_descr['filename'])) {
2023 2004
         if (@is_file($v_descr['filename'])) {
2024 2005
           $v_descr['type'] = 'file';
2025
-        }
2026
-        else if (@is_dir($v_descr['filename'])) {
2006
+        } else if (@is_dir($v_descr['filename'])) {
2027 2007
           $v_descr['type'] = 'folder';
2028
-        }
2029
-        else if (@is_link($v_descr['filename'])) {
2008
+        } else if (@is_link($v_descr['filename'])) {
2030 2009
           // skip
2031 2010
           continue;
2032
-        }
2033
-        else {
2011
+        } else {
2034 2012
           // skip
2035 2013
           continue;
2036 2014
         }
@@ -2079,8 +2057,7 @@  discard block
 block discarded – undo
2079 2057
                  && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) {
2080 2058
               if ($v_descr['stored_filename'] != '') {
2081 2059
                 $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler;
2082
-              }
2083
-              else {
2060
+              } else {
2084 2061
                 $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler;
2085 2062
               }
2086 2063
             }
@@ -2089,8 +2066,7 @@  discard block
 block discarded – undo
2089 2066
           }
2090 2067
 
2091 2068
           @closedir($v_folder_handler);
2092
-        }
2093
-        else {
2069
+        } else {
2094 2070
           // TBC : unable to open folder in read mode
2095 2071
         }
2096 2072
 
@@ -2103,8 +2079,7 @@  discard block
 block discarded – undo
2103 2079
 
2104 2080
           // ----- Concat the resulting list
2105 2081
           $v_result_list = array_merge($v_result_list, $v_dirlist_descr);
2106
-        }
2107
-        else {
2082
+        } else {
2108 2083
         }
2109 2084
 
2110 2085
         // ----- Free local array
@@ -2378,8 +2353,9 @@  discard block
 block discarded – undo
2378 2353
   {
2379 2354
     $v_result=1;
2380 2355
 
2381
-    if ($this->zip_fd != 0)
2382
-      @fclose($this->zip_fd);
2356
+    if ($this->zip_fd != 0) {
2357
+          @fclose($this->zip_fd);
2358
+    }
2383 2359
     $this->zip_fd = 0;
2384 2360
 
2385 2361
     // ----- Return
@@ -2596,11 +2572,9 @@  discard block
 block discarded – undo
2596 2572
     // ----- Look for filetime
2597 2573
     if (isset($p_filedescr['mtime'])) {
2598 2574
       $p_header['mtime'] = $p_filedescr['mtime'];
2599
-    }
2600
-    else if ($p_filedescr['type'] == 'virtual_file') {
2575
+    } else if ($p_filedescr['type'] == 'virtual_file') {
2601 2576
       $p_header['mtime'] = time();
2602
-    }
2603
-    else {
2577
+    } else {
2604 2578
       $p_header['mtime'] = filemtime($p_filename);
2605 2579
     }
2606 2580
 
@@ -2608,8 +2582,7 @@  discard block
 block discarded – undo
2608 2582
     if (isset($p_filedescr['comment'])) {
2609 2583
       $p_header['comment_len'] = strlen($p_filedescr['comment']);
2610 2584
       $p_header['comment'] = $p_filedescr['comment'];
2611
-    }
2612
-    else {
2585
+    } else {
2613 2586
       $p_header['comment_len'] = 0;
2614 2587
       $p_header['comment'] = '';
2615 2588
     }
@@ -2676,8 +2649,7 @@  discard block
 block discarded – undo
2676 2649
         // ----- Read the file content
2677 2650
         if ($p_header['size'] > 0) {
2678 2651
           $v_content = @fread($v_file, $p_header['size']);
2679
-        }
2680
-        else {
2652
+        } else {
2681 2653
           $v_content = '';
2682 2654
         }
2683 2655
 
@@ -2923,20 +2895,17 @@  discard block
 block discarded – undo
2923 2895
     $p_filename = $p_filedescr['filename'];
2924 2896
     if (isset($p_options[PCLZIP_OPT_ADD_PATH])) {
2925 2897
       $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH];
2926
-    }
2927
-    else {
2898
+    } else {
2928 2899
       $p_add_dir = '';
2929 2900
     }
2930 2901
     if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) {
2931 2902
       $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH];
2932
-    }
2933
-    else {
2903
+    } else {
2934 2904
       $p_remove_dir = '';
2935 2905
     }
2936 2906
     if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
2937 2907
       $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH];
2938
-    }
2939
-    else {
2908
+    } else {
2940 2909
       $p_remove_all_dir = 0;
2941 2910
     }
2942 2911
 
@@ -2959,8 +2928,7 @@  discard block
 block discarded – undo
2959 2928
           $v_dir = $v_path_info['dirname'].'/';
2960 2929
         }
2961 2930
         $v_stored_filename = $v_dir.$p_filedescr['new_short_name'];
2962
-      }
2963
-      else {
2931
+      } else {
2964 2932
         // ----- Calculate the stored filename
2965 2933
         $v_stored_filename = $p_filename;
2966 2934
       }
@@ -2971,8 +2939,9 @@  discard block
 block discarded – undo
2971 2939
       }
2972 2940
       // ----- Look for partial path remove
2973 2941
       else if ($p_remove_dir != "") {
2974
-        if (substr($p_remove_dir, -1) != '/')
2975
-          $p_remove_dir .= "/";
2942
+        if (substr($p_remove_dir, -1) != '/') {
2943
+                  $p_remove_dir .= "/";
2944
+        }
2976 2945
 
2977 2946
         if (   (substr($p_filename, 0, 2) == "./")
2978 2947
             || (substr($p_remove_dir, 0, 2) == "./")) {
@@ -2992,8 +2961,7 @@  discard block
 block discarded – undo
2992 2961
         if ($v_compare > 0) {
2993 2962
           if ($v_compare == 2) {
2994 2963
             $v_stored_filename = "";
2995
-          }
2996
-          else {
2964
+          } else {
2997 2965
             $v_stored_filename = substr($v_stored_filename,
2998 2966
                                         strlen($p_remove_dir));
2999 2967
           }
@@ -3005,10 +2973,11 @@  discard block
 block discarded – undo
3005 2973
 
3006 2974
       // ----- Look for path to add
3007 2975
       if ($p_add_dir != "") {
3008
-        if (substr($p_add_dir, -1) == "/")
3009
-          $v_stored_filename = $p_add_dir.$v_stored_filename;
3010
-        else
3011
-          $v_stored_filename = $p_add_dir."/".$v_stored_filename;
2976
+        if (substr($p_add_dir, -1) == "/") {
2977
+                  $v_stored_filename = $p_add_dir.$v_stored_filename;
2978
+        } else {
2979
+                  $v_stored_filename = $p_add_dir."/".$v_stored_filename;
2980
+        }
3012 2981
       }
3013 2982
     }
3014 2983
 
@@ -3291,8 +3260,9 @@  discard block
 block discarded – undo
3291 3260
     if (   ($p_path == "")
3292 3261
 	    || (   (substr($p_path, 0, 1) != "/")
3293 3262
 		    && (substr($p_path, 0, 3) != "../")
3294
-			&& (substr($p_path,1,2)!=":/")))
3295
-      $p_path = "./".$p_path;
3263
+			&& (substr($p_path,1,2)!=":/"))) {
3264
+          $p_path = "./".$p_path;
3265
+    }
3296 3266
 
3297 3267
     // ----- Reduce the path last (and duplicated) '/'
3298 3268
     if (($p_path != "./") && ($p_path != "/"))
@@ -3778,8 +3748,7 @@  discard block
 block discarded – undo
3778 3748
         // ----- Change the file status
3779 3749
         if (   (isset($p_options[PCLZIP_OPT_REPLACE_NEWER]))
3780 3750
 		    && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) {
3781
-	  	  }
3782
-		    else {
3751
+	  	  } else {
3783 3752
             $p_entry['status'] = "newer_exist";
3784 3753
 
3785 3754
             // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
@@ -3795,19 +3764,19 @@  discard block
 block discarded – undo
3795 3764
                 return PclZip::errorCode();
3796 3765
 		      }
3797 3766
 		    }
3798
-      }
3799
-      else {
3767
+      } else {
3800 3768
       }
3801 3769
     }
3802 3770
 
3803 3771
     // ----- Check the directory availability and create it if necessary
3804 3772
     else {
3805
-      if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/'))
3806
-        $v_dir_to_check = $p_entry['filename'];
3807
-      else if (!strstr($p_entry['filename'], "/"))
3808
-        $v_dir_to_check = "";
3809
-      else
3810
-        $v_dir_to_check = dirname($p_entry['filename']);
3773
+      if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/')) {
3774
+              $v_dir_to_check = $p_entry['filename'];
3775
+      } else if (!strstr($p_entry['filename'], "/")) {
3776
+              $v_dir_to_check = "";
3777
+      } else {
3778
+              $v_dir_to_check = dirname($p_entry['filename']);
3779
+      }
3811 3780
 
3812 3781
         if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) {
3813 3782
 
@@ -3863,8 +3832,7 @@  discard block
 block discarded – undo
3863 3832
           touch($p_entry['filename'], $p_entry['mtime']);
3864 3833
 
3865 3834
 
3866
-        }
3867
-        else {
3835
+        } else {
3868 3836
           // ----- TBC
3869 3837
           // Need to be finished
3870 3838
           if (($p_entry['flag'] & 1) == 1) {
@@ -3891,8 +3859,7 @@  discard block
 block discarded – undo
3891 3859
             // ----- Read the compressed file in a buffer (one shot)
3892 3860
             if ($p_entry['compressed_size'] > 0) {
3893 3861
               $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
3894
-            }
3895
-            else {
3862
+            } else {
3896 3863
               $v_buffer = '';
3897 3864
             }
3898 3865
 
@@ -4108,22 +4075,19 @@  discard block
 block discarded – undo
4108 4075
           // ----- Read the file in a buffer (one shot)
4109 4076
           if ($p_entry['compressed_size'] > 0) {
4110 4077
             $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
4111
-          }
4112
-          else {
4078
+          } else {
4113 4079
             $v_buffer = '';
4114 4080
           }
4115 4081
 
4116 4082
           // ----- Send the file to the output
4117 4083
           echo $v_buffer;
4118 4084
           unset($v_buffer);
4119
-        }
4120
-        else {
4085
+        } else {
4121 4086
 
4122 4087
           // ----- Read the compressed file in a buffer (one shot)
4123 4088
           if ($p_entry['compressed_size'] > 0) {
4124 4089
             $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
4125
-          }
4126
-          else {
4090
+          } else {
4127 4091
             $v_buffer = '';
4128 4092
           }
4129 4093
 
@@ -4231,18 +4195,15 @@  discard block
 block discarded – undo
4231 4195
           // ----- Reading the file
4232 4196
           if ($p_entry['compressed_size'] > 0) {
4233 4197
             $p_string = @fread($this->zip_fd, $p_entry['compressed_size']);
4234
-          }
4235
-          else {
4198
+          } else {
4236 4199
             $p_string = '';
4237 4200
           }
4238
-        }
4239
-        else {
4201
+        } else {
4240 4202
 
4241 4203
           // ----- Reading the file
4242 4204
           if ($p_entry['compressed_size'] > 0) {
4243 4205
             $v_data = @fread($this->zip_fd, $p_entry['compressed_size']);
4244
-          }
4245
-          else {
4206
+          } else {
4246 4207
             $v_data = '';
4247 4208
           }
4248 4209
 
@@ -4253,8 +4214,7 @@  discard block
 block discarded – undo
4253 4214
         }
4254 4215
 
4255 4216
         // ----- Trace
4256
-      }
4257
-      else {
4217
+      } else {
4258 4218
           // TBC : error : can not extract a folder in a string
4259 4219
       }
4260 4220
 
@@ -4346,8 +4306,7 @@  discard block
 block discarded – undo
4346 4306
     // ----- Get extra_fields
4347 4307
     if ($v_data['extra_len'] != 0) {
4348 4308
       $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']);
4349
-    }
4350
-    else {
4309
+    } else {
4351 4310
       $p_header['extra'] = '';
4352 4311
     }
4353 4312
 
@@ -4378,8 +4337,7 @@  discard block
 block discarded – undo
4378 4337
       // ----- Get UNIX date format
4379 4338
       $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);
4380 4339
 
4381
-    }
4382
-    else
4340
+    } else
4383 4341
     {
4384 4342
       $p_header['mtime'] = time();
4385 4343
     }
@@ -4444,22 +4402,25 @@  discard block
 block discarded – undo
4444 4402
     $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data);
4445 4403
 
4446 4404
     // ----- Get filename
4447
-    if ($p_header['filename_len'] != 0)
4448
-      $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']);
4449
-    else
4450
-      $p_header['filename'] = '';
4405
+    if ($p_header['filename_len'] != 0) {
4406
+          $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']);
4407
+    } else {
4408
+          $p_header['filename'] = '';
4409
+    }
4451 4410
 
4452 4411
     // ----- Get extra
4453
-    if ($p_header['extra_len'] != 0)
4454
-      $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']);
4455
-    else
4456
-      $p_header['extra'] = '';
4412
+    if ($p_header['extra_len'] != 0) {
4413
+          $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']);
4414
+    } else {
4415
+          $p_header['extra'] = '';
4416
+    }
4457 4417
 
4458 4418
     // ----- Get comment
4459
-    if ($p_header['comment_len'] != 0)
4460
-      $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']);
4461
-    else
4462
-      $p_header['comment'] = '';
4419
+    if ($p_header['comment_len'] != 0) {
4420
+          $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']);
4421
+    } else {
4422
+          $p_header['comment'] = '';
4423
+    }
4463 4424
 
4464 4425
     // ----- Extract properties
4465 4426
 
@@ -4481,8 +4442,7 @@  discard block
 block discarded – undo
4481 4442
       // ----- Get UNIX date format
4482 4443
       $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);
4483 4444
 
4484
-    }
4485
-    else
4445
+    } else
4486 4446
     {
4487 4447
       $p_header['mtime'] = time();
4488 4448
     }
@@ -4595,8 +4555,9 @@  discard block
 block discarded – undo
4595 4555
     // ----- Go back to the maximum possible size of the Central Dir End Record
4596 4556
     if (!$v_found) {
4597 4557
       $v_maximum_size = 65557; // 0xFFFF + 22;
4598
-      if ($v_maximum_size > $v_size)
4599
-        $v_maximum_size = $v_size;
4558
+      if ($v_maximum_size > $v_size) {
4559
+              $v_maximum_size = $v_size;
4560
+      }
4600 4561
       @fseek($this->zip_fd, $v_size-$v_maximum_size);
4601 4562
       if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size))
4602 4563
       {
@@ -4681,9 +4642,9 @@  discard block
 block discarded – undo
4681 4642
     // ----- Get comment
4682 4643
     if ($v_data['comment_size'] != 0) {
4683 4644
       $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']);
4645
+    } else {
4646
+          $p_central_dir['comment'] = '';
4684 4647
     }
4685
-    else
4686
-      $p_central_dir['comment'] = '';
4687 4648
 
4688 4649
     $p_central_dir['entries'] = $v_data['entries'];
4689 4650
     $p_central_dir['disk_entries'] = $v_data['disk_entries'];
@@ -4783,8 +4744,7 @@  discard block
 block discarded – undo
4783 4744
                   if (   (strlen($v_header_list[$v_nb_extracted]['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))
4784 4745
                       && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
4785 4746
                       $v_found = true;
4786
-                  }
4787
-                  elseif (   (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */
4747
+                  } elseif (   (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */
4788 4748
                           && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
4789 4749
                       $v_found = true;
4790 4750
                   }
@@ -4835,8 +4795,7 @@  discard block
 block discarded – undo
4835 4795
                   break;
4836 4796
               }
4837 4797
           }
4838
-      }
4839
-      else {
4798
+      } else {
4840 4799
       	$v_found = true;
4841 4800
       }
4842 4801
 
@@ -4844,8 +4803,7 @@  discard block
 block discarded – undo
4844 4803
       if ($v_found)
4845 4804
       {
4846 4805
         unset($v_header_list[$v_nb_extracted]);
4847
-      }
4848
-      else
4806
+      } else
4849 4807
       {
4850 4808
         $v_nb_extracted++;
4851 4809
       }
@@ -5321,8 +5279,7 @@  discard block
 block discarded – undo
5321 5279
   {
5322 5280
     if (PCLZIP_ERROR_EXTERNAL == 1) {
5323 5281
       PclError($p_error_code, $p_error_string);
5324
-    }
5325
-    else {
5282
+    } else {
5326 5283
       $this->error_code = $p_error_code;
5327 5284
       $this->error_string = $p_error_string;
5328 5285
     }
@@ -5338,8 +5295,7 @@  discard block
 block discarded – undo
5338 5295
   {
5339 5296
     if (PCLZIP_ERROR_EXTERNAL == 1) {
5340 5297
       PclErrorReset();
5341
-    }
5342
-    else {
5298
+    } else {
5343 5299
       $this->error_code = 0;
5344 5300
       $this->error_string = '';
5345 5301
     }
@@ -5447,11 +5403,9 @@  discard block
 block discarded – undo
5447 5403
         if ($v_list[$i] == ".") {
5448 5404
           // ----- Ignore this directory
5449 5405
           // Should be the first $i=0, but no check is done
5450
-        }
5451
-        else if ($v_list[$i] == "..") {
5406
+        } else if ($v_list[$i] == "..") {
5452 5407
 		  $v_skip++;
5453
-        }
5454
-        else if ($v_list[$i] == "") {
5408
+        } else if ($v_list[$i] == "") {
5455 5409
 		  // ----- First '/' i.e. root slash
5456 5410
 		  if ($i == 0) {
5457 5411
             $v_result = "/".$v_result;
@@ -5471,13 +5425,11 @@  discard block
 block discarded – undo
5471 5425
             // ----- Ignore only the double '//' in path,
5472 5426
             // but not the first and last '/'
5473 5427
 		  }
5474
-        }
5475
-        else {
5428
+        } else {
5476 5429
 		  // ----- Look for item to skip
5477 5430
 		  if ($v_skip > 0) {
5478 5431
 		    $v_skip--;
5479
-		  }
5480
-		  else {
5432
+		  } else {
5481 5433
             $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:"");
5482 5434
 		  }
5483 5435
         }
@@ -5560,14 +5512,17 @@  discard block
 block discarded – undo
5560 5512
     // ----- Look if everything seems to be the same
5561 5513
     if ($v_result) {
5562 5514
       // ----- Skip all the empty items
5563
-      while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++;
5564
-      while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++;
5515
+      while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) {
5516
+          $j++;
5517
+      }
5518
+      while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) {
5519
+          $i++;
5520
+      }
5565 5521
 
5566 5522
       if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) {
5567 5523
         // ----- There are exactly the same
5568 5524
         $v_result = 2;
5569
-      }
5570
-      else if ($i < $v_list_dir_size) {
5525
+      } else if ($i < $v_list_dir_size) {
5571 5526
         // ----- The path is shorter than the dir
5572 5527
         $v_result = 0;
5573 5528
       }
@@ -5602,8 +5557,7 @@  discard block
 block discarded – undo
5602 5557
         @fwrite($p_dest, $v_buffer, $v_read_size);
5603 5558
         $p_size -= $v_read_size;
5604 5559
       }
5605
-    }
5606
-    else if ($p_mode==1)
5560
+    } else if ($p_mode==1)
5607 5561
     {
5608 5562
       while ($p_size != 0)
5609 5563
       {
@@ -5612,8 +5566,7 @@  discard block
 block discarded – undo
5612 5566
         @fwrite($p_dest, $v_buffer, $v_read_size);
5613 5567
         $p_size -= $v_read_size;
5614 5568
       }
5615
-    }
5616
-    else if ($p_mode==2)
5569
+    } else if ($p_mode==2)
5617 5570
     {
5618 5571
       while ($p_size != 0)
5619 5572
       {
@@ -5622,8 +5575,7 @@  discard block
 block discarded – undo
5622 5575
         @gzwrite($p_dest, $v_buffer, $v_read_size);
5623 5576
         $p_size -= $v_read_size;
5624 5577
       }
5625
-    }
5626
-    else if ($p_mode==3)
5578
+    } else if ($p_mode==3)
5627 5579
     {
5628 5580
       while ($p_size != 0)
5629 5581
       {
@@ -5661,8 +5613,7 @@  discard block
 block discarded – undo
5661 5613
       // ----- Try to copy & unlink the src
5662 5614
       if (!@copy($p_src, $p_dest)) {
5663 5615
         $v_result = 0;
5664
-      }
5665
-      else if (!@unlink($p_src)) {
5616
+      } else if (!@unlink($p_src)) {
5666 5617
         $v_result = 0;
5667 5618
       }
5668 5619
     }
Please login to merge, or discard this patch.
wp/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.