Просмотр исходного кода

insert only base path in JSON API responses, without GET parameters

El RIDO 1 месяц назад
Родитель
Сommit
164c839c39
2 измененных файлов с 3 добавлено и 2 удалено
  1. 1 0
      CHANGELOG.md
  2. 2 2
      lib/Request.php

+ 1 - 0
CHANGELOG.md

@@ -4,6 +4,7 @@
 * FIXED: State corruption after "Remove attachment" (#1824)
 * FIXED: Copy button is hidden if the document is made as markdown (#1703)
 * FIXED: Shortened URLs from YOURLS received but failed to parse (#1844)
+* FIXED: Insert only base path in JSON API responses, without GET parameters
 
 ## 2.0.4 (2026-05-03)
 * ADDED: Translations for Swedish & Persian

+ 2 - 2
lib/Request.php

@@ -220,7 +220,7 @@ class Request
     }
 
     /**
-     * Get request URI
+     * Get request URI path without GET parameters
      *
      * @access public
      * @return string
@@ -228,7 +228,7 @@ class Request
     public function getRequestUri()
     {
         $uri = array_key_exists('REQUEST_URI', $_SERVER) ? filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL) : '';
-        return empty($uri) ? '/' : $uri;
+        return empty($uri) ? '/' : parse_url($uri, PHP_URL_PATH);
     }
 
     /**