File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 205
205
$ cfg ['Servers ' ][$ i ]['compress ' ] = false ;
206
206
$ cfg ['Servers ' ][$ i ]['AllowNoPassword ' ] = true ;
207
207
}
208
- for ($ i = 1 ; isset ($ sockets [$ i - 1 ]); $ i ++) {
209
- $ cfg ['Servers ' ][$ i ]['socket ' ] = $ sockets [$ i - 1 ];
210
- $ cfg ['Servers ' ][$ i ]['host ' ] = 'localhost ' ;
208
+ // Avoid overwriting the last server id $i, use another variable name
209
+ for ($ socketHostId = 1 ; isset ($ sockets [$ socketHostId - 1 ]); $ socketHostId ++) {
210
+ $ cfg ['Servers ' ][$ socketHostId ]['socket ' ] = $ sockets [$ socketHostId - 1 ];
211
+ $ cfg ['Servers ' ][$ socketHostId ]['host ' ] = 'localhost ' ;
211
212
}
212
213
/*
213
214
* Revert back to last configured server to make
Original file line number Diff line number Diff line change 205
205
$ cfg ['Servers ' ][$ i ]['compress ' ] = false ;
206
206
$ cfg ['Servers ' ][$ i ]['AllowNoPassword ' ] = true ;
207
207
}
208
- for ($ i = 1 ; isset ($ sockets [$ i - 1 ]); $ i ++) {
209
- $ cfg ['Servers ' ][$ i ]['socket ' ] = $ sockets [$ i - 1 ];
210
- $ cfg ['Servers ' ][$ i ]['host ' ] = 'localhost ' ;
208
+ // Avoid overwriting the last server id $i, use another variable name
209
+ for ($ socketHostId = 1 ; isset ($ sockets [$ socketHostId - 1 ]); $ socketHostId ++) {
210
+ $ cfg ['Servers ' ][$ socketHostId ]['socket ' ] = $ sockets [$ socketHostId - 1 ];
211
+ $ cfg ['Servers ' ][$ socketHostId ]['host ' ] = 'localhost ' ;
211
212
}
212
213
/*
213
214
* Revert back to last configured server to make
Original file line number Diff line number Diff line change 205
205
$ cfg ['Servers ' ][$ i ]['compress ' ] = false ;
206
206
$ cfg ['Servers ' ][$ i ]['AllowNoPassword ' ] = true ;
207
207
}
208
- for ($ i = 1 ; isset ($ sockets [$ i - 1 ]); $ i ++) {
209
- $ cfg ['Servers ' ][$ i ]['socket ' ] = $ sockets [$ i - 1 ];
210
- $ cfg ['Servers ' ][$ i ]['host ' ] = 'localhost ' ;
208
+ // Avoid overwriting the last server id $i, use another variable name
209
+ for ($ socketHostId = 1 ; isset ($ sockets [$ socketHostId - 1 ]); $ socketHostId ++) {
210
+ $ cfg ['Servers ' ][$ socketHostId ]['socket ' ] = $ sockets [$ socketHostId - 1 ];
211
+ $ cfg ['Servers ' ][$ socketHostId ]['host ' ] = 'localhost ' ;
211
212
}
212
213
/*
213
214
* Revert back to last configured server to make
You can’t perform that action at this time.
0 commit comments