Regression #13685
closedURL alias parsing is broken, gets stuck in infinite loop reading downloaded file
100%
Description
In c239afac1763951eacefc1dbc59ad04f9d319b91 we made the following change:
- while (($fc = fgetss($fd)) !== FALSE) {
+ while (($fc = strip_tags(fgets($fd))) !== FALSE) {
However, this is not an equivalent result because the output of strip_tags()
will never be FALSE, it will return an empty string when fed boolean FALSE. Because of that difference, execution can never break out of this loop, so creating or updating URL-based aliases will spin forever until PHP times out.
This is the only place in the code base that used that combination, so it's the only place affected.
Changing the code so it performs the strip_tags()
inside the loop works:
while (($fc = fgets($fd)) !== FALSE) {
$fc = strip_tags($fc);
Related issues
Updated by Jim Pingle about 2 years ago
- Status changed from In Progress to Feedback
- % Done changed from 0 to 100
Applied in changeset af61346825f5507889d66c142c78babee837f6e4.
Updated by Jim Pingle almost 2 years ago
- Has duplicate Regression #13618: Creating URL Table (IPs) alias fails on applying added
Updated by Georgiy Tyutyunnik almost 2 years ago
tested on
Version 2.7.0-DEVELOPMENT (amd64)
built on Fri Dec 02 06:04:46 UTC 2022
FreeBSD 14.0-CURRENT
Alias is downloaded and parsed correctly, GUI stays responsive
Updated by Jim Pingle almost 2 years ago
- Status changed from Feedback to Resolved