aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-04-06 14:07:19 +0200
committerGravatar GitHub <noreply@github.com> 2019-04-06 14:07:19 +0200
commit74f92658b71e602d7fff3bbd249e3ea8869fa2ad (patch)
tree92d453a319e9f280425e6cc50102db81f65f1c72
parent09a5b4493d94120f836b85db5b84c0db7309a4ca (diff)
Fix for extensions on Windows (#2348)
https://github.com/FreshRSS/FreshRSS/issues/994 https://github.com/FreshRSS/FreshRSS/issues/2287
-rw-r--r--p/ext.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/p/ext.php b/p/ext.php
index 427bdc253..1b123f47d 100644
--- a/p/ext.php
+++ b/p/ext.php
@@ -20,6 +20,11 @@ require(__DIR__ . '/../constants.php');
function is_valid_path($path) {
// It must be under the extension path.
$real_ext_path = realpath(EXTENSIONS_PATH);
+
+ //Windows compatibility
+ $real_ext_path = str_replace('\\', '/', $real_ext_path);
+ $path = str_replace('\\', '/', $path);
+
$in_ext_path = (substr($path, 0, strlen($real_ext_path)) === $real_ext_path);
if (!$in_ext_path) {
return false;