Project

General

Profile

Bug #2021

REOPEN "2012" with miscorrection.

Added by MinGyoon Woo over 10 years ago. Updated over 10 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
Category:
Parsers
Target version:
-
Start date:
2014-03-22
Due date:
% Done:

100%

Estimated time:
Found in version:
3.9.467
Affected Versions:

Description

This bug was fixed by Adam and closed. But I found mistyping and wrong character.

url.c line 101

#define URL_RE "^([A-Za-z)://(("UC"+)(:("PC"+))?)?("HC"+)(:([0-9]+))?(/.*)?" 

is wrong. You missed ']' and wrong '^'. I believe the meaning of '^' is exclude.
It should be
#define URL_RE "([A-Za-z]+)://(("UC"+)(:("PC"+))?)?("HC"+)(:([0-9]+))?(/.*)?" 

History

#1

Updated by Sam Stenvall over 10 years ago

The regular expression is indeed missing both a bracket and a +, but the ^ character in this case indicates that the string should start with whatever comes next to it. It only functions as a negator inside brackets, e.g. [^b] matches everything without a "b".

I can't get this regex to work with some common regex testing tools, I assume it's because it uses Perl functions. Has this ever worked?

#2

Updated by MinGyoon Woo over 10 years ago

Oh, I found one missing character('@') from my correction.

#define URL_RE "([A-Za-z]+)://(("UC"+)(:("PC"+))?@)?("HC"+)(:([0-9]+))?(/.*)?"

In my case, it is work. I think, if you want to test with regex tool, you need to replace "UC", "PC" and "HC" with their regex definitions in url.c.

#3

Updated by Adam Sutton over 10 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset commit:tvheadend|5e777cbdbedf8830118fdc222929ae0352272896.

Also available in: Atom PDF