phpBB

Code Changes

File: phpbb/filesystem/filesystem.php

  Unmodified   Added   Modified   Removed
Line 171Line 171
				continue;
}


				continue;
}


			if ($part === '..' && !empty($filtered) && $filtered[sizeof($filtered) - 1] !== '.' && $filtered[sizeof($filtered) - 1] !== '..')

			if ($part === '..' && !empty($filtered) && $filtered[count($filtered) - 1] !== '.' && $filtered[count($filtered) - 1] !== '..')

			{
array_pop($filtered);
}

			{
array_pop($filtered);
}

Line 367Line 367
				$common_php_group	= @filegroup(__FILE__);

// And the owner and the groups PHP is running under.

				$common_php_group	= @filegroup(__FILE__);

// And the owner and the groups PHP is running under.

				$php_uid	= (function_exists('posic_getuid')) ? @posix_getuid() : false;

				$php_uid	= (function_exists('posix_getuid')) ? @posix_getuid() : false;

				$php_gids	= (function_exists('posix_getgroups')) ? @posix_getgroups() : false;

// If we are unable to get owner/group, then do not try to set them by guessing

				$php_gids	= (function_exists('posix_getgroups')) ? @posix_getgroups() : false;

// If we are unable to get owner/group, then do not try to set them by guessing

Line 671Line 671
				else if (function_exists('debug_backtrace'))
{
$call_stack = debug_backtrace(0);

				else if (function_exists('debug_backtrace'))
{
$call_stack = debug_backtrace(0);

					$this->working_directory = str_replace(DIRECTORY_SEPARATOR, '/', dirname($call_stack[sizeof($call_stack) - 1]['file']));

					$this->working_directory = str_replace(DIRECTORY_SEPARATOR, '/', dirname($call_stack[count($call_stack) - 1]['file']));

				}
else
{

				}
else
{

Line 683Line 683
					//$dir_parts = explode(DIRECTORY_SEPARATOR, __DIR__);
//$namespace_parts = explode('\\', trim(__NAMESPACE__, '\\'));


					//$dir_parts = explode(DIRECTORY_SEPARATOR, __DIR__);
//$namespace_parts = explode('\\', trim(__NAMESPACE__, '\\'));


					//$namespace_part_count = sizeof($namespace_parts);

					//$namespace_part_count = count($namespace_parts);


// Check if we still loading from root
//if (array_slice($dir_parts, -$namespace_part_count) === $namespace_parts)


// Check if we still loading from root
//if (array_slice($dir_parts, -$namespace_part_count) === $namespace_parts)

Line 807Line 807
				array_pop($resolved);
$resolved_path = false;
}

				array_pop($resolved);
$resolved_path = false;
}

			else if ($path_part === '..' && !empty($resolved) && !in_array($resolved[sizeof($resolved) - 1], array('.', '..')))

			else if ($path_part === '..' && !empty($resolved) && !in_array($resolved[count($resolved) - 1], array('.', '..')))

			{
array_pop($resolved);
$resolved_path = false;

			{
array_pop($resolved);
$resolved_path = false;

Line 835Line 835
				$current_path = $resolved_path . '/' . $path_part;

// Resolve symlinks

				$current_path = $resolved_path . '/' . $path_part;

// Resolve symlinks

				if (is_link($current_path))

				if (@is_link($current_path))

				{
if (!function_exists('readlink'))
{

				{
if (!function_exists('readlink'))
{

Line 872Line 872

$resolved_path = false;
}


$resolved_path = false;
}

				else if (is_dir($current_path . '/'))

				else if (@is_dir($current_path . '/'))

				{
$resolved[] = $path_part;
$resolved_path = $current_path;
}

				{
$resolved[] = $path_part;
$resolved_path = $current_path;
}

				else if (is_file($current_path))

				else if (@is_file($current_path))

				{
$resolved[] = $path_part;
$resolved_path = $current_path;

				{
$resolved[] = $path_part;
$resolved_path = $current_path;