This commit is contained in:
Alan Garcia 2013-04-18 11:50:45 +00:00
parent d02fa25e6c
commit 8e5205e46e
1 changed files with 9 additions and 3 deletions

View File

@ -107,8 +107,15 @@ class m_bro {
if (substr($dir,0,strlen($root))!=$root) {
return false;
}
// recomposer le chemin
$dir = $dir . '/' . $file;
# Si on tente de mettre un '..' alors erreur
if ( preg_match("/\/\.\.\//", $dir) || preg_match("/\/\.\.$/", $dir) ) {
return false;
}
if ($strip) {
$dir=substr($dir,strlen($root));
} else {
@ -465,9 +472,8 @@ class m_bro {
if ($new[0] != '/') {
$new = $old . '/' . $new;
} else {
$new = $this->convertabsolute($new,0);
}
$new = $this->convertabsolute($new,0);
if (!$new) {
$err->raise("bro",_("File or folder name is incorrect"));