There's a bug in the routine TWiki::getTWikiLib. It doesn't normalize more than one relative parent directory (eg, a /../ in the path). For example, if TWiki.pm is found in /foo/bar/baz/../../ then this routine will return /foo/bar/../ not the expected /foo/ .
The line to fix is, #516 in the 20011201 release of file lib/TWiki.pm:
$twikiLibDir =~ s|([\\/])[^\\/]+[\\/]\.\.[\\/]|$1|go;
should be
while ( $twikiLibDir =~ s|([\\/])[^\\/]+[\\/]\.\.[\\/]|$1|o);
I think the /g flag is iterative rather than recursive (at least that's what I think it tries to say on the perlop manpage - example with putting commas into a number).
--
SlavaKozlov - 26 Feb 2002
I've set this to
BugReport since that's what it is.
--
RichardDonkin - 26 Mar 2002
I got a syntax error when I had applied the above patch, but the following worked:
while ( $twikiLibDir =~ s|([\\/])[^\\/]+[\\/]\.\.[\\/]|$1|o) {};
I'm using Perl version 5.005_03
--
MikeLees - 04 Jun 2002
Fixed and in
TWikiAlphaRelease.
--
PeterThoeny - 05 Jun 2002
Category:
TWikiPatches