Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt November 11, 2024
Code Name Jessica Posted December 31, 2024 Posted December 31, 2024 Someone messaged me asking to post this: Hi ive found a bug in the api system but i can't post on the forum. If i share the info with you could you post it or get it to the correct location? file: system/Dispatcher/Api.php function: _setPath() protected function _setPath() { /* Decode URL */ if (\IPS\Settings::i()->use_friendly_urls && \IPS\Settings::i()->htaccess_mod_rewrite && mb_substr(\IPS\Request::i()->url()->data[\IPS\Http\Url::COMPONENT_PATH], -14) !== '/api/index.php') { /* We are using Mod Rewrite URLs, so look in the path */ $this->path = mb_substr(\IPS\Request::i()->url()->data[\IPS\Http\Url::COMPONENT_PATH], mb_strpos(\IPS\Request::i()->url()->data[\IPS\Http\Url::COMPONENT_PATH], '/api/') + 5); /* nginx won't convert the 'fake' query string to $_GET params, so do this now */ if (!empty(\IPS\Request::i()->url()->data[\IPS\Http\Url::COMPONENT_QUERY])) { parse_str(\IPS\Request::i()->url()->data[\IPS\Http\Url::COMPONENT_QUERY], $params); foreach ($params as $k => $v) { if (!isset(\IPS\Request::i()->$k)) { \IPS\Request::i()->$k = $v; } } } } else { $this->path = mb_substr(\IPS\Request::i()->url()->data[\IPS\Http\Url::COMPONENT_PATH], mb_strpos(\IPS\Request::i()->url()->data[\IPS\Http\Url::COMPONENT_PATH], '/api/') + 5); /* However, if we passed any actual query string arguments, we need to strip those */ if (mb_strpos($this->path, '?') !== false) { $this->path = mb_substr($this->path, 0, mb_strpos($this->path, '?')); } } }
Solution Jim M Posted December 31, 2024 Solution Posted December 31, 2024 This individual has already messaged us. Thank you though!
Recommended Posts