Added patch 717651
authorebullient <ebullient@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 10 Apr 2003 00:40:08 +0000 (00:40 +0000)
committerebullient <ebullient@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 10 Apr 2003 00:40:08 +0000 (00:40 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4761 7612ce4b-ef26-0410-bec9-ea0150e637f0

config/conf.pl

index 487d3c2..ac66f42 100755 (executable)
@@ -3015,6 +3015,7 @@ sub set_defaults {
 #   'images/logo.gif'         --> SM_PATH . 'config/images/logo.gif'
 #   '/absolute/path/logo.gif' --> '/absolute/path/logo.gif'
 #   'http://whatever/'        --> 'http://whatever'
 #   'images/logo.gif'         --> SM_PATH . 'config/images/logo.gif'
 #   '/absolute/path/logo.gif' --> '/absolute/path/logo.gif'
 #   'http://whatever/'        --> 'http://whatever'
+#   $some_var/path            --> "$some_var/path"
 sub change_to_SM_path() {
     my ($old_path) = @_;
     my $new_path = '';
 sub change_to_SM_path() {
     my ($old_path) = @_;
     my $new_path = '';
@@ -3028,7 +3029,16 @@ sub change_to_SM_path() {
     return "\'" . $old_path . "\'"  if ( $old_path =~ /^\w:\// );
     return $old_path                if ( $old_path =~ /^\'(\/|http)/ );
     return $old_path                if ( $old_path =~ /^\'\w:\// );
     return "\'" . $old_path . "\'"  if ( $old_path =~ /^\w:\// );
     return $old_path                if ( $old_path =~ /^\'(\/|http)/ );
     return $old_path                if ( $old_path =~ /^\'\w:\// );
-    return $old_path                if ( $old_path =~ /^(\$|SM_PATH)/);
+    return $old_path                if ( $old_path =~ /^SM_PATH/);
+   
+    if ( $old_path =~ /^\$/ ) {
+        # check if it's a single var, or a $var/path combination
+        # if it's $var/path, enclose in ""
+        if ( $old_path =~ /\// ) {
+            return '"'.$old_path.'"';
+        }
+        return $old_path;
+    }
     
     # Remove remaining '
     $old_path =~ s/\'//g;
     
     # Remove remaining '
     $old_path =~ s/\'//g;
@@ -3073,7 +3083,7 @@ sub change_to_rel_path() {
 
     if ( $old_path =~ /^SM_PATH/ ) {
         $new_path =~ s/^SM_PATH . \'/\.\.\//;
 
     if ( $old_path =~ /^SM_PATH/ ) {
         $new_path =~ s/^SM_PATH . \'/\.\.\//;
-       $new_path =~ s/\.\.\/config\///;
+        $new_path =~ s/\.\.\/config\///;
     }
 
     return $new_path;
     }
 
     return $new_path;