浏览代码

bring up fix for default_pref file name (double-slash)

Erin Schnabel 22 年之前
父节点
当前提交
85092927dc
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      functions/file_prefs.php

+ 4 - 1
functions/file_prefs.php

@@ -182,7 +182,10 @@ function checkForPrefs($data_dir, $username, $filename = '') {
     /* Then, check if the file exists. */
     if (!@file_exists($filename) ) {
         /* First, check the $data_dir for the default preference file. */
-        $default_pref = $data_dir . '/default_pref';
+        if(substr($data_dir,-1) != '/') {
+            $data_dir .= '/';
+        }
+        $default_pref = $data_dir . 'default_pref';
 
         /* If it is not there, check the internal data directory. */
         if (!@file_exists($default_pref)) {