Project

General

Profile

Actions

Regression #13685

closed

URL alias parsing is broken, gets stuck in infinite loop reading downloaded file

Added by Jim Pingle almost 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Category:
Aliases / Tables
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.01
Release Notes:
Force Exclusion
Affected Version:
Affected Architecture:

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

Has duplicate Regression #13618: Creating URL Table (IPs) alias fails on applyingDuplicateJim Pingle

Actions
Actions

Also available in: Atom PDF