Improve system path handling and use the system path to determine if we need to show a custom theme.

8.0.x
effulgentsia 2012-05-09 21:11:33 -05:00 committed by Larry Garfield
parent 7bf2a1ae4c
commit 87979eaad8
2 changed files with 3 additions and 2 deletions

View File

@ -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) {

View File

@ -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');
}