Skip to content

Commit e077d5b

Browse files
committed
openbasedir
1 parent 84b0c8c commit e077d5b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/phpFastCache/phpFastCache.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,14 @@
2222
spl_autoload_register(function ($entity) {
2323
// Explode is faster than substr & strstr also more control
2424
$module = explode('\\',$entity,2);
25-
if ($module[0] !== 'phpFastCache') {
25+
if ($module[0] !== 'phpFastCache'
26+
|| !OpenBaseDir::checkBaseDir(__DIR__)) {
2627
/**
2728
* Not a part of phpFastCache file
2829
* then we return here.
2930
*/
3031
return;
3132
}
32-
if(!OpenBaseDir::checkBaseDir(__DIR__)) {
33-
/*
34-
* in case system have open base_dir, it will check ONE time only for the __DIR__
35-
* If open_base_dir is NULL, it skip checking
36-
*/
37-
return;
38-
}
3933

4034
$entity = str_replace('\\', '/', $module[1]);
4135
$path = __DIR__ . '/' . $entity . '.' . PHP_EXT;

0 commit comments

Comments
 (0)