path problem resolved on windows

This commit is contained in:
Hash Borgir
2021-03-22 05:39:06 -06:00
parent 49003c236a
commit ef04c83592
29 changed files with 4 additions and 809 deletions

View File

@@ -3,8 +3,9 @@ if (!empty($_POST)) {
// write the d2um.conf file and replace \ with \\
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$path = str_replace('\\', '\\', $_POST['path']);
$path .= '\\data\\global\\excel\\';
$path = rtrim($_POST['path'], "\\");
$path = str_replace("\\", "\\\\", $path);
$path .= '\\\\data\\\\global\\\\excel\\\\';
file_put_contents("../d2um.conf", $path);
} else {
@@ -27,7 +28,7 @@ if (!empty($_POST)) {
<p style="font-family: lato">Input path to D2 Mod Directory.</p>
<div style="margin-top: 20px;">
<form enctype="multipart/form-data" style="font-family: Lato; font-size: 11px;" action="" method="post">
<form enctype="multipart/form-data" style="font-family: Lato; font-size: 14pt;" action="" method="post">
<label for="path">Choose PATH</label>
<input id="path" style="width: 420px;" required="required" name="path" type="text">
<input type="submit" value="Write Config" name="submit">