Tags:
create new tag
, view all tags

Bug: includeUrl() screws up absolute urls

The arguments to cleanupIncludedHTML are read in the wrong order, causing absolute URLs (those beginning with a '/' (slash)) to be improperly rewritten.

Here is a unified diff that corrects this issue:

--- lib/TWiki.pm.orig   2004-07-23 14:16:36.000000000 -0400
+++ lib/TWiki.pm        2004-07-23 14:15:40.000000000 -0400
@@ -1794,7 +1794,7 @@

 sub cleanupIncludedHTML
 {
-    my( $text, $path, $host ) = @_;
+    my( $text, $host, $path ) = @_;

     # FIXME: Make aware of <base> tag

Test case

Include the a page, such as http://sourceforge.net/projects/twiki/

Like so:

%INCLUDE{"http://sourceforge.net/projects/twiki/" pattern="^.*?Login via SSL</a><br>\s*(.*?)\n.*"}%

You get:

See what happens when you click on the "New User via SSL" link...notice that the URL is not a fully-qualified URL. Instead, the path part of the included url is inserted at the beginning of the link.

Environment


Category: TWikiPatches

TWiki version: TWikiBetaRelease2004x05x07
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  

-- ChristopherRued - 23 Jul 2004

Follow up

This should be fixed for Cairo. -- CrawfordCurrie - 24 Jul 2004

Hmm...perhaps there's another issue. The link above still doesn't look right. The host should be sourceforge.net, not twiki.org -- CR

Nevermind, I downloaded source via SVN, and tried it out myself. All is well. Thanks for the quick turn-around. -- ChristopherRued - 25 Jul 2004

Fix record

commited to SVN, thankyou very much!

-- SvenDowideit - 24 Jul 2004

Topic revision: r7 - 25 Jul 2004 - 03:06:22 - ChristopherRued
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback