Project

General

Profile

Actions

Regression #13685

closed

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

Added by Jim Pingle about 2 years ago. Updated about 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 #1

Updated by Jim Pingle about 2 years ago

  • Status changed from New to In Progress
Actions #2

Updated by Jim Pingle about 2 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100
Actions #3

Updated by Jim Pingle about 2 years ago

  • Has duplicate Regression #13618: Creating URL Table (IPs) alias fails on applying added
Actions #4

Updated by Georgiy Tyutyunnik about 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

Actions #5

Updated by Jim Pingle about 2 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF