Skip to content

Commit

Permalink
Debug die on access from another file root
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Jan 19, 2017
1 parent fa363b1 commit cc12240
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion inc/files/model/_fileroot.class.php
Expand Up @@ -250,7 +250,12 @@ function contains( $rel_path )
$real_abs_path = get_canonical_path( $this->ads_path.$rel_path );

// Check if the given file/folder is realy contained in this root:
return ( strpos( $real_abs_path, $this->ads_path ) === 0 );
if( ! empty( $real_abs_path ) && strpos( $real_abs_path, $this->ads_path ) !== 0 )
{ // Deny access from another file root:
debug_die( 'Denied access to files from another root!' );
}

return true;
}
}

Expand Down

0 comments on commit cc12240

Please sign in to comment.