]> git.mxchange.org Git - friendica.git/blobdiff - src/App/BaseURL.php
Merge pull request #7744 from MrPetovan/task/7190-remove-defaults-src
[friendica.git] / src / App / BaseURL.php
index ad5fd0d4ede3d360b2dd76f5f2c84d8cd95b2155..8d76a0d2d25d9dcaa519dc87a64f88907e2bc046 100644 (file)
@@ -338,12 +338,12 @@ class BaseURL
                /* Relative script path to the web server root
                 * Not all of those $_SERVER properties can be present, so we do by inverse priority order
                 */
-               $relative_script_path = '';
-               $relative_script_path = defaults($this->server, 'REDIRECT_URL', $relative_script_path);
-               $relative_script_path = defaults($this->server, 'REDIRECT_URI', $relative_script_path);
-               $relative_script_path = defaults($this->server, 'REDIRECT_SCRIPT_URL', $relative_script_path);
-               $relative_script_path = defaults($this->server, 'SCRIPT_URL', $relative_script_path);
-               $relative_script_path = defaults($this->server, 'REQUEST_URI', $relative_script_path);
+               $relative_script_path =
+                       ($this->server['REDIRECT_URL']        ?? '') ?:
+                       ($this->server['REDIRECT_URI']        ?? '') ?:
+                       ($this->server['REDIRECT_SCRIPT_URL'] ?? '') ?:
+                       ($this->server['SCRIPT_URL']          ?? '') ?:
+                        $this->server['REQUEST_URI']         ?? '';
 
                /* $relative_script_path gives /relative/path/to/friendica/module/parameter
                 * QUERY_STRING gives pagename=module/parameter