Commit 09d7b819 authored by alexpott's avatar alexpott
Browse files

Issue #1999434 by kim.pepper, atchijov: Use Symfony Request for system module.

parent 67ffbd35
......@@ -257,8 +257,10 @@ function system_themes_admin_form_submit($form, &$form_state) {
* Menu callback; Set the default theme.
*/
function system_theme_default() {
if (isset($_REQUEST['theme']) && isset($_REQUEST['token']) && drupal_valid_token($_REQUEST['token'], 'system-theme-operation-link')) {
$theme = $_REQUEST['theme'];
$request = Drupal::request();
$theme = $request->get('theme');
$token = $request->get('token');
if (!empty($theme) && !empty($token) && drupal_valid_token($token, 'system-theme-operation-link')) {
// Get current list of themes.
$themes = list_themes();
......
......@@ -1715,9 +1715,7 @@ function hook_template_preprocess_default_variables_alter(&$variables) {
*/
function hook_custom_theme() {
// Allow the user to request a particular theme via a query parameter.
if (isset($_GET['theme'])) {
return $_GET['theme'];
}
return Drupal::request()->query->get('theme');
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment