- Fix compatibility with Windows path in administrator plugin (#1740469).
[squirrelmail.git] / plugins / administrator / options.php
index 1fcf1fc5897faa79237f739656fc2b6358309976..5d3a1fe1e8454a20a13fead4a6fae801a5e8235a 100644 (file)
@@ -170,6 +170,7 @@ function change_to_rel_path($old_path) {
  *     empty_string            --> ''
  *     ../images/logo.gif      --> SM_PATH . 'images/logo.gif'
  *     images/logo.gif         --> SM_PATH . 'config/images/logo.gif'
+ *     C:/absolute/win/path    --> 'C:/absolute/win/path'
  *     /absolute/path/logo.gif --> '/absolute/path/logo.gif'
  *     http://whatever/        --> 'http://whatever'
  *
@@ -180,7 +181,8 @@ function change_to_rel_path($old_path) {
 function change_to_sm_path($old_path) {
     if ( $old_path === '' || $old_path == "''" ) {
         return "''";
-    } elseif ( preg_match("/^(\/|http)/", $old_path) ) {
+    } elseif ( preg_match("/^(\/|http)/", $old_path) ||
+        substr($old_path,1,2) == ':/' ) {
         return "'" . $old_path . "'";
     } elseif ( preg_match("/^(\$|SM_PATH)/", $old_path) ) {
         return $old_path;