gamonoid / icehrm

Manage your employees easily with a robust and efficient Human Resource Management System
http://icehrm.com
Other
601 stars 378 forks source link

installing error during installation #356

Open finnditdipanjan opened 6 months ago

finnditdipanjan commented 6 months ago

When install icehrm in my own hosting it give me error :- The value provided for APP_PASSWORD is not valid.

error

AppLEaDaY commented 5 months ago

By inspecting the code I found it depends on what characters are contained in the chosen password. Please have a look in app/install/submit.php. A piece of that code follows...

function clean_input($input, $html = false) {
    $input = str_replace([';', '#', "'", '"'], '', $input);
    return htmlentities($input, ENT_QUOTES, 'UTF-8');
}

$inputList = [
   'APP_HOST',
   'APP_USERNAME',
   'APP_PASSWORD',
   'APP_DB',
   'LOG',
   'BASE_URL',
];

foreach ($inputList as $key) {
    if (empty($_REQUEST[$key])) {
        $_REQUEST[$key] = '';
    }
    $cleaned = clean_input($_REQUEST[$key]);
    if ($cleaned !== $_REQUEST[$key]) {
        $ret["status"] = "ERROR";
        $ret["msg"] = "The value provided for $key is not valid.";
        echo json_encode($ret);
        exit();
    }
}

Andrea