Fix decoding HTML entities when there are multiple &'s in the string to decode.
| 439 | 601 | |
|---|---|---|
| 1282 | 1282 | if (index2 == s.length()) break; |
| 1283 | 1283 | |
| 1284 | 1284 | index = s.indexOf(';', index2); |
| 1285 | int space = s.indexOf(' ', index2); | |
| 1286 | int amp = s.indexOf('&', index2+1); | |
| 1287 | if(space == -1) space = s.length(); | |
| 1288 | if(amp == -1) amp = s.length(); | |
| 1285 | 1289 | |
| 1286 | if (index < 0) { | |
| 1290 | if(index < 0) { | |
| 1287 | 1291 | result.append(s.substring(index2)); |
| 1288 | 1292 | break; |
| 1293 | } else if (index > space || index > amp) { | |
| 1294 | result.append(s.substring(index2, Math.min(space, amp))); | |
| 1295 | index = index2+1; | |
| 1296 | continue; | |
| 1289 | 1297 | } |
| 1290 | 1298 | |
| 1291 | 1299 | String key = s.substring(index2 + 1, index); |
