PluginProbe
User Access Manager / 2.3.2
User Access Manager v2.3.2
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
← All changes | src/File/FileHandler.php +3 -14 2.3.132.3.2 View file →
@@ -94,20 +94,9 @@
94 94 header("HTTP/1.1 200 OK");
95 95 $downloadType = $this->mainConfig->getDownloadType();
96 96
97 97 if ($downloadType === 'xsendfile') {
98 - if ($this->wordpress->isNginx()) {
99 - // Use /uam-files/ prefix so the internal redirect goes to a dedicated
100 - // internal location that bypasses UAM's rewrite rules, avoiding a loop.
101 - $uri = '/uam-files' . str_replace(rtrim(ABSPATH, '/'), '', $file);
102 - header("X-Accel-Redirect: $uri");
103 - } elseif ($this->wordpress->isApacheModuleLoaded('mod_xsendfile')) {
104 - header("X-Sendfile: $file");
105 - } else {
106 - // mod_xsendfile is not available — fall back to fopen so the file
107 - // is still delivered rather than sending an empty response.
108 - $downloadType = 'fopen';
109 - }
98 + header("X-Sendfile: $file");
110 99 }
111 100
112 101 $this->addDefaultHeader($file, $isInline);
113 102
@@ -308,9 +297,9 @@
308 297 $this->wordpressConfig->getUploadDirectory()
309 298 );
310 299 }
311 300
312 - public function createFileProtection(?string $dir = null, ?string $objectType = null): bool
301 + public function createFileProtection(string $dir = null, string $objectType = null): bool
313 302 {
314 303 $dir = ($dir === null) ? $this->wordpressConfig->getUploadDirectory() : $dir;
315 304
316 305 if ($dir !== null) {
@@ -319,9 +308,9 @@
319 308
320 309 return false;
321 310 }
322 311
323 - public function deleteFileProtection(?string $dir = null): bool
312 + public function deleteFileProtection(string $dir = null): bool
324 313 {
325 314 $dir = ($dir === null) ? $this->wordpressConfig->getUploadDirectory() : $dir;
326 315
327 316 if ($dir !== null) {