From a2a74376fb26163e260c38ef46df314a3522bae6 Mon Sep 17 00:00:00 2001 From: ebullient Date: Tue, 8 Apr 2003 00:26:42 +0000 Subject: [PATCH] Re-add the outside-of-the-SM-Tree handling that I somehow dropped from change_to_SM_path(). git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4753 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- config/conf.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config/conf.pl b/config/conf.pl index f1fb4e4b..34dfa4b1 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -3008,6 +3008,7 @@ sub set_defaults { # prepended to the path, if not, then the path will be # converted to an absolute path, e.g. # '../images/logo.gif' --> SM_PATH . 'images/logo.gif' +# '../../someplace/data' --> '/absolute/path/someplace/data' # 'images/logo.gif' --> SM_PATH . 'config/images/logo.gif' # '/absolute/path/logo.gif' --> '/absolute/path/logo.gif' # 'http://whatever/' --> 'http://whatever' @@ -3034,6 +3035,14 @@ sub change_to_SM_path() { if ( $#rel_path > 1 ) { # more than two levels away. Make it absolute. + @abs_path = split(/\//, $dir); + + # Lop off the relative pieces of the absolute path.. + for ( $i = 0; $i <= $#rel_path; $i++ ) { + pop @abs_path; + shift @rel_path; + } + push @abs_path, @rel_path; $new_path = "\'" . join('/', @abs_path) . "\'"; } elsif ( $#rel_path > 0 ) { # it's within the SM tree, prepend SM_PATH -- 2.25.1