Bug in FckEditor with relative URL anchor tags...

17 views
Skip to first unread message

Phil Haack

unread,
Dec 21, 2009, 5:28:31 PM12/21/09
to sub...@googlegroups.com

Hey Simo,

 

Can you take a look at this bug? It appears to be an FckEditor bug.

http://code.google.com/p/subtext/issues/detail?id=130&q=priority%3DHigh&colspec=Stars%20ID%20Attachments%20Type%20Status%20Priority%20Milestone%20Owner%20Summary

 

I can’t reproduce it when I use Google Chrome (FckEditor is not supported on Chrome so we get the standard TextBox).

 

Basically, the FckEditor is converting:

 

<a href="/my-url">…</a>

 

Into

 

<a href="http://mydomain.com/my-url">…</a>

 

And it shouldn’t.

 

Phil

Simone Chiaretta

unread,
Dec 22, 2009, 5:56:40 AM12/22/09
to sub...@googlegroups.com
I'll have a look at it
Simo

--

You received this message because you are subscribed to the Google Groups "Subtext" group.
To post to this group, send email to sub...@googlegroups.com.
To unsubscribe from this group, send email to subtext+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/subtext?hl=en.



--
Simone Chiaretta
Microsoft MVP ASP.NET - ASPInsider
Blog: http://codeclimber.net.nz
RSS: http://feeds2.feedburner.com/codeclimber
twitter: @simonech

Any sufficiently advanced technology is indistinguishable from magic
"Life is short, play hard"

Simone Chiaretta

unread,
Jan 6, 2010, 3:25:20 PM1/6/10
to sub...@googlegroups.com
This bug is not a real bug...
it's more like a feature...

also, the problem is not into FCKeditor, but into the HtmlHelper.StripRtb method which does:

return Regex.Replace(s, "<a href=\"/", string.Format("<a href=\"http://{0}/ host),  RegexOptions.IgnoreCase);

everything that starts with / is replaced with the absolute url...

What is the expected behavior? shouldn't it do it? or the bug is that it doesn't add the port number?
Simone

Phil Haack

unread,
Jan 6, 2010, 3:36:35 PM1/6/10
to sub...@googlegroups.com

I think the bug is that we shouldn’t put in a fully qualified path if there isn’t one already. If I want to link to /Foo/Bar.html I should be able to do so. I don’t like it when my content gets rewritten in ways I didn’t expect. I don’t recall why we ever had this method in the first place. Was it a leftover from .TEXT?

 

Phil

Simone Chiaretta

unread,
Jan 6, 2010, 3:39:17 PM1/6/10
to sub...@googlegroups.com
So, can I just remove it?

the method also does this pretty weird replace:

string s = Regex.Replace(text, "/localhost/S*Admin/", "", RegexOptions.IgnoreCase);

any idea of what that might be?
Simo

Phil Haack

unread,
Jan 6, 2010, 3:44:09 PM1/6/10
to sub...@googlegroups.com

No idea what that does. I saw this before and meant to ask you about it. Yeah, I think we should remove it.

Simone Chiaretta

unread,
Jan 6, 2010, 3:53:31 PM1/6/10
to sub...@googlegroups.com
Ok... removing it :)
Simo
Reply all
Reply to author
Forward
0 new messages