diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Config.php | 7 | ||||
-rw-r--r-- | classes/Feeds.php | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/classes/Config.php b/classes/Config.php index a1886e877..e9d44063c 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -491,12 +491,9 @@ class Config { $self_url_path = $proto . '://' . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); $self_url_path = preg_replace("/(\/api\/{1,})?(\w+\.php)?(\?.*$)?$/", "", $self_url_path); + $self_url_path = preg_replace("/(\/plugins(.local))\/.{1,}$/", "", $self_url_path); - if (substr($self_url_path, -1) === "/") { - return substr($self_url_path, 0, -1); - } else { - return $self_url_path; - } + return rtrim($self_url_path, "/"); } } /* sanity check stuff */ diff --git a/classes/Feeds.php b/classes/Feeds.php index b58c7f3b6..71379762f 100644 --- a/classes/Feeds.php +++ b/classes/Feeds.php @@ -2235,7 +2235,7 @@ class Feeds extends Handler_Protected { * @return array{0: string, 1: array<int, string>} [$search_query_part, $search_words] */ private static function _search_to_sql(string $search, string $search_language, int $owner_uid): array { - $keywords = str_getcsv(preg_replace('/(-?\w+)\:"(\w+)/', '"{$1}:{$2}', trim($search)), ' '); + $keywords = str_getcsv(preg_replace('/(-?\w+)\:"(\w+)/', '"{$1}:{$2}', trim($search)), ' ', '"', ''); $query_keywords = array(); $search_words = array(); $search_query_leftover = array(); |