| @@ -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) { |