Skip to content

Commit

Permalink
More fixes regarding rcmail::url() (#9052)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Jul 10, 2023
1 parent 8adebea commit ca1b23e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion program/include/rcmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,8 @@ protected function get_request_path()
return rtrim($path, '/') . '/';
}

$path = preg_replace('/[?&].*$/', '', (string) $path);
$path = preg_replace('/index\.php.*$/', '', (string) $path);
$path = preg_replace('/[?&].*$/', '', $path);
$path = preg_replace('![^/]+$!', '', $path);

return rtrim($path, '/') . '/';
Expand Down
2 changes: 0 additions & 2 deletions program/include/rcmail_oauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ public function get_redirect_uri()
$url = $this->rcmail->url([], true, true);

// rewrite redirect URL to not contain query parameters because some providers do not support this
// also make sure to not duplicate the index.php/... path
$url = preg_replace('/\?.*/', '', $url);
$url = preg_replace('/index\.php.*$/', '', $url);

return slashify($url) . 'index.php/login/oauth';
}
Expand Down

0 comments on commit ca1b23e

Please sign in to comment.