aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2025-04-20 18:04:03 +0200
committerMario Vavti <mario@mariovavti.com>2025-04-20 18:04:03 +0200
commit7855aaf53c9ac644bdcaacd8ac36b8fe01ae469e (patch)
tree95f600e6a22e9650834cd3b33d79dd680232e86d
parent6535475a992ec165ed9ef810f2afa058bf1b7a49 (diff)
downloadvolse-hubzilla-7855aaf53c9ac644bdcaacd8ac36b8fe01ae469e.tar.gz
volse-hubzilla-7855aaf53c9ac644bdcaacd8ac36b8fe01ae469e.tar.bz2
volse-hubzilla-7855aaf53c9ac644bdcaacd8ac36b8fe01ae469e.zip
set App::$query_string from from server.request_uri instead of server.query_string because the latter will mostly be urldecoded by the server already - issue #1903 (first part)
-rw-r--r--boot.php20
1 files changed, 7 insertions, 13 deletions
diff --git a/boot.php b/boot.php
index 657849da8..a2799cc90 100644
--- a/boot.php
+++ b/boot.php
@@ -887,6 +887,8 @@ class App {
* App constructor.
*/
public static function init() {
+
+
// we'll reset this after we read our config file
date_default_timezone_set('UTC');
@@ -927,22 +929,14 @@ class App {
self::$path = $path;
}
- if ((x($_SERVER, 'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'], 0, 2) === "q=") {
- self::$query_string = str_replace(['<', '>'], ['&lt;', '&gt;'], substr($_SERVER['QUERY_STRING'], 2));
-
- // removing trailing / - maybe a nginx problem
- if (substr(self::$query_string, 0, 1) == "/")
- self::$query_string = substr(self::$query_string, 1);
-
- // trim trailing '&' if no extra args are present
- self::$query_string = rtrim(self::$query_string, '&');
-
- // change the first & to ?
- self::$query_string = preg_replace('/&/', '?', self::$query_string, 1);
+ if (!empty($_SERVER['REQUEST_URI'])) {
+ self::$query_string = str_replace(['<', '>'], ['&lt;', '&gt;'], $_SERVER['REQUEST_URI']);
+ self::$query_string = ltrim(self::$query_string, '/');
}
- if (x($_GET, 'q'))
+ if (!empty($_GET['q'])) {
self::$cmd = escape_tags(trim($_GET['q'], '/\\'));
+ }
// Serve raw files from the file system in certain cases.
$filext = pathinfo(self::$cmd, PATHINFO_EXTENSION);