Improve system path handling and use the system path to determine if we need to show a custom theme.
parent
7bf2a1ae4c
commit
87979eaad8
|
@ -16,7 +16,8 @@ use Symfony\Component\HttpFoundation\Request;
|
|||
abstract class PathListenerBase {
|
||||
|
||||
public function extractPath(Request $request) {
|
||||
return $request->attributes->get('system_path') ?: trim($request->getPathInfo(), '/');
|
||||
$path = $request->attributes->get('system_path');
|
||||
return isset($path) ? $path : trim($request->getPathInfo(), '/');
|
||||
}
|
||||
|
||||
public function setPath(Request $request, $path) {
|
||||
|
|
|
@ -2021,7 +2021,7 @@ function system_add_module_assets() {
|
|||
*/
|
||||
function system_custom_theme() {
|
||||
if ($request = request()) {
|
||||
$path = ltrim($request->getPathInfo(), '/');
|
||||
$path = $request->attributes->get('system_path');
|
||||
if (user_access('view the administration theme') && path_is_admin($path)) {
|
||||
return variable_get('admin_theme');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue