1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge branch 'ticket/17296' into ticket/17296-master

This commit is contained in:
Marc Alexander
2024-03-18 21:52:34 +01:00
4 changed files with 42 additions and 26 deletions

View File

@@ -90,12 +90,15 @@ class kernel_exception_subscriber implements EventSubscriberInterface
}
else if (!$this->debug && $exception instanceof NotFoundHttpException)
{
// Do not update user session page if it does not exist
$this->user->update_session_page = false;
$message = $this->language->lang('PAGE_NOT_FOUND');
}
// Do not update user session page if it does not exist
if ($exception instanceof NotFoundHttpException)
{
$this->user->update_session_page = false;
}
// Show <strong> text in bold
$message = preg_replace('#&lt;(/?strong)&gt;#i', '<$1>', $message);

View File

@@ -38,6 +38,9 @@ class path_helper
/** @var string */
protected $web_root_path;
/** @var bool Flag whether we're in adm path */
protected $in_adm_path = false;
/**
* Constructor
*
@@ -114,7 +117,13 @@ class path_helper
$path = substr($path, 8);
}
return filesystem_helper::clean_path($web_root_path . $path);
$path = filesystem_helper::clean_path($web_root_path . $path);
// Further clean path if we're in adm
if ($this->in_adm_path && str_starts_with($path, $this->phpbb_root_path . $this->adm_relative_path))
{
$path = substr($path, strlen($this->phpbb_root_path . $this->adm_relative_path));
}
}
return $path;
@@ -178,6 +187,11 @@ class path_helper
return $this->web_root_path = filesystem_helper::clean_path('./../' . $this->phpbb_root_path);
}
if ($path_info === '/' && defined('ADMIN_START') && preg_match('/\/' . preg_quote($this->adm_relative_path, '/') . 'index\.' . $this->php_ext . '$/', $script_name))
{
$this->in_adm_path = true;
}
/*
* If the path info is empty (single /), then we're not using
* a route like app.php/foo/bar