mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[ticket/11362] Use new filesystem class in finder
PHPBB3-11362
This commit is contained in:
parent
869e00a23b
commit
158bce0209
1 changed files with 5 additions and 2 deletions
|
@ -23,6 +23,7 @@ if (!defined('IN_PHPBB'))
|
||||||
class phpbb_extension_finder
|
class phpbb_extension_finder
|
||||||
{
|
{
|
||||||
protected $extension_manager;
|
protected $extension_manager;
|
||||||
|
protected $filesystem;
|
||||||
protected $phpbb_root_path;
|
protected $phpbb_root_path;
|
||||||
protected $cache;
|
protected $cache;
|
||||||
protected $php_ext;
|
protected $php_ext;
|
||||||
|
@ -54,15 +55,17 @@ class phpbb_extension_finder
|
||||||
* @param phpbb_extension_manager $extension_manager An extension manager
|
* @param phpbb_extension_manager $extension_manager An extension manager
|
||||||
* instance that provides the finder with a list of active
|
* instance that provides the finder with a list of active
|
||||||
* extensions and their locations
|
* extensions and their locations
|
||||||
|
* @param phpbb_filesystem $filesystem Filesystem instance
|
||||||
* @param string $phpbb_root_path Path to the phpbb root directory
|
* @param string $phpbb_root_path Path to the phpbb root directory
|
||||||
* @param phpbb_cache_driver_interface $cache A cache instance or null
|
* @param phpbb_cache_driver_interface $cache A cache instance or null
|
||||||
* @param string $php_ext php file extension
|
* @param string $php_ext php file extension
|
||||||
* @param string $cache_name The name of the cache variable, defaults to
|
* @param string $cache_name The name of the cache variable, defaults to
|
||||||
* _ext_finder
|
* _ext_finder
|
||||||
*/
|
*/
|
||||||
public function __construct(phpbb_extension_manager $extension_manager, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $php_ext = '.php', $cache_name = '_ext_finder')
|
public function __construct(phpbb_extension_manager $extension_manager, phpbb_filesystem $filesystem, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $php_ext = '.php', $cache_name = '_ext_finder')
|
||||||
{
|
{
|
||||||
$this->extension_manager = $extension_manager;
|
$this->extension_manager = $extension_manager;
|
||||||
|
$this->filesystem = $filesystem;
|
||||||
$this->phpbb_root_path = $phpbb_root_path;
|
$this->phpbb_root_path = $phpbb_root_path;
|
||||||
$this->cache = $cache;
|
$this->cache = $cache;
|
||||||
$this->php_ext = $php_ext;
|
$this->php_ext = $php_ext;
|
||||||
|
@ -227,7 +230,7 @@ class phpbb_extension_finder
|
||||||
*/
|
*/
|
||||||
protected function sanitise_directory($directory)
|
protected function sanitise_directory($directory)
|
||||||
{
|
{
|
||||||
$directory = phpbb_clean_path($directory);
|
$directory = $this->filesystem->clean_path($directory);
|
||||||
$dir_len = strlen($directory);
|
$dir_len = strlen($directory);
|
||||||
|
|
||||||
if ($dir_len > 1 && $directory[$dir_len - 1] === '/')
|
if ($dir_len > 1 && $directory[$dir_len - 1] === '/')
|
||||||
|
|
Loading…
Add table
Reference in a new issue