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:
@@ -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('#<(/?strong)>#i', '<$1>', $message);
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user