1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-18 22:58:10 +01:00

[feature/auto-loading] Only check subdir if there is another name part.

PHPBB3-9682
This commit is contained in:
Nils Adermann 2010-08-19 22:06:19 +02:00
parent dea1d660fb
commit f870434222
3 changed files with 13 additions and 1 deletions

View File

@ -115,7 +115,7 @@ class phpbb_class_loader
$dirs = '';
for ($i = 0; is_dir($path_prefix . $dirs . $parts[$i]) && $i < sizeof($parts); $i++)
for ($i = 0, $n = sizeof($parts); $i < $n && is_dir($path_prefix . $dirs . $parts[$i]); $i++)
{
$dirs .= $parts[$i] . '/';
}

View File

@ -23,6 +23,12 @@ class phpbb_class_loader_test extends PHPUnit_Framework_TestCase
$prefix .= 'includes/';
$this->assertEquals(
'',
$class_loader->resolve_path('phpbb_dir'),
'Class with same name as a directory is unloadable'
);
$this->assertEquals(
$prefix . 'class_name.php',
$class_loader->resolve_path('phpbb_class_name'),

View File

@ -0,0 +1,6 @@
<?php
class phpbb_dir
{
}