Ticket #40109: 40109.3.patch
File 40109.3.patch, 6.0 KB (added by , 8 years ago) |
---|
-
src/wp-admin/includes/class-wp-upgrader.php
358 358 $_files = $wp_filesystem->dirlist( $remote_destination, true, true ); 359 359 360 360 // Flatten the resulting array, iterate using each as we append to the array during iteration. 361 while ( $f = each( $_files )) {362 $file = $ f['value'];363 $name = $ f['key'];361 foreach ( $_files as $key => $value ) { 362 $file = $value; 363 $name = $key; 364 364 365 365 if ( ! isset( $file['files'] ) ) { 366 366 continue; -
src/wp-includes/Text/Diff/Engine/native.php
190 190 } 191 191 $matches = $ymatches[$line]; 192 192 reset($matches); 193 while (list(, $y) = each($matches)) {193 foreach ( $matches as $y ) { 194 194 if (empty($this->in_seq[$y])) { 195 195 $k = $this->_lcsPos($y); 196 196 assert($k > 0); … … 198 198 break; 199 199 } 200 200 } 201 while (list(, $y) = each($matches)) {201 foreach ( $matches as $y ) { 202 202 if ($y > $this->seq[$k - 1]) { 203 203 assert($y <= $this->seq[$k]); 204 204 /* Optimization: this is a common case: next match is -
src/wp-includes/class-snoopy.php
183 183 $frameurls = $this->_frameurls; 184 184 $this->_frameurls = array(); 185 185 186 while(list(,$frameurl) = each($frameurls)) 187 { 186 foreach ( $frameurls as $frameurl ) { 188 187 if($this->_framedepth < $this->maxframes) 189 188 { 190 189 $this->fetch($frameurl); … … 243 242 $frameurls = $this->_frameurls; 244 243 $this->_frameurls = array(); 245 244 246 while(list(,$frameurl) = each($frameurls)) 247 { 245 foreach ( $frameurls as $frameurl ) { 248 246 if($this->_framedepth < $this->maxframes) 249 247 { 250 248 $this->fetch($frameurl); … … 341 339 $frameurls = $this->_frameurls; 342 340 $this->_frameurls = array(); 343 341 344 while(list(,$frameurl) = each($frameurls)) 345 { 342 foreach ( $frameurls as $frameurl ) { 346 343 if($this->_framedepth < $this->maxframes) 347 344 { 348 345 $this->fetch($frameurl); … … 408 405 $frameurls = $this->_frameurls; 409 406 $this->_frameurls = array(); 410 407 411 while(list(,$frameurl) = each($frameurls))408 foreach ( $frameurls as $frameurl ) { 412 409 { 413 410 if($this->_framedepth < $this->maxframes) 414 411 { … … 629 626 630 627 // catenate the non-empty matches from the conditional subpattern 631 628 632 while(list($key,$val) = each($links[2])) 633 { 629 foreach ( $links[2] as $key => $val ) { 634 630 if(!empty($val)) 635 631 $match[] = $val; 636 632 } 637 633 638 while(list($key,$val) = each($links[3])) 639 { 634 foreach ( $links[3] as $key => $val ) { 640 635 if(!empty($val)) 641 636 $match[] = $val; 642 637 } … … 821 816 { 822 817 if(!is_array($this->rawheaders)) 823 818 $this->rawheaders = (array)$this->rawheaders; 824 while(list($headerKey,$headerVal) = each($this->rawheaders)) 819 820 foreach ( $this->rawheaders as $headerKey => $headerVal ) { 825 821 $headers .= $headerKey.": ".$headerVal."\r\n"; 822 } 826 823 } 827 824 if(!empty($content_type)) { 828 825 $headers .= "Content-type: $content_type"; … … 985 982 { 986 983 if(!is_array($this->rawheaders)) 987 984 $this->rawheaders = (array)$this->rawheaders; 988 while(list($headerKey,$headerVal) = each($this->rawheaders))985 foreach ( $this->rawheaders as $headerKey => $headerVal ) { 989 986 $headers[] = $headerKey.": ".$headerVal; 987 } 990 988 } 991 989 if(!empty($content_type)) { 992 990 if ($content_type == "multipart/form-data") … … 1204 1202 switch ($this->_submit_type) { 1205 1203 case "application/x-www-form-urlencoded": 1206 1204 reset($formvars); 1207 while(list($key,$val) = each($formvars)) {1205 foreach ( $formvars as $key => $val ) { 1208 1206 if (is_array($val) || is_object($val)) { 1209 while (list($cur_key, $cur_val) = each($val)) {1207 foreach ( $val as $cur_key => $cur_val ) { 1210 1208 $postdata .= urlencode($key)."[]=".urlencode($cur_val)."&"; 1211 1209 } 1212 1210 } else … … 1218 1216 $this->_mime_boundary = "Snoopy".md5(uniqid(microtime())); 1219 1217 1220 1218 reset($formvars); 1221 while(list($key,$val) = each($formvars)) {1219 foreach ( $formvars as $key => $val ) { 1222 1220 if (is_array($val) || is_object($val)) { 1223 while (list($cur_key, $cur_val) = each($val)) {1221 foreach ( $val as $cur_key => $cur_val ) { 1224 1222 $postdata .= "--".$this->_mime_boundary."\r\n"; 1225 1223 $postdata .= "Content-Disposition: form-data; name=\"$key\[\]\"\r\n\r\n"; 1226 1224 $postdata .= "$cur_val\r\n"; … … 1233 1231 } 1234 1232 1235 1233 reset($formfiles); 1236 while (list($field_name, $file_names) = each($formfiles)) {1234 foreach ( $formfiles as $field_name => $file_names ) { 1237 1235 settype($file_names, "array"); 1238 while (list(, $file_name) = each($file_names)) {1236 foreach ( $file_names as $file_name ) { 1239 1237 if (!is_readable($file_name)) continue; 1240 1238 1241 1239 $fp = fopen($file_name, "r"); -
tests/phpunit/includes/bootstrap.php
126 126 function __construct( $argv ) { 127 127 array_shift( $argv ); 128 128 $options = array(); 129 while ( list( $i, $arg ) = each( $argv )) {129 foreach ( $argv as $i => $arg ) { 130 130 try { 131 131 if ( strlen( $arg ) > 1 && $arg[0] === '-' && $arg[1] === '-' ) { 132 132 PHPUnit_Util_Getopt::parseLongOption( substr( $arg, 2 ), $this->longOptions, $options, $argv );