external HTTP docs included in TWiki topics via %INCLUDE% containing relative urls are not correctly patched (IMG for example). Sub TWiki.pm:_rewriteUrlInInclude use full site URL rather than dirname($theAbsPath), so all patched URLs also contains target HTTP filename.
For example : %INCLUDE%{"http://home.tele2.fr/nomblot/photos/Famille/Aurelie/index.html"}%
will use as absolute path :
http://home.tele2.fr/nomblot/photos/Famille/Aurelie/index.html
, and will path all IMGs with this URL, which is wrong :
and must be in fact
Just try to include
http://home.tele2.fr/nomblot/photos/Famille/Aurelie/index.html
to see, example given in this topic content, view http page source to check img urls.
Suggested fix :
TWiki.pm : sub _rewriteURLInInclude
use File::Basename;
$theAbsPath = dirname($theAbsPath);
Alternate fix: (
TWiki:Main.AlexSchuilenburg
)
The above fix is incorrect as URLs use dir separator of '/' while dirname will operate according to the server's OS. e.g. On a Windows/DOS based system, separators are '\'. I propose instead:
TWiki.pm : sub _rewriteURLInInclude
$theAbsPath = $1 if ($theAbsPath =~ /(.*\/)/);
This was fixed in 10720 by
TWiki:Main.SteffenPoulsen
, so it's closed.
CC
4.1.0 released
KJL