diff options
| author | 2018-06-03 13:35:38 +0200 | |
|---|---|---|
| committer | 2018-06-03 13:35:38 +0200 | |
| commit | c0122003fe3031926546012b86a38b5187082613 (patch) | |
| tree | 5502841327e7775f280fbd12732b4e8b8b7be6ff /p/ext.php | |
| parent | 029f4107123f6c318584bf9a43da7118c318657f (diff) | |
| parent | be778c6bc2d8075e5a923153183b47507a2a71e3 (diff) | |
Merge pull request #1902 from FreshRSS/dev1.11.0
FreshRSS 1.11.0
Diffstat (limited to 'p/ext.php')
| -rw-r--r-- | p/ext.php | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -19,13 +19,14 @@ require(__DIR__ . '/../constants.php'); */ function is_valid_path($path) { // It must be under the extension path. - $in_ext_path = (substr($path, 0, strlen(EXTENSIONS_PATH)) === EXTENSIONS_PATH); + $real_ext_path = realpath(EXTENSIONS_PATH); + $in_ext_path = (substr($path, 0, strlen($real_ext_path)) === $real_ext_path); if (!$in_ext_path) { return false; } // File to serve must be under a `ext_dir/static/` directory. - $path_relative_to_ext = substr($path, strlen(EXTENSIONS_PATH) + 1); + $path_relative_to_ext = substr($path, strlen($real_ext_path) + 1); $path_splitted = explode('/', $path_relative_to_ext); if (count($path_splitted) < 3 || $path_splitted[1] !== 'static') { return false; |
