Project

General

Profile

Actions

Defect #5652

closed

Bad URL parsing in the wiki when it ends with right-angle-bracket(greater-than mark).

Added by Minjie Zhu almost 14 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Category:
Wiki
Target version:
Start date:
2010-06-08
Due date:
% Done:

100%

Estimated time:
Resolution:
Fixed
Affected version:

Description

When I write an URL and angle-bracket around the URL like below, the parsing is not correct. The bracket should not be included in the URL.

<http://www.redmine.org/>

Refers to the RFC2396,

The angle-bracket "<" and ">" and double-quote (") characters are
excluded because they are often used as the delimiters around URI in
text documents and protocol fields.

Actions #1

Updated by Jean-Baptiste Barth almost 14 years ago

  • Assignee set to Jean-Baptiste Barth

Thanks for reporting, I 100% agree..

When trying to look at this, I ran into the following problem : Redmine::WikiFormatting::Textile::Formatter#inline_auto_link method runs after textile parsing, so it receives something like http://www.redmine.org/> which is completely valid regarding the RFC.

If we don't want to do hacky things (and introduce a risk to not parse some valid urls correctly), we shoud change the way auto links are parsed : it should happen before textile, and they should be turned into standard textile links. But it can break so many things it should be heavily tested.

I'll try to investigate this tomorrow.

Actions #2

Updated by Jean-Baptiste Barth almost 14 years ago

Oops, my previous message was not so clear : "it receives something like http://www.redmine.org/&gt;

And it may not be valid regarding the RFC, but it at least only contains valid characters so it's difficult to parse it. We could find more problematic examples, like http://www.example.net/?page=blah>, which would be textilized to http://www.example.net/?page=blah&gt;, then parse with redmine auto links...

Actions #3

Updated by Minjie Zhu almost 14 years ago

Hi, Jean-Baptiste.

In our case, we often angle-bracket around a url if it is very long or contains some multi-byte chars. I think someone others may also have this issue.

Hope it will be fixed :)

Thanks for your investigation and I will also do some check for the redmine source, although I'm a beginner of rails :)

Actions #4

Updated by Jean-Baptiste Barth over 13 years ago

  • Status changed from New to Resolved
  • Target version set to 1.0.3
  • % Done changed from 0 to 100
  • Affected version (unused) changed from devel to 1.0.2
  • Resolution set to Fixed
  • Affected version set to 1.0.2

I realized that &gt; shouldn't occur in the end of standard urls. Moreover wrapping links in angle brackets is a common practice, so we can introduce a specific case for that. Patch committed in r4287.

Actions #5

Updated by Eric Davis over 13 years ago

  • Status changed from Resolved to Closed

Merged into 1.0-stable for release in 1.0.3

Actions

Also available in: Atom PDF