[CORE] Allow to force non-fancy URLs

Essential to allow toggling fancy urls later. In some cases it is
critical to keep the URL an unique URI.
This commit is contained in:
Diogo Cordeiro 2019-10-26 16:10:44 +01:00 committed by Diogo Peralta Cordeiro
parent 3dcedfa8bd
commit d69f479cba

View File

@ -1383,7 +1383,7 @@ function common_relative_profile($sender, $nickname, $dt=null)
return null;
}
function common_local_url($action, $args=null, $params=null, $fragment=null, $addSession=true)
function common_local_url($action, $args=null, $params=null, $fragment=null, $addSession=true, $defancy = false)
{
if (Event::handle('StartLocalURL', [&$action, &$params, &$fragment, &$addSession, &$url])) {
$r = Router::get();
@ -1391,7 +1391,7 @@ function common_local_url($action, $args=null, $params=null, $fragment=null, $ad
$ssl = GNUsocial::useHTTPS();
if (common_config('site', 'fancy')) {
if (common_config('site', 'fancy') && !$defancy) {
$url = common_path($path, $ssl, $addSession);
} else {
if (mb_strpos($path, '/index.php') === 0) {