This commit is contained in:
Axel ROGER 2013-04-18 14:46:28 +00:00
parent 92cfbd30a4
commit bd85c55393
1 changed files with 8 additions and 2 deletions

View File

@ -95,8 +95,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 {
@ -453,9 +460,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"));