Make WordPress Core

Ticket #40109: 40109.4.patch

File 40109.4.patch, 6.0 KB (added by desrosj, 8 years ago)

Same as previous, but removed an extra stray {

  • src/wp-admin/includes/class-wp-upgrader.php

     
    358358                $_files = $wp_filesystem->dirlist( $remote_destination, true, true );
    359359
    360360                // 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;
    364364
    365365                        if ( ! isset( $file['files'] ) ) {
    366366                                continue;
  • src/wp-includes/Text/Diff/Engine/native.php

     
    190190                }
    191191                $matches = $ymatches[$line];
    192192                reset($matches);
    193                 while (list(, $y) = each($matches)) {
     193                foreach ( $matches as $y ) {
    194194                    if (empty($this->in_seq[$y])) {
    195195                        $k = $this->_lcsPos($y);
    196196                        assert($k > 0);
     
    198198                        break;
    199199                    }
    200200                }
    201                 while (list(, $y) = each($matches)) {
     201                foreach ( $matches as $y ) {
    202202                    if ($y > $this->seq[$k - 1]) {
    203203                        assert($y <= $this->seq[$k]);
    204204                        /* Optimization: this is a common case: next match is
  • src/wp-includes/class-snoopy.php

     
    183183                                                $frameurls = $this->_frameurls;
    184184                                                $this->_frameurls = array();
    185185
    186                                                 while(list(,$frameurl) = each($frameurls))
    187                                                 {
     186                                                foreach ( $frameurls as $frameurl ) {
    188187                                                        if($this->_framedepth < $this->maxframes)
    189188                                                        {
    190189                                                                $this->fetch($frameurl);
     
    243242                                        $frameurls = $this->_frameurls;
    244243                                        $this->_frameurls = array();
    245244
    246                                         while(list(,$frameurl) = each($frameurls))
    247                                         {
     245                                        foreach ( $frameurls as $frameurl ) {
    248246                                                if($this->_framedepth < $this->maxframes)
    249247                                                {
    250248                                                        $this->fetch($frameurl);
     
    341339                                                $frameurls = $this->_frameurls;
    342340                                                $this->_frameurls = array();
    343341
    344                                                 while(list(,$frameurl) = each($frameurls))
    345                                                 {
     342                                                foreach ( $frameurls as $frameurl ) {
    346343                                                        if($this->_framedepth < $this->maxframes)
    347344                                                        {
    348345                                                                $this->fetch($frameurl);
     
    408405                                        $frameurls = $this->_frameurls;
    409406                                        $this->_frameurls = array();
    410407
    411                                         while(list(,$frameurl) = each($frameurls))
    412                                         {
     408                                        foreach ( $frameurls as $frameurl ) {
    413409                                                if($this->_framedepth < $this->maxframes)
    414410                                                {
    415411                                                        $this->fetch($frameurl);
     
    629625
    630626                // catenate the non-empty matches from the conditional subpattern
    631627
    632                 while(list($key,$val) = each($links[2]))
    633                 {
     628                foreach ( $links[2] as $key => $val ) {
    634629                        if(!empty($val))
    635630                                $match[] = $val;
    636631                }
    637632
    638                 while(list($key,$val) = each($links[3]))
    639                 {
     633                foreach ( $links[3] as $key => $val ) {
    640634                        if(!empty($val))
    641635                                $match[] = $val;
    642636                }
     
    821815                {
    822816                        if(!is_array($this->rawheaders))
    823817                                $this->rawheaders = (array)$this->rawheaders;
    824                         while(list($headerKey,$headerVal) = each($this->rawheaders))
     818
     819                        foreach ( $this->rawheaders as $headerKey => $headerVal ) {
    825820                                $headers .= $headerKey.": ".$headerVal."\r\n";
     821                        }
    826822                }
    827823                if(!empty($content_type)) {
    828824                        $headers .= "Content-type: $content_type";
     
    985981                {
    986982                        if(!is_array($this->rawheaders))
    987983                                $this->rawheaders = (array)$this->rawheaders;
    988                         while(list($headerKey,$headerVal) = each($this->rawheaders))
     984                        foreach ( $this->rawheaders as $headerKey => $headerVal ) {
    989985                                $headers[] = $headerKey.": ".$headerVal;
     986                        }
    990987                }
    991988                if(!empty($content_type)) {
    992989                        if ($content_type == "multipart/form-data")
     
    12041201                switch ($this->_submit_type) {
    12051202                        case "application/x-www-form-urlencoded":
    12061203                                reset($formvars);
    1207                                 while(list($key,$val) = each($formvars)) {
     1204                                foreach ( $formvars as $key => $val ) {
    12081205                                        if (is_array($val) || is_object($val)) {
    1209                                                 while (list($cur_key, $cur_val) = each($val)) {
     1206                                                foreach ( $val as $cur_key => $cur_val ) {
    12101207                                                        $postdata .= urlencode($key)."[]=".urlencode($cur_val)."&";
    12111208                                                }
    12121209                                        } else
     
    12181215                                $this->_mime_boundary = "Snoopy".md5(uniqid(microtime()));
    12191216
    12201217                                reset($formvars);
    1221                                 while(list($key,$val) = each($formvars)) {
     1218                                foreach ( $formvars as $key => $val ) {
    12221219                                        if (is_array($val) || is_object($val)) {
    1223                                                 while (list($cur_key, $cur_val) = each($val)) {
     1220                                                foreach ( $val as $cur_key => $cur_val ) {
    12241221                                                        $postdata .= "--".$this->_mime_boundary."\r\n";
    12251222                                                        $postdata .= "Content-Disposition: form-data; name=\"$key\[\]\"\r\n\r\n";
    12261223                                                        $postdata .= "$cur_val\r\n";
     
    12331230                                }
    12341231
    12351232                                reset($formfiles);
    1236                                 while (list($field_name, $file_names) = each($formfiles)) {
     1233                                foreach ( $formfiles as $field_name => $file_names ) {
    12371234                                        settype($file_names, "array");
    1238                                         while (list(, $file_name) = each($file_names)) {
     1235                                        foreach ( $file_names as $file_name ) {
    12391236                                                if (!is_readable($file_name)) continue;
    12401237
    12411238                                                $fp = fopen($file_name, "r");
  • tests/phpunit/includes/bootstrap.php

     
    126126        function __construct( $argv ) {
    127127                array_shift( $argv );
    128128                $options = array();
    129                 while ( list( $i, $arg ) = each( $argv ) ) {
     129                foreach ( $argv as $i => $arg ) {
    130130                        try {
    131131                                if ( strlen( $arg ) > 1 && $arg[0] === '-' && $arg[1] === '-' ) {
    132132                                        PHPUnit_Util_Getopt::parseLongOption( substr( $arg, 2 ), $this->longOptions, $options, $argv );