EllisLab/CodeIgniter — pull request #2997 by joni2back (2014-04-09 16:49:15+00:00)
Title: Fix - Preventing an infinite recursion

When the recursive method list the files to make sure that the folder is empty (list_files), the delete_dir list again the self dir and the parent, and recursion is generated.

Logging
```php
public function delete_dir($filepath)
{
Logger::log('Deleting $item: ' . $filepath);
...
$list = $this->list_files($filepath);
if ( ! empty($list)) {
for ($i = 0, $c = count($list); $i < $c; $i++) {
Logger::log('Deleting $item: ' . $list[$i]);
...
...
...
```
Output:
```
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder/.. [] []
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder/.. [] []
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder [] []
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder [] []
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder/.. [] []
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder/.. [] []
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder [] []
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder [] []
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder/.. [] []
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder/.. [] []
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder [] []
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder [] []
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder/.. [] []
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder/.. [] []
[2014-04-08 11:07:37] logger.INFO: Deleting $item: /folder [] []
```

Already patched in https://github.com/fuel/core/pull/1673