detecting access right problem in browser upload
This commit is contained in:
parent
0cbb58153d
commit
6ddf9fe6d6
|
@ -512,9 +512,14 @@ class m_bro {
|
||||||
if (!strpos($_FILES['userfile']['name'],"/")) {
|
if (!strpos($_FILES['userfile']['name'],"/")) {
|
||||||
if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
|
if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
|
||||||
if (!file_exists($absolute."/".$_FILES['userfile']['name'])) {
|
if (!file_exists($absolute."/".$_FILES['userfile']['name'])) {
|
||||||
touch($absolute."/".$_FILES['userfile']['name']);
|
@touch($absolute."/".$_FILES['userfile']['name']);
|
||||||
|
}
|
||||||
|
if (@move_uploaded_file($_FILES['userfile']['tmp_name'], $absolute."/".$_FILES['userfile']['name'])) {
|
||||||
|
return $absolute."/".$_FILES['userfile']['name'];
|
||||||
|
} else {
|
||||||
|
$err->raise("bro",3);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
move_uploaded_file($_FILES['userfile']['tmp_name'], $absolute."/".$_FILES['userfile']['name']);
|
|
||||||
} else {
|
} else {
|
||||||
$err->log("bro","uploadfile","Tentative d'attaque : ".$_FILES['userfile']['tmp_name']);
|
$err->log("bro","uploadfile","Tentative d'attaque : ".$_FILES['userfile']['tmp_name']);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -681,6 +681,9 @@ msgstr "File or folder name is incorrect"
|
||||||
msgid "err_bro_2"
|
msgid "err_bro_2"
|
||||||
msgstr "You cannot move or copy a file to the same folder"
|
msgstr "You cannot move or copy a file to the same folder"
|
||||||
|
|
||||||
|
msgid "err_bro_3"
|
||||||
|
msgstr "You don't have the right to write into this folder. Please check the access rights."
|
||||||
|
|
||||||
#. If we manage your DNS <br />You can manage your mails elsewhere if you want
|
#. If we manage your DNS <br />You can manage your mails elsewhere if you want
|
||||||
#. (MX field).<br />Write <b><code>%s</code></b> in this field if your mail
|
#. (MX field).<br />Write <b><code>%s</code></b> in this field if your mail
|
||||||
#. must be managed by %s<br />or put the IP address or name of the mail server
|
#. must be managed by %s<br />or put the IP address or name of the mail server
|
||||||
|
|
|
@ -728,6 +728,10 @@ msgstr "R
|
||||||
msgid "err_bro_2"
|
msgid "err_bro_2"
|
||||||
msgstr "Vous ne pouvez pas déplacer un fichier dans le même répertoire !"
|
msgstr "Vous ne pouvez pas déplacer un fichier dans le même répertoire !"
|
||||||
|
|
||||||
|
#. Right incorrect
|
||||||
|
msgid "err_bro_3"
|
||||||
|
msgstr "Vous n'avez pas le droit d'écrire dans ce répertoire. Vérifiez les droits d'accès !"
|
||||||
|
|
||||||
#. If we manage your DNS <br />You can manage your mails elsewhere if you want
|
#. If we manage your DNS <br />You can manage your mails elsewhere if you want
|
||||||
#. (MX field).<br />Write <b><code>%s</code></b> in this field if your mail
|
#. (MX field).<br />Write <b><code>%s</code></b> in this field if your mail
|
||||||
#. must be managed by %s<br />or put the IP address or name of the mail server
|
#. must be managed by %s<br />or put the IP address or name of the mail server
|
||||||
|
|
Loading…
Reference in New Issue