diff --git a/core/lib/Drupal/Core/Routing/UrlGenerator.php b/core/lib/Drupal/Core/Routing/UrlGenerator.php index 6be1353..3070bc2 100644 --- a/core/lib/Drupal/Core/Routing/UrlGenerator.php +++ b/core/lib/Drupal/Core/Routing/UrlGenerator.php @@ -77,6 +77,18 @@ class UrlGenerator extends ProviderBasedGenerator implements UrlGeneratorInterfa protected $mixedModeSessions; /** + * Overrides characters that will not be percent-encoded in the path segment. + * + * @see \Symfony\Component\Routing\Generator\UrlGenerator + */ + protected $decodedChars = array( + // the slash can be used to designate a hierarchical structure and we want allow using it with this meaning + // some webservers don't allow the slash in encoded form in the path for security reasons anyway + // see http://stackoverflow.com/questions/4069002/http-400-if-2f-part-of-get-url-in-jboss + '%2F' => '/', + ); + + /** * Constructs a new generator object. * * @param \Drupal\Core\Routing\RouteProviderInterface $provider diff --git a/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php b/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php index 010214f..2171ceb 100644 --- a/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php +++ b/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php @@ -34,6 +34,6 @@ public function getDirectoryPath() { */ function getExternalUrl() { $path = str_replace('\\', '/', $this->getTarget()); - return $this->url('system.files', ['scheme' => $path], ['absolute' => TRUE]); + return $this->url('system.files_url_generator', ['filepath' => $path], ['absolute' => TRUE]); } } diff --git a/core/modules/aggregator/src/Tests/AggregatorTestBase.php b/core/modules/aggregator/src/Tests/AggregatorTestBase.php index 08583e9..57fcf88 100644 --- a/core/modules/aggregator/src/Tests/AggregatorTestBase.php +++ b/core/modules/aggregator/src/Tests/AggregatorTestBase.php @@ -87,7 +87,7 @@ function deleteFeed(FeedInterface $feed) { function getFeedEditArray($feed_url = NULL, array $edit = array()) { $feed_name = $this->randomMachineName(10); if (!$feed_url) { - $feed_url = \Drupal::url('view.frontpage.feed_1', array( + $feed_url = \Drupal::url('view.frontpage.feed_1', array(), array( 'query' => array('feed' => $feed_name), 'absolute' => TRUE, )); diff --git a/core/modules/comment/src/Tests/CommentTypeTest.php b/core/modules/comment/src/Tests/CommentTypeTest.php index 55b8b16..ba32639 100644 --- a/core/modules/comment/src/Tests/CommentTypeTest.php +++ b/core/modules/comment/src/Tests/CommentTypeTest.php @@ -108,7 +108,7 @@ public function testCommentTypeEditing() { $this->drupalGet('admin/structure/comment'); $this->assertRaw('Bar', 'New name was displayed.'); $this->clickLink('Manage fields'); - $this->assertEqual(\Drupal::url('field_ui.overview_comment_id', array(), array('absolute' => TRUE)), $this->getUrl(), 'Original machine name was used in URL.'); + $this->assertEqual(\Drupal::url('field_ui.overview_comment', array('comment_type' => 'comment'), array('absolute' => TRUE)), $this->getUrl(), 'Original machine name was used in URL.'); // Remove the body field. $this->drupalPostForm('admin/structure/comment/manage/comment/fields/comment.comment.comment_body/delete', array(), t('Delete')); diff --git a/core/modules/contact/src/Tests/ContactSitewideTest.php b/core/modules/contact/src/Tests/ContactSitewideTest.php index e91aaff..4dd9a1e 100644 --- a/core/modules/contact/src/Tests/ContactSitewideTest.php +++ b/core/modules/contact/src/Tests/ContactSitewideTest.php @@ -59,7 +59,7 @@ function testSiteWideContact() { // field_ui enabled admin/structure/contact/manage/personal/fields exists. // @todo: See https://drupal.org/node/2031223 for the above $edit_link = $this->xpath('//a[@href=:href]', array( - ':href' => \Drupal::url('field_ui.field_edit_comment', array('field_config' => 'personal')) + ':href' => \Drupal::url('entity.contact_form.edit_form', array('contact_form' => 'personal')) )); $this->assertTrue(empty($edit_link), format_string('No link containing href %href found.', array('%href' => 'admin/structure/contact/manage/personal') diff --git a/core/modules/field/field.module b/core/modules/field/field.module index 5809bae..a16a06b 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -138,12 +138,7 @@ function field_system_info_alter(&$info, Extension $file, $type) { } } if ($non_deleted) { - if (\Drupal::moduleHandler()->moduleExists('field_ui')) { - $explanation = t('Field type(s) in use - see Field list', array('@fields-page' => \Drupal::url('field_ui.list'))); - } - else { - $explanation = t('Fields type(s) in use'); - } + $explanation = t('Fields type(s) in use'); } else { $explanation = t('Fields pending deletion'); diff --git a/core/modules/file/src/Tests/DownloadTest.php b/core/modules/file/src/Tests/DownloadTest.php index 9b58599..5df2518 100644 --- a/core/modules/file/src/Tests/DownloadTest.php +++ b/core/modules/file/src/Tests/DownloadTest.php @@ -123,8 +123,8 @@ function testFileCreateUrl() { $clean_urls = $clean_url_setting == 'clean'; $request = $this->prepareRequestForGenerator($clean_urls); $base_path = $request->getSchemeAndHttpHost() . $request->getBasePath(); - $this->checkUrl('public', '', $basename, $base_path . '/' . file_stream_wrapper_get_instance_by_scheme('public')->getDirectoryPath() . '/' . $basename_encoded); - $this->checkUrl('private', '', $basename, $base_path . '/' . $script_path . 'system/files/' . $basename_encoded); + $this->assertFileUrl('public', '', $basename, $base_path . '/' . file_stream_wrapper_get_instance_by_scheme('public')->getDirectoryPath() . '/' . $basename_encoded); + $this->assertFileUrl('private', '', $basename, $base_path . '/' . $script_path . 'system/files/' . $basename_encoded); } $this->assertEqual(file_create_url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='), 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==', t('Generated URL matches expected URL.')); } @@ -145,7 +145,7 @@ function testFileCreateUrl() { * @param $expected_url * The expected URL */ - private function checkUrl($scheme, $directory, $filename, $expected_url) { + private function assertFileUrl($scheme, $directory, $filename, $expected_url) { // Convert $filename to a valid filename, i.e. strip characters not // supported by the filesystem, and create the file in the specified // directory. @@ -155,7 +155,7 @@ private function checkUrl($scheme, $directory, $filename, $expected_url) { $file = $this->createFile($filepath, NULL, $scheme); $url = file_create_url($file->getFileUri()); - $this->assertEqual($url, $expected_url, 'Generated URL matches expected URL.'); + $this->assertEqual($url, $expected_url); if ($scheme == 'private') { // Tell the implementation of hook_file_download() in file_test.module diff --git a/core/modules/language/src/Form/LanguageAddForm.php b/core/modules/language/src/Form/LanguageAddForm.php index bd3ca0e..72c40c9 100644 --- a/core/modules/language/src/Form/LanguageAddForm.php +++ b/core/modules/language/src/Form/LanguageAddForm.php @@ -92,9 +92,11 @@ public function save(array $form, FormStateInterface $form_state) { $this->logger('language')->notice('The %language (%langcode) language has been created.', $t_args); drupal_set_message($this->t('The language %language has been created and can now be used.', $t_args)); - // Tell the user they have the option to add a language switcher block - // to their theme so they can switch between the languages. - drupal_set_message($this->t('Use one of the language switcher blocks to allow site visitors to switch between languages. You can enable these blocks on the block administration page.', array('@block-admin' => \Drupal::url('block.admin_display')))); + if ($this->moduleHandler->moduleExists('block')) { + // Tell the user they have the option to add a language switcher block + // to their theme so they can switch between the languages. + drupal_set_message($this->t('Use one of the language switcher blocks to allow site visitors to switch between languages. You can enable these blocks on the block administration page.', array('@block-admin' => \Drupal::url('block.admin_display')))); + } $form_state->setRedirect('language.admin_overview'); } diff --git a/core/modules/language/src/Tests/LanguageListTest.php b/core/modules/language/src/Tests/LanguageListTest.php index 2a5dd1f..a4e7442 100644 --- a/core/modules/language/src/Tests/LanguageListTest.php +++ b/core/modules/language/src/Tests/LanguageListTest.php @@ -41,7 +41,7 @@ function testLanguageList() { ); $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language')); $this->assertText('French', 'Language added successfully.'); - $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE)), 'Correct page redirection.'); + $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE))); // Add custom language. $langcode = 'xx'; @@ -53,10 +53,13 @@ function testLanguageList() { 'direction' => Language::DIRECTION_LTR, ); $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language')); - $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE)), 'Correct page redirection.'); + $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE))); $this->assertRaw('"edit-languages-' . $langcode .'-weight"', 'Language code found.'); $this->assertText(t($name), 'Test language added.'); + $language = \Drupal::service('language_manager')->getLanguage($langcode); + $english = \Drupal::service('language_manager')->getLanguage('en'); + // Check if we can change the default language. $path = 'admin/config/regional/settings'; $this->drupalGet($path); @@ -66,12 +69,13 @@ function testLanguageList() { 'site_default_language' => $langcode, ); $this->drupalPostForm(NULL, $edit, t('Save configuration')); + $this->rebuildContainer(); $this->assertNoOptionSelected('edit-site-default-language', 'en', 'Default language updated.'); - $this->assertEqual($this->getUrl(), url($langcode . '/' . $path, array('absolute' => TRUE)), 'Correct page redirection.'); + $this->assertEqual($this->getUrl(), \Drupal::url('system.regional_settings', array(), array('absolute' => TRUE, 'language' => $language))); // Ensure we can't delete the default language. $this->drupalGet('admin/config/regional/language/delete/' . $langcode); - $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE, 'language' => $langcode)), 'Correct page redirection.'); + $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE, 'language' => $language))); $this->assertText(t('The default language cannot be deleted.'), 'Failed to delete the default language.'); // Ensure 'Edit' link works. @@ -84,13 +88,14 @@ function testLanguageList() { ); $this->drupalPostForm('admin/config/regional/language/edit/' . $langcode, $edit, t('Save language')); $this->assertRaw($name, 'The language has been updated.'); - $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE, 'language' => $langcode)), 'Correct page redirection.'); + $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE, 'language' => $language))); // Change back the default language. $edit = array( 'site_default_language' => 'en', ); $this->drupalPostForm($path, $edit, t('Save configuration')); + $this->rebuildContainer(); // Ensure 'delete' link works. $this->drupalGet('admin/config/regional/language'); $this->clickLink(t('Delete')); @@ -99,7 +104,7 @@ function testLanguageList() { $this->drupalGet('admin/config/regional/language/delete/' . $langcode); // First test the 'cancel' link. $this->clickLink(t('Cancel')); - $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE, 'language' => 'en')), 'Correct page redirection.'); + $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE, 'language' => $english))); $this->assertRaw($name, 'The language was not deleted.'); // Delete the language for real. This a confirm form, we do not need any // fields changed. @@ -107,19 +112,19 @@ function testLanguageList() { // We need raw here because %language and %langcode will add HTML. $t_args = array('%language' => $name, '%langcode' => $langcode); $this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), 'The test language has been removed.'); - $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE, 'language' => 'en')), 'Correct page redirection.'); + $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE, 'language' => $english))); // Verify that language is no longer found. $this->drupalGet('admin/config/regional/language/delete/' . $langcode); $this->assertResponse(404, 'Language no longer found.'); - // Make sure the "language_count" state has been updated correctly. - $this->container->get('language_manager')->reset(); + // Delete French. $this->drupalPostForm('admin/config/regional/language/delete/fr', array(), t('Delete')); - $this->container->get('language_manager')->reset(); + // Make sure the "language_count" state has been updated correctly. + $this->rebuildContainer(); // We need raw here because %language and %langcode will add HTML. $t_args = array('%language' => 'French', '%langcode' => 'fr'); $this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), 'The French language has been removed.'); - $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE)), 'Correct page redirection.'); + $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE))); // Verify that language is no longer found. $this->drupalGet('admin/config/regional/language/delete/fr'); $this->assertResponse(404, 'Language no longer found.'); @@ -137,7 +142,7 @@ function testLanguageList() { 'direction' => Language::DIRECTION_LTR, ); $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language')); - $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE)), 'Correct page redirection.'); + $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE))); $this->assertText($name, 'Name found.'); // Check if we can change the default language. @@ -149,13 +154,15 @@ function testLanguageList() { 'site_default_language' => $langcode, ); $this->drupalPostForm(NULL, $edit, t('Save configuration')); + $this->rebuildContainer(); $this->assertNoOptionSelected('edit-site-default-language', 'en', 'Default language updated.'); - $this->assertEqual($this->getUrl(), \Drupal::url('language.admin_overview', array(), array('absolute' => TRUE, 'language' => $langcode)), 'Correct page redirection.'); + $this->assertEqual($this->getUrl(), \Drupal::url('system.regional_settings', array(), array('absolute' => TRUE, 'language' => $language))); $this->drupalPostForm('admin/config/regional/language/delete/en', array(), t('Delete')); // We need raw here because %language and %langcode will add HTML. $t_args = array('%language' => 'English', '%langcode' => 'en'); $this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), 'The English language has been removed.'); + $this->rebuildContainer(); // Ensure we can't delete a locked language. $this->drupalGet('admin/config/regional/language/delete/und'); diff --git a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php index 8f32d13..4753539 100644 --- a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php +++ b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php @@ -417,7 +417,7 @@ function testLanguageDomain() { // Test URL in another language: http://it.example.com/admin. // Base path gives problems on the testbot, so $correct_link is hard-coded. // @see UrlAlterFunctionalTest::assertUrlOutboundAlter (path.test). - $italian_url = \Drupal::url('system.admin', array(), array('language' => $languages['it'], 'script' => '')); + $italian_url = url('admin', array('language' => $languages['it'], 'script' => '')); $url_scheme = \Drupal::request()->isSecure() ? 'https://' : 'http://'; $correct_link = $url_scheme . $link; $this->assertEqual($italian_url, $correct_link, format_string('The url() function returns the right URL (@url) in accordance with the chosen language', array('@url' => $italian_url))); @@ -426,7 +426,7 @@ function testLanguageDomain() { $this->settingsSet('mixed_mode_sessions', TRUE); $this->rebuildContainer(); - $italian_url = \Drupal::url('system.admin', array(), array('https' => TRUE, 'language' => $languages['it'], 'script' => '')); + $italian_url = url('admin', array('https' => TRUE, 'language' => $languages['it'], 'script' => '')); $correct_link = 'https://' . $link; $this->assertTrue($italian_url == $correct_link, format_string('The url() function returns the right HTTPS URL (via options) (@url) in accordance with the chosen language', array('@url' => $italian_url))); $this->settingsSet('mixed_mode_sessions', FALSE); @@ -435,7 +435,7 @@ function testLanguageDomain() { $request = Request::create('', 'GET', array(), array(), array(), array('HTTPS' => 'on')); $this->container->get('request_stack')->push($request); $generator = $this->container->get('url_generator'); - $italian_url = \Drupal::url('system.admin', array(), array('language' => $languages['it'], 'script' => '')); + $italian_url = url('admin', array('language' => $languages['it'], 'script' => '')); $correct_link = 'https://' . $link; $this->assertTrue($italian_url == $correct_link, format_string('The url() function returns the right URL (via current URL scheme) (@url) in accordance with the chosen language', array('@url' => $italian_url))); } diff --git a/core/modules/language/src/Tests/LanguageUrlRewritingTest.php b/core/modules/language/src/Tests/LanguageUrlRewritingTest.php index c42dab6..73b54cd 100644 --- a/core/modules/language/src/Tests/LanguageUrlRewritingTest.php +++ b/core/modules/language/src/Tests/LanguageUrlRewritingTest.php @@ -77,7 +77,7 @@ function testUrlRewritingEdgeCases() { private function checkUrl($language, $message1, $message2) { $options = array('language' => $language, 'script' => ''); $base_path = trim(base_path(), '/'); - $rewritten_path = trim(str_replace($base_path, '', \Drupal::url('view.frontpage.page_1', array(), $options)), '/'); + $rewritten_path = trim(str_replace($base_path, '', \Drupal::url('', array(), $options)), '/'); $segments = explode('/', $rewritten_path, 2); $prefix = $segments[0]; $path = isset($segments[1]) ? $segments[1] : $prefix; @@ -126,7 +126,7 @@ function testDomainNameNegotiationPort() { // Create an absolute French link. $language = \Drupal::languageManager()->getLanguage('fr'); - $url = \Drupal::url('', array(), array( + $url = url('', array( 'absolute' => TRUE, 'language' => $language, )); @@ -136,7 +136,7 @@ function testDomainNameNegotiationPort() { $this->assertEqual($url, $expected, 'The right port is used.'); // If we set the port explicitly in url(), it should not be overriden. - $url = \Drupal::url('', array(), array( + $url = url('', array( 'absolute' => TRUE, 'language' => $language, 'base_url' => $request->getBaseUrl() . ':90', diff --git a/core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php b/core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php index dcd9c83..103f71f 100644 --- a/core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php +++ b/core/modules/system/src/Tests/HttpKernel/StackKernelIntegrationTest.php @@ -31,6 +31,7 @@ protected function setUp() { parent::setUp(); $this->installSchema('system', 'router'); + \Drupal::service('router.builder')->rebuild(); } /** diff --git a/core/modules/system/src/Tests/System/TokenReplaceUnitTestBase.php b/core/modules/system/src/Tests/System/TokenReplaceUnitTestBase.php index 74f95a2..95ed3f5 100644 --- a/core/modules/system/src/Tests/System/TokenReplaceUnitTestBase.php +++ b/core/modules/system/src/Tests/System/TokenReplaceUnitTestBase.php @@ -39,6 +39,8 @@ protected function setUp() { parent::setUp(); // Install default system configuration. $this->installConfig(array('system')); + $this->installSchema('system', array('router')); + \Drupal::service('router.builder')->rebuild(); $this->interfaceLanguage = \Drupal::languageManager()->getCurrentLanguage(); $this->tokenService = \Drupal::token(); diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 6ded2d3..3d2881a 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -84,7 +84,7 @@ function system_help($route_name, RouteMatchInterface $route_match) { $output .= '
' . t('Managing caching') . '
'; $output .= '
' . t("The System module allows users with the appropriate permissions to manage caching on the Performance settings page. Drupal has a robust caching system that allows the efficient re-use of previously-constructed web pages and web page components. Pages requested by anonymous users are stored in a compressed format; depending on your site configuration and the amount of your web traffic tied to anonymous visitors, the caching system may significantly increase the speed of your site.", array('@cache-settings' => \Drupal::url('system.performance_settings'))) . '
'; $output .= '
' . t('Performing system maintenance') . '
'; - $output .= '
' . t('In order for the site and its modules to continue to operate well, a set of routine administrative operations must run on a regular basis. The System module manages this task by making use of a system cron job. You can verify the status of cron tasks by visiting the Status report page. For more information, see the online handbook entry for configuring cron jobs. You can set up cron job by visiting Cron configuration page', array('@status' => \Drupal::url('node.configure_rebuild_confirm'), '@handbook' => 'http://drupal.org/cron', '@cron' => \Drupal::url('system.cron_settings'))) . '
'; + $output .= '
' . t('In order for the site and its modules to continue to operate well, a set of routine administrative operations must run on a regular basis. The System module manages this task by making use of a system cron job. You can verify the status of cron tasks by visiting the Status report page. For more information, see the online handbook entry for configuring cron jobs. You can set up cron job by visiting Cron configuration page', array('@status' => \Drupal::url('system.status'), '@handbook' => 'http://drupal.org/cron', '@cron' => \Drupal::url('system.cron_settings'))) . '
'; $output .= '
' . t('Configuring basic site settings') . '
'; $output .= '
' . t('The System module also handles basic configuration options for your site, including Date and time settings, File system settings, Site name and other information, and a Maintenance mode for taking your site temporarily offline.', array('@date-time-settings' => \Drupal::url('system.date_format_list'), '@file-system' => \Drupal::url('system.file_system_settings'), '@site-info' => \Drupal::url('system.site_information_settings'), '@maintenance-mode' => \Drupal::url('system.site_maintenance_mode'))) . '
'; $output .= '
' . t('Providing administrative help') . '
'; diff --git a/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml index 6df0e0c..1cbed74 100644 --- a/core/modules/system/system.routing.yml +++ b/core/modules/system/system.routing.yml @@ -304,6 +304,16 @@ system.files: requirements: _access: 'TRUE' +system.files_url_generator: + path: '/system/files/{filepath}' + defaults: + _controller: 'Drupal\system\FileDownloadController::download' + requirements: + # Permissive regex to allow slashes in filepath see + # http://symfony.com/doc/current/cookbook/routing/slash_in_parameter.html + filepath: .+ + _access: 'TRUE' + system.temporary: path: '/system/temporary' defaults: diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 2ea4682..e33cd28 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -679,12 +679,17 @@ function user_user_logout($account) { function user_pass_reset_url($account, $options = array()) { $timestamp = REQUEST_TIME; $langcode = isset($options['langcode']) ? $options['langcode'] : $account->getPreferredLangcode(); - $url_options = array('absolute' => TRUE, 'language' => \Drupal::languageManager()->getLanguage($langcode)); - return \Drupal::url('user.reset', [ - 'user' => $account->id(), - 'timestamp' => $timestamp, - 'hash' => user_pass_rehash($account->getPassword(), $timestamp, $account->getLastLoginTime()), - ], $url_options); + return \Drupal::url('user.reset', + array( + 'uid' => $account->id(), + 'timestamp' => $timestamp, + 'hash' => user_pass_rehash($account->getPassword(), $timestamp, $account->getLastLoginTime()), + ), + array( + 'absolute' => TRUE, + 'language' => \Drupal::languageManager()->getLanguage($langcode) + ) + ); } /**