mirror of
https://github.com/bcit-ci/CodeIgniter.git
synced 2025-02-20 11:13:29 +08:00
better declarations an logical structure (in case we don't have perms to read)
parent
61ce5065b0
commit
d68538e5d2
@ -65,12 +65,11 @@ class Browser extends Controller {
|
||||
// we'll need this to build links
|
||||
$this->load->helper('url');
|
||||
|
||||
$dirs = array();
|
||||
$files = array();
|
||||
// let's traverse the directory
|
||||
if ( $handle = opendir( $absolute_path ))
|
||||
if ( $handle = @opendir( $absolute_path ))
|
||||
{
|
||||
$dirs = array();
|
||||
$files = array();
|
||||
|
||||
while ( false !== ($file = readdir( $handle )))
|
||||
{
|
||||
if (( $file != "." AND $file != ".." ))
|
||||
@ -89,11 +88,12 @@ class Browser extends Controller {
|
||||
sort( $dirs );
|
||||
sort( $files );
|
||||
|
||||
// parent directory, here to ensure it's the first in the array
|
||||
if ( $path_in_url != '' )
|
||||
array_unshift ( $dirs, array( 'name' => '..' ));
|
||||
|
||||
}
|
||||
// parent directory
|
||||
// here to ensure it's available and the first in the array
|
||||
if ( $path_in_url != '' )
|
||||
array_unshift ( $dirs, array( 'name' => '..' ));
|
||||
|
||||
// send the view
|
||||
$data = array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user