Merge pull request #213 from lelutin/protect_dir_error_messages
Protected dir creation error messages are not helpful. Provide more informations about error creation
This commit is contained in:
commit
309cb1991b
|
@ -73,13 +73,9 @@ class m_hta {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!file_exists("$absolute/.htaccess")) {
|
if (!file_exists("$absolute/.htaccess")) {
|
||||||
if (!@touch("$absolute/.htaccess")) {
|
$file = @fopen("$absolute/.htaccess", "w+");
|
||||||
$msg->raise("ERROR", "hta", _("File already exist"));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$file = @fopen("$absolute/.htaccess", "r+");
|
|
||||||
if (!$file) {
|
if (!$file) {
|
||||||
$msg->raise("ERROR", "hta", _("File already exist"));
|
$msg->raise("ERROR", "hta", _("Error creating .htaccess file: ") . error_get_last()['message']);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
fseek($file, 0);
|
fseek($file, 0);
|
||||||
|
@ -88,8 +84,8 @@ class m_hta {
|
||||||
fclose($file);
|
fclose($file);
|
||||||
}
|
}
|
||||||
if (!file_exists("$absolute/.htpasswd")) {
|
if (!file_exists("$absolute/.htpasswd")) {
|
||||||
if (!touch("$absolute/.htpasswd")) {
|
if (!@touch("$absolute/.htpasswd")) {
|
||||||
$msg->raise("ERROR", "hta", _("File already exist"));
|
$msg->raise("ERROR", "hta", _("Error creating .htpasswd file: ") . error_get_last()['message']);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue