diff --git a/core/includes/batch.inc b/core/includes/batch.inc
index bbb43f4..786ee3c 100644
--- a/core/includes/batch.inc
+++ b/core/includes/batch.inc
@@ -157,7 +157,7 @@ function _batch_progress_page() {
$batch['url_options']['query']['id'] = $batch['id'];
$batch['url_options']['query']['op'] = $new_op;
- $url = url($batch['url'], $batch['url_options']);
+ $url = _url($batch['url'], $batch['url_options']);
$build = array(
'#theme' => 'progress_bar',
@@ -486,7 +486,7 @@ function _batch_finished() {
}
elseif ($callback === NULL) {
// Default to RedirectResponse objects when nothing specified.
- $url = url($_batch['source_url'], array(
+ $url = _url($_batch['source_url'], array(
'absolute' => TRUE,
'query' => array('op' => 'finish', 'id' => $_batch['id']),
));
diff --git a/core/includes/common.inc b/core/includes/common.inc
index e57821e..87e9d0e 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -638,9 +638,24 @@ function _format_date_callback(array $matches = NULL, $new_langcode = NULL) {
* When creating links in modules, consider whether l() could be a better
* alternative than url().
*
- * @see \Drupal\Core\Routing\UrlGeneratorInterface::generateFromPath().
+ * @see \Drupal\Core\Url::fromUri()
+ * @see \Drupal\Core\Url::fromRoute()
+ * @see \Drupal\Core\Url->toString()
+ *
+ * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.0.
+ * Use \Drupal\Core\Url::fromRoute() for internal paths served by Drupal
+ * controllers or \Drupal\Core\Url::fromUri() for external paths or
+ * non-controller or sub-domain URIs such as core/install.php. Note that
+ * \Drupal\Core\Url::fromUri() expects a valid URI including the scheme - In
+ * the case of URIs from the same sub-domain that are not handled by Drupal
+ * controllers, prepend base:://. For example:
+ * @code
+ * $installer_url = \Drupal\Core\Url::fromUri('base://core/install.php')->toString();
+ * $external_url = \Drupal\Core\Url::fromUri('http://example.com', ['query' => ['foo' => 'bar']])->toString();
+ * $internal_url = \Drupal\Core\Url::fromRoute('system.admin')->toString();
+ * @endcode
*/
-function url($path = NULL, array $options = array()) {
+function _url($path = NULL, array $options = array()) {
return \Drupal::urlGenerator()->generateFromPath($path, $options);
}
@@ -730,10 +745,27 @@ function drupal_http_header_attributes(array $attributes = array()) {
* @return string
* An HTML string containing a link to the given path.
*
- * @see url()
+ * @see _url()
* @see system_page_build()
+ * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.0.
+ * Use \Drupal::linkGenerator()->generate($url) where $url is an instance of
+ * \Drupal\Core\Url. To build a \Drupal\Core\Url object for internal paths
+ * served by Drupal controllers use \Drupal\Core\Url::fromRoute(). For
+ * external paths or non-controller or sub-domain URIs such as
+ * core/install.php use \Drupal\Core\Url::fromUri(). Note that
+ * \Drupal\Core\Url::fromUri() expects a valid URI including the scheme - In
+ * the case of URIs from the same sub-domain that are not handled by Drupal
+ * controllers, prepend base:://. For example:
+ * @code
+ * $installer_url = \Drupal\Core\Url::fromUri('base://core/install.php')->toString();
+ * $installer_link = \Drupal::linkGenerator()->generate($installer_url);
+ * $external_url = \Drupal\Core\Url::fromUri('http://example.com', ['query' => ['foo' => 'bar']])->toString();
+ * $external_link = \Drupal::linkGenerator()->generate($external_link);
+ * $internal_url = \Drupal\Core\Url::fromRoute('system.admin')->toString();
+ * $internal_link = \Drupal::linkGenerator()->generate($internal_url);
+ * @endcode
*/
-function l($text, $path, array $options = array()) {
+function _l($text, $path, array $options = array()) {
// Start building a structured representation of our link to be altered later.
$variables = array(
'text' => is_array($text) ? drupal_render($text) : $text,
@@ -788,7 +820,7 @@ function l($text, $path, array $options = array()) {
// The result of url() is a plain-text URL. Because we are using it here
// in an HTML argument context, we need to encode it properly.
- $url = String::checkPlain(url($variables['path'], $variables['options']));
+ $url = String::checkPlain(_url($variables['path'], $variables['options']));
// Sanitize the link text if necessary.
$text = $variables['options']['html'] ? $variables['text'] : String::checkPlain($variables['text']);
@@ -1509,7 +1541,7 @@ function _drupal_add_js($data = NULL, $options = NULL) {
$scriptPath = $GLOBALS['script_path'];
$pathPrefix = '';
$current_query = \Drupal::service('request_stack')->getCurrentRequest()->query->all();
- url('', array('script' => &$scriptPath, 'prefix' => &$pathPrefix));
+ _url('', array('script' => &$scriptPath, 'prefix' => &$pathPrefix));
$current_path = current_path();
$current_path_is_admin = FALSE;
// The function path_is_admin() is not available on update.php pages.
diff --git a/core/includes/form.inc b/core/includes/form.inc
index 260ffbe..5aafe81 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -949,7 +949,7 @@ function batch_process($redirect = NULL, $url = 'batch', $redirect_callback = NU
if ($batch['progressive']) {
// Now that we have a batch id, we can generate the redirection link in
// the generic error message.
- $batch['error_message'] = t('Please continue to the error page', array('@error_url' => url($url, array('query' => array('id' => $batch['id'], 'op' => 'finished')))));
+ $batch['error_message'] = t('Please continue to the error page', array('@error_url' => _url($url, array('query' => array('id' => $batch['id'], 'op' => 'finished')))));
// Clear the way for the redirection to the batch processing page, by
// saving and unsetting the 'destination', if there is any.
@@ -977,7 +977,7 @@ function batch_process($redirect = NULL, $url = 'batch', $redirect_callback = NU
}
else {
$options['absolute'] = TRUE;
- return new RedirectResponse(url($batch['url'], $options));
+ return new RedirectResponse(_url($batch['url'], $options));
}
}
else {
diff --git a/core/includes/pager.inc b/core/includes/pager.inc
index 730be44..0dcfcb7 100644
--- a/core/includes/pager.inc
+++ b/core/includes/pager.inc
@@ -219,7 +219,7 @@ function template_preprocess_pager(&$variables) {
$options = array(
'query' => pager_query_add_page($parameters, $element, 0),
);
- $items['first']['href'] = url($current_path, $options);
+ $items['first']['href'] = _url($current_path, $options);
if (isset($tags[0])) {
$items['first']['text'] = $tags[0];
}
@@ -228,7 +228,7 @@ function template_preprocess_pager(&$variables) {
$options = array(
'query' => pager_query_add_page($parameters, $element, $pager_page_array[$element] - 1),
);
- $items['previous']['href'] = url($current_path, $options);
+ $items['previous']['href'] = _url($current_path, $options);
if (isset($tags[1])) {
$items['previous']['text'] = $tags[1];
}
@@ -244,7 +244,7 @@ function template_preprocess_pager(&$variables) {
$options = array(
'query' => pager_query_add_page($parameters, $element, $i - 1),
);
- $items['pages'][$i]['href'] = url($current_path, $options);
+ $items['pages'][$i]['href'] = _url($current_path, $options);
if ($i == $pager_current) {
$variables['current'] = $i;
}
@@ -261,7 +261,7 @@ function template_preprocess_pager(&$variables) {
$options = array(
'query' => pager_query_add_page($parameters, $element, $pager_page_array[$element] + 1),
);
- $items['next']['href'] = url($current_path, $options);
+ $items['next']['href'] = _url($current_path, $options);
if (isset($tags[3])) {
$items['next']['text'] = $tags[3];
}
@@ -270,7 +270,7 @@ function template_preprocess_pager(&$variables) {
$options = array(
'query' => pager_query_add_page($parameters, $element, $pager_max - 1),
);
- $items['last']['href'] = url($current_path, $options);
+ $items['last']['href'] = _url($current_path, $options);
if (isset($tags[4])) {
$items['last']['text'] = $tags[4];
}
diff --git a/core/includes/tablesort.inc b/core/includes/tablesort.inc
index 0b3574f..0c8d25b 100644
--- a/core/includes/tablesort.inc
+++ b/core/includes/tablesort.inc
@@ -61,7 +61,7 @@ function tablesort_header(&$cell_content, array &$cell_attributes, array $header
$ts['sort'] = 'asc';
$image = '';
}
- $cell_content = l($cell_content . $image, current_path(), array(
+ $cell_content = _l($cell_content . $image, current_path(), array(
'attributes' => array('title' => $title),
'query' => array_merge($ts['query'], array(
'sort' => $ts['sort'],
diff --git a/core/lib/Drupal/Component/Utility/UrlHelper.php b/core/lib/Drupal/Component/Utility/UrlHelper.php
index cf87435..45a8036 100644
--- a/core/lib/Drupal/Component/Utility/UrlHelper.php
+++ b/core/lib/Drupal/Component/Utility/UrlHelper.php
@@ -134,7 +134,7 @@ public static function filterQueryParameters(array $query, array $exclude = arra
* - fragment: The fragment component from $url, if it exists.
*
* @see \Drupal\Core\Utility\LinkGenerator
- * @see url()
+ * @see _url()
* @see http://tools.ietf.org/html/rfc3986
*
* @ingroup php_wrappers
@@ -288,7 +288,7 @@ public static function setAllowedProtocols(array $protocols = array()) {
* to being output to an HTML attribute value. It is often called as part of
* check_url() or Drupal\Component\Utility\Xss::filter(), but those functions
* return an HTML-encoded string, so this function can be called independently
- * when the output needs to be a plain-text string for passing to t(), l(),
+ * when the output needs to be a plain-text string for passing to t(), _l(),
* Drupal\Core\Template\Attribute, or another function that will call
* \Drupal\Component\Utility\String::checkPlain() separately.
*
diff --git a/core/lib/Drupal/Core/Ajax/RedirectCommand.php b/core/lib/Drupal/Core/Ajax/RedirectCommand.php
index 4b0914a..4b31e52 100644
--- a/core/lib/Drupal/Core/Ajax/RedirectCommand.php
+++ b/core/lib/Drupal/Core/Ajax/RedirectCommand.php
@@ -28,7 +28,7 @@ class RedirectCommand implements CommandInterface {
*
* @param string $url
* The URL that will be loaded into window.location. This should be a full
- * URL, one that has already been run through the url() function.
+ * URL, one that has already been run through the _url() function.
*/
public function __construct($url) {
$this->url = $url;
diff --git a/core/lib/Drupal/Core/Asset/CssOptimizer.php b/core/lib/Drupal/Core/Asset/CssOptimizer.php
index 1090d5a..baa2de4 100644
--- a/core/lib/Drupal/Core/Asset/CssOptimizer.php
+++ b/core/lib/Drupal/Core/Asset/CssOptimizer.php
@@ -119,7 +119,7 @@ public function loadFile($file, $optimize = NULL, $reset_basepath = TRUE) {
* Loads stylesheets recursively and returns contents with corrected paths.
*
* This function is used for recursive loading of stylesheets and
- * returns the stylesheet content with all url() paths corrected.
+ * returns the stylesheet content with all _url() paths corrected.
*
* @param array $matches
* An array of matches by a preg_replace_callback() call that scans for
@@ -138,10 +138,10 @@ protected function loadNestedFile($matches) {
// Determine the file's directory.
$directory = dirname($filename);
// If the file is in the current directory, make sure '.' doesn't appear in
- // the url() path.
+ // the _url() path.
$directory = $directory == '.' ? '' : $directory .'/';
- // Alter all internal url() paths. Leave external paths alone. We don't need
+ // Alter all internal _url() paths. Leave external paths alone. We don't need
// to normalize absolute paths here (i.e. remove folder/... segments)
// because that will be done later.
return preg_replace('/url\(\s*([\'"]?)(?![a-z]+:|\/+)([^\'")]+)([\'"]?)\s*\)/i', 'url(\1' . $directory . '\2\3)', $file);
@@ -215,7 +215,7 @@ protected function processCss($contents, $optimize = FALSE) {
*
* @param array $matches
* An array of matches by a preg_replace_callback() call that scans for
- * url() references in CSS files, except for external or absolute ones.
+ * _url() references in CSS files, except for external or absolute ones.
*
* Note: the only reason this method is public is so color.module can call it;
* it is not on the AssetOptimizerInterface, so future refactorings can make
diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php
index de1d04f..07e50c7 100644
--- a/core/lib/Drupal/Core/Entity/Entity.php
+++ b/core/lib/Drupal/Core/Entity/Entity.php
@@ -192,7 +192,7 @@ public function urlInfo($rel = 'canonical', array $options = []) {
}
}
- // Pass the entity data to url() so that alter functions do not need to
+ // Pass the entity data to _url() so that alter functions do not need to
// look up this entity again.
$uri
->setOption('entity_type', $this->getEntityTypeId())
diff --git a/core/lib/Drupal/Core/Menu/LocalTaskManager.php b/core/lib/Drupal/Core/Menu/LocalTaskManager.php
index 4e1f675..3914d8e 100644
--- a/core/lib/Drupal/Core/Menu/LocalTaskManager.php
+++ b/core/lib/Drupal/Core/Menu/LocalTaskManager.php
@@ -250,7 +250,7 @@ public function getLocalTasksForRoute($route_name) {
foreach ($children[$parent] as $plugin_id => $task_info) {
$plugin = $this->createInstance($plugin_id);
$this->instances[$route_name][$level][$plugin_id] = $plugin;
- // Normally, l() compares the href of every link with the current
+ // Normally, _l() compares the href of every link with the current
// path and sets the active class accordingly. But the parents of
// the current local task may be on a different route in which
// case we have to set the class manually by flagging it active.
diff --git a/core/lib/Drupal/Core/Menu/MenuTreeStorage.php b/core/lib/Drupal/Core/Menu/MenuTreeStorage.php
index fb75390..2ed2fb0 100644
--- a/core/lib/Drupal/Core/Menu/MenuTreeStorage.php
+++ b/core/lib/Drupal/Core/Menu/MenuTreeStorage.php
@@ -1278,7 +1278,7 @@ protected static function schemaDefinition() {
'not null' => FALSE,
),
'options' => array(
- 'description' => 'A serialized array of options to be passed to the url() or l() function, such as a query string or HTML attributes.',
+ 'description' => 'A serialized array of options to be passed to the _url() or _l() function, such as a query string or HTML attributes.',
'type' => 'blob',
'size' => 'big',
'not null' => FALSE,
diff --git a/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php b/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php
index 164f7f5..8711ee2 100644
--- a/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php
+++ b/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php
@@ -110,7 +110,7 @@ public function preparePage(HtmlPage $page, &$page_array) {
foreach (drupal_get_feeds() as $feed) {
// Force the URL to be absolute, for consistency with other tags
// output by Drupal.
- $link = new FeedLinkElement($feed['title'], url($feed['url'], array('absolute' => TRUE)));
+ $link = new FeedLinkElement($feed['title'], _url($feed['url'], array('absolute' => TRUE)));
$page->addLinkElement($link);
}
diff --git a/core/lib/Drupal/Core/Path/AliasWhitelist.php b/core/lib/Drupal/Core/Path/AliasWhitelist.php
index 394dfa2..11c68f7 100644
--- a/core/lib/Drupal/Core/Path/AliasWhitelist.php
+++ b/core/lib/Drupal/Core/Path/AliasWhitelist.php
@@ -88,7 +88,7 @@ protected function loadMenuPathRoots() {
*/
public function get($offset) {
$this->lazyLoadCache();
- // url() may be called with paths that are not represented by menu router
+ // _url() may be called with paths that are not represented by menu router
// items such as paths that will be rewritten by hook_url_outbound_alter().
// Therefore internally TRUE is used to indicate whitelisted paths. FALSE is
// used to indicate paths that have already been checked but are not
diff --git a/core/lib/Drupal/Core/Render/Element/Link.php b/core/lib/Drupal/Core/Render/Element/Link.php
index 7e10976..474e9f5 100644
--- a/core/lib/Drupal/Core/Render/Element/Link.php
+++ b/core/lib/Drupal/Core/Render/Element/Link.php
@@ -34,21 +34,21 @@ public function getInfo() {
* Doing so during pre_render gives modules a chance to alter the link parts.
*
* @param array $element
- * A structured array whose keys form the arguments to l():
- * - #title: The link text to pass as argument to l().
+ * A structured array whose keys form the arguments to _l():
+ * - #title: The link text to pass as argument to _l().
* - One of the following
* - #route_name and (optionally) a #route_parameters array; The route
* name and route parameters which will be passed into the link
* generator.
- * - #href: The system path or URL to pass as argument to l().
- * - #options: (optional) An array of options to pass to l() or the link
+ * - #href: The system path or URL to pass as argument to _l().
+ * - #options: (optional) An array of options to pass to _l() or the link
* generator.
*
* @return array
* The passed-in element containing a rendered link in '#markup'.
*/
public static function preRenderLink($element) {
- // By default, link options to pass to l() are normally set in #options.
+ // By default, link options to pass to _l() are normally set in #options.
$element += array('#options' => array());
// However, within the scope of renderable elements, #attributes is a valid
// way to specify attributes, too. Take them into account, but do not override
@@ -89,7 +89,7 @@ public static function preRenderLink($element) {
}
else {
// @todo Convert to \Drupal::l(): https://www.drupal.org/node/2347045.
- $element['#markup'] = l($element['#title'], $element['#href'], $element['#options']);
+ $element['#markup'] = _l($element['#title'], $element['#href'], $element['#options']);
}
return $element;
}
diff --git a/core/lib/Drupal/Core/Render/Element/RenderElement.php b/core/lib/Drupal/Core/Render/Element/RenderElement.php
index 553496c..38e09fc 100644
--- a/core/lib/Drupal/Core/Render/Element/RenderElement.php
+++ b/core/lib/Drupal/Core/Render/Element/RenderElement.php
@@ -248,7 +248,7 @@ public static function preRenderAjaxForm($element) {
}
// Change path to URL.
- $settings['url'] = isset($settings['path']) ? url($settings['path'], $settings['options']) : NULL;
+ $settings['url'] = isset($settings['path']) ? _url($settings['path'], $settings['options']) : NULL;
unset($settings['path'], $settings['options']);
// Add special data to $settings['submit'] so that when this element
@@ -286,7 +286,7 @@ public static function preRenderAjaxForm($element) {
}
// Change progress path to a full URL.
if (isset($settings['progress']['path'])) {
- $settings['progress']['url'] = url($settings['progress']['path']);
+ $settings['progress']['url'] = _url($settings['progress']['path']);
unset($settings['progress']['path']);
}
diff --git a/core/lib/Drupal/Core/Routing/UrlGenerator.php b/core/lib/Drupal/Core/Routing/UrlGenerator.php
index 8e2522a..ae41c9c 100644
--- a/core/lib/Drupal/Core/Routing/UrlGenerator.php
+++ b/core/lib/Drupal/Core/Routing/UrlGenerator.php
@@ -238,7 +238,7 @@ public function generateFromPath($path = NULL, $options = array()) {
// \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() if $path
// contains a ':' before any / ? or #. Note: we could use
// \Drupal\Component\Utility\UrlHelper::isExternal($path) here, but that
- // would require another function call, and performance inside url() is
+ // would require another function call, and performance inside _url() is
// critical.
$colonpos = strpos($path, ':');
$options['external'] = ($colonpos !== FALSE && !preg_match('![/?#]!', substr($path, 0, $colonpos)) && UrlHelper::stripDangerousProtocols($path) == $path);
diff --git a/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php b/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php
index ad58aca..06e600d 100644
--- a/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php
+++ b/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php
@@ -67,10 +67,10 @@
* - 'script': Added to the URL between the base path and the path prefix.
* Defaults to empty string when clean URLs are in effect, and to
* 'index.php/' when they are not.
- * - 'entity_type': The entity type of the object that called url(). Only
- * set if url() is invoked by Drupal\Core\Entity\Entity::uri().
+ * - 'entity_type': The entity type of the object that called _url(). Only
+ * set if _url() is invoked by Drupal\Core\Entity\Entity::uri().
* - 'entity': The entity object (such as a node) for which the URL is being
- * generated. Only set if url() is invoked by Drupal\Core\Entity\Entity::uri().
+ * generated. Only set if _url() is invoked by Drupal\Core\Entity\Entity::uri().
*
* @return
* A string containing a URL to the given path.
diff --git a/core/lib/Drupal/Core/Template/TwigExtension.php b/core/lib/Drupal/Core/Template/TwigExtension.php
index 20c71e6..632e42a 100644
--- a/core/lib/Drupal/Core/Template/TwigExtension.php
+++ b/core/lib/Drupal/Core/Template/TwigExtension.php
@@ -214,7 +214,7 @@ public function getLink($text, $url) {
}
else {
// @todo Convert once https://www.drupal.org/node/2306901 is in
- return l($text, $url);
+ return _l($text, $url);
}
}
diff --git a/core/modules/aggregator/src/Tests/FeedParserTest.php b/core/modules/aggregator/src/Tests/FeedParserTest.php
index 2ac0a94..a6d44c7 100644
--- a/core/modules/aggregator/src/Tests/FeedParserTest.php
+++ b/core/modules/aggregator/src/Tests/FeedParserTest.php
@@ -80,7 +80,7 @@ function testHtmlEntitiesSample() {
*/
function testRedirectFeed() {
// Simulate a typo in the URL to force a curl exception.
- $invalid_url = url('aggregator/redirect', array('absolute' => TRUE));
+ $invalid_url = _url('aggregator/redirect', array('absolute' => TRUE));
$feed = entity_create('aggregator_feed', array('url' => $invalid_url, 'title' => $this->randomMachineName()));
$feed->save();
$feed->refreshItems();
diff --git a/core/modules/aggregator/src/Tests/Views/IntegrationTest.php b/core/modules/aggregator/src/Tests/Views/IntegrationTest.php
index 5084bdf..8b6edaa 100644
--- a/core/modules/aggregator/src/Tests/Views/IntegrationTest.php
+++ b/core/modules/aggregator/src/Tests/Views/IntegrationTest.php
@@ -107,7 +107,7 @@ public function testAggregatorItemView() {
// Ensure that the rendering of the linked title works as expected.
foreach ($view->result as $row) {
$iid = $view->field['iid']->getValue($row);
- $expected_link = l($items[$iid]->getTitle(), $items[$iid]->getLink(), array('absolute' => TRUE));
+ $expected_link = _l($items[$iid]->getTitle(), $items[$iid]->getLink(), array('absolute' => TRUE));
$this->assertEqual($view->field['title']->advancedRender($row), $expected_link, 'Ensure the right link is generated');
$expected_author = aggregator_filter_xss($items[$iid]->getAuthor());
diff --git a/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php b/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php
index 62346a1..b45105b 100644
--- a/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php
+++ b/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php
@@ -150,7 +150,7 @@ protected function basicAuthGet($path, $username, $password) {
$out = $this->curlExec(
array(
CURLOPT_HTTPGET => TRUE,
- CURLOPT_URL => url($path, array('absolute' => TRUE)),
+ CURLOPT_URL => _url($path, array('absolute' => TRUE)),
CURLOPT_NOBODY => FALSE,
CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
CURLOPT_USERPWD => $username . ':' . $password,
diff --git a/core/modules/dblog/src/Controller/DbLogController.php b/core/modules/dblog/src/Controller/DbLogController.php
index 4e7b974..a11fcb8 100644
--- a/core/modules/dblog/src/Controller/DbLogController.php
+++ b/core/modules/dblog/src/Controller/DbLogController.php
@@ -252,11 +252,11 @@ public function eventDetails($event_id) {
),
array(
array('data' => $this->t('Location'), 'header' => TRUE),
- l($dblog->location, $dblog->location),
+ _l($dblog->location, $dblog->location),
),
array(
array('data' => $this->t('Referrer'), 'header' => TRUE),
- l($dblog->referer, $dblog->referer),
+ _l($dblog->referer, $dblog->referer),
),
array(
array('data' => $this->t('Message'), 'header' => TRUE),
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index a516836..55f99ac 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -1589,7 +1589,7 @@ function template_preprocess_file_link(&$variables) {
$options['attributes']['title'] = String::checkPlain($file_entity->getFilename());
}
- $variables['link'] = l($link_text, $url, $options);
+ $variables['link'] = _l($link_text, $url, $options);
$variables['attributes'] = array('class' => array('file'));
}
diff --git a/core/modules/file/src/Tests/DownloadTest.php b/core/modules/file/src/Tests/DownloadTest.php
index f99f327..ac81651 100644
--- a/core/modules/file/src/Tests/DownloadTest.php
+++ b/core/modules/file/src/Tests/DownloadTest.php
@@ -112,8 +112,8 @@ function testFileCreateUrl() {
'%C3%A9%C3%B8%C3%AF%D0%B2%CE%B2%E4%B8%AD%E5%9C%8B%E6%9B%B8%DB%9E';
// Public files should not be served by Drupal, so their URLs should not be
- // generated by url(), whereas private files should be served by Drupal, so
- // their URLs should be generated by url(). The difference is most apparent
+ // generated by _url(), whereas private files should be served by Drupal, so
+ // their URLs should be generated by _url(). The difference is most apparent
// when $script_path is not empty (i.e., when not using clean URLs).
$clean_url_settings = array(
'clean' => '',
diff --git a/core/modules/filter/src/Tests/FilterDefaultConfigTest.php b/core/modules/filter/src/Tests/FilterDefaultConfigTest.php
index 79a1160..5af4758 100644
--- a/core/modules/filter/src/Tests/FilterDefaultConfigTest.php
+++ b/core/modules/filter/src/Tests/FilterDefaultConfigTest.php
@@ -21,7 +21,7 @@ class FilterDefaultConfigTest extends DrupalUnitTestBase {
protected function setUp() {
parent::setUp();
- // Drupal\filter\FilterPermissions::permissions() calls into url() to output
+ // Drupal\filter\FilterPermissions::permissions() calls into _url() to output
// a link in the description.
$this->installSchema('system', 'url_alias');
diff --git a/core/modules/hal/src/Tests/DenormalizeTest.php b/core/modules/hal/src/Tests/DenormalizeTest.php
index 761b804..8b5711c 100644
--- a/core/modules/hal/src/Tests/DenormalizeTest.php
+++ b/core/modules/hal/src/Tests/DenormalizeTest.php
@@ -24,7 +24,7 @@ public function testTypeHandling() {
$data_with_valid_type = array(
'_links' => array(
'type' => array(
- 'href' => url('rest/type/entity_test/entity_test', array('absolute' => TRUE)),
+ 'href' => _url('rest/type/entity_test/entity_test', array('absolute' => TRUE)),
),
),
);
@@ -36,10 +36,10 @@ public function testTypeHandling() {
'_links' => array(
'type' => array(
array(
- 'href' => url('rest/types/foo', array('absolute' => TRUE)),
+ 'href' => _url('rest/types/foo', array('absolute' => TRUE)),
),
array(
- 'href' => url('rest/type/entity_test/entity_test', array('absolute' => TRUE)),
+ 'href' => _url('rest/type/entity_test/entity_test', array('absolute' => TRUE)),
),
),
),
@@ -51,7 +51,7 @@ public function testTypeHandling() {
$data_with_invalid_type = array(
'_links' => array(
'type' => array(
- 'href' => url('rest/types/foo', array('absolute' => TRUE)),
+ 'href' => _url('rest/types/foo', array('absolute' => TRUE)),
),
),
);
@@ -84,7 +84,7 @@ public function testMarkFieldForDeletion() {
$no_field_data = array(
'_links' => array(
'type' => array(
- 'href' => url('rest/type/entity_test/entity_test', array('absolute' => TRUE)),
+ 'href' => _url('rest/type/entity_test/entity_test', array('absolute' => TRUE)),
),
),
);
@@ -94,7 +94,7 @@ public function testMarkFieldForDeletion() {
$empty_field_data = array(
'_links' => array(
'type' => array(
- 'href' => url('rest/type/entity_test/entity_test', array('absolute' => TRUE)),
+ 'href' => _url('rest/type/entity_test/entity_test', array('absolute' => TRUE)),
),
),
'field_test_text' => array(),
@@ -112,7 +112,7 @@ public function testBasicFieldDenormalization() {
$data = array(
'_links' => array(
'type' => array(
- 'href' => url('rest/type/entity_test/entity_test', array('absolute' => TRUE)),
+ 'href' => _url('rest/type/entity_test/entity_test', array('absolute' => TRUE)),
),
),
'uuid' => array(
@@ -182,7 +182,7 @@ public function testPatchDenormailzation() {
$data = array(
'_links' => array(
'type' => array(
- 'href' => url('rest/type/entity_test/entity_test', array('absolute' => TRUE)),
+ 'href' => _url('rest/type/entity_test/entity_test', array('absolute' => TRUE)),
),
),
'field_test_text' => array(
diff --git a/core/modules/hal/src/Tests/NormalizeTest.php b/core/modules/hal/src/Tests/NormalizeTest.php
index 00d6687..ee40c25 100644
--- a/core/modules/hal/src/Tests/NormalizeTest.php
+++ b/core/modules/hal/src/Tests/NormalizeTest.php
@@ -59,8 +59,8 @@ public function testNormalize() {
$entity->getTranslation('en')->set('field_test_entity_reference', array(0 => $translation_values['field_test_entity_reference']));
$entity->save();
- $type_uri = url('rest/type/entity_test/entity_test', array('absolute' => TRUE));
- $relation_uri = url('rest/relation/entity_test/entity_test/field_test_entity_reference', array('absolute' => TRUE));
+ $type_uri = _url('rest/type/entity_test/entity_test', array('absolute' => TRUE));
+ $relation_uri = _url('rest/relation/entity_test/entity_test/field_test_entity_reference', array('absolute' => TRUE));
$expected_array = array(
'_links' => array(
diff --git a/core/modules/image/image.field.inc b/core/modules/image/image.field.inc
index 93ac36b..4668e26 100644
--- a/core/modules/image/image.field.inc
+++ b/core/modules/image/image.field.inc
@@ -86,6 +86,6 @@ function template_preprocess_image_formatter(&$variables) {
if (isset($variables['path']['path'])) {
$path = $variables['path']['path'];
$options = isset($variables['path']['options']) ? $variables['path']['options'] : array();
- $variables['url'] = url($path, $options);
+ $variables['url'] = _url($path, $options);
}
}
diff --git a/core/modules/image/src/Entity/ImageStyle.php b/core/modules/image/src/Entity/ImageStyle.php
index 0579dbc..752dc1e 100644
--- a/core/modules/image/src/Entity/ImageStyle.php
+++ b/core/modules/image/src/Entity/ImageStyle.php
@@ -216,12 +216,12 @@ public function buildUrl($path, $clean_urls = NULL) {
}
// If not using clean URLs, the image derivative callback is only available
- // with the script path. If the file does not exist, use url() to ensure
+ // with the script path. If the file does not exist, use _url() to ensure
// that it is included. Once the file exists it's fine to fall back to the
// actual file path, this avoids bootstrapping PHP once the files are built.
if ($clean_urls === FALSE && file_uri_scheme($uri) == 'public' && !file_exists($uri)) {
$directory_path = file_stream_wrapper_get_instance_by_uri($uri)->getDirectoryPath();
- return url($directory_path . '/' . file_uri_target($uri), array('absolute' => TRUE, 'query' => $token_query));
+ return _url($directory_path . '/' . file_uri_target($uri), array('absolute' => TRUE, 'query' => $token_query));
}
$file_url = file_create_url($uri);
diff --git a/core/modules/language/src/LanguageNegotiatorInterface.php b/core/modules/language/src/LanguageNegotiatorInterface.php
index c5991c2..fa46958 100644
--- a/core/modules/language/src/LanguageNegotiatorInterface.php
+++ b/core/modules/language/src/LanguageNegotiatorInterface.php
@@ -25,7 +25,7 @@
* - Content language: The language used to present content that is available
* in more than one language.
* - URL language: The language associated with URLs. When generating a URL,
- * this value will be used by url() as a default if no explicit preference is
+ * this value will be used by _url() as a default if no explicit preference is
* provided.
* Modules can define additional language types through
* hook_language_types_info(), and alter existing language type definitions
diff --git a/core/modules/language/src/Tests/LanguageSwitchingTest.php b/core/modules/language/src/Tests/LanguageSwitchingTest.php
index 9d8f7f9..dfd8d2e 100644
--- a/core/modules/language/src/Tests/LanguageSwitchingTest.php
+++ b/core/modules/language/src/Tests/LanguageSwitchingTest.php
@@ -185,7 +185,7 @@ protected function doTestLanguageLinkActiveClassAuthenticated() {
$function_name = '#type link';
$path = 'language_test/type-link-active-class';
- // Test links generated by l() on an English page.
+ // Test links generated by _l() on an English page.
$current_language = 'English';
$this->drupalGet($path);
@@ -210,7 +210,7 @@ protected function doTestLanguageLinkActiveClassAuthenticated() {
$this->assertIdentical($settings['path']['isFront'], FALSE, 'drupalSettings.path.isFront is set correctly to allow drupal.active-link to mark the correct links as active.');
$this->assertIdentical($settings['path']['currentLanguage'], 'en', 'drupalSettings.path.currentLanguage is set correctly to allow drupal.active-link to mark the correct links as active.');
- // Test links generated by l() on a French page.
+ // Test links generated by _l() on a French page.
$current_language = 'French';
$this->drupalGet('fr/language_test/type-link-active-class');
@@ -246,7 +246,7 @@ protected function doTestLanguageLinkActiveClassAnonymous() {
$this->drupalLogout();
- // Test links generated by l() on an English page.
+ // Test links generated by _l() on an English page.
$current_language = 'English';
$this->drupalGet('language_test/type-link-active-class');
@@ -265,7 +265,7 @@ protected function doTestLanguageLinkActiveClassAnonymous() {
$links = $this->xpath('//a[@id = :id and not(contains(@class, :class))]', array(':id' => 'fr_link', ':class' => 'active'));
$this->assertTrue(isset($links[0]), t('A link generated by :function to the current :language page with langcode :langcode is NOT marked active.', array(':function' => $function_name, ':language' => $current_language, ':langcode' => $langcode)));
- // Test links generated by l() on a French page.
+ // Test links generated by _l() on a French page.
$current_language = 'French';
$this->drupalGet('fr/language_test/type-link-active-class');
diff --git a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
index 4753539..b1d40c0 100644
--- a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
+++ b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
@@ -388,7 +388,7 @@ function testUrlLanguageFallback() {
}
/**
- * Tests url() when separate domains are used for multiple languages.
+ * Tests _url() when separate domains are used for multiple languages.
*/
function testLanguageDomain() {
// Add the Italian language.
@@ -417,26 +417,26 @@ 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 = url('admin', 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)));
+ $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)));
// Test HTTPS via options.
$this->settingsSet('mixed_mode_sessions', TRUE);
$this->rebuildContainer();
- $italian_url = url('admin', 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->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);
// Test HTTPS via current URL scheme.
$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 = url('admin', 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)));
+ $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 73b54cd..ca3d935 100644
--- a/core/modules/language/src/Tests/LanguageUrlRewritingTest.php
+++ b/core/modules/language/src/Tests/LanguageUrlRewritingTest.php
@@ -126,7 +126,7 @@ function testDomainNameNegotiationPort() {
// Create an absolute French link.
$language = \Drupal::languageManager()->getLanguage('fr');
- $url = url('', array(
+ $url = _url('', array(
'absolute' => TRUE,
'language' => $language,
));
@@ -135,8 +135,8 @@ 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 = url('', array(
+ // If we set the port explicitly in _url(), it should not be overriden.
+ $url = _url('', array(
'absolute' => TRUE,
'language' => $language,
'base_url' => $request->getBaseUrl() . ':90',
diff --git a/core/modules/language/tests/language_test/src/Controller/LanguageTestController.php b/core/modules/language/tests/language_test/src/Controller/LanguageTestController.php
index 8095270..2935b7d 100644
--- a/core/modules/language/tests/language_test/src/Controller/LanguageTestController.php
+++ b/core/modules/language/tests/language_test/src/Controller/LanguageTestController.php
@@ -53,7 +53,7 @@ public static function create(ContainerInterface $container) {
/**
* Returns links to the current page with different langcodes.
*
- * Using #type 'link' causes these links to be rendered with l().
+ * Using #type 'link' causes these links to be rendered with _l().
*/
public function typeLinkActiveClass() {
// We assume that 'en' and 'fr' have been configured.
diff --git a/core/modules/link/link.module b/core/modules/link/link.module
index 0fd42d5..9207818 100644
--- a/core/modules/link/link.module
+++ b/core/modules/link/link.module
@@ -69,6 +69,6 @@ function template_preprocess_link_formatter_link_separate(&$variables) {
$variables['link'] = \Drupal::l($variables['url_title'], $variables['url']);
}
else {
- $variables['link'] = l($variables['url_title'], $variables['url']->getUri(), $variables['url']->getOptions());
+ $variables['link'] = _l($variables['url_title'], $variables['url']->getUri(), $variables['url']->getOptions());
}
}
diff --git a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
index 5713eae..ca753f8 100644
--- a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
+++ b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
@@ -136,7 +136,7 @@ public function viewElements(FieldItemListInterface $items) {
// If the title field value is available, use it for the link text.
if (empty($settings['url_only']) && !empty($item->title)) {
// Unsanitized token replacement here because $options['html'] is FALSE
- // by default in l().
+ // by default in _l().
$link_title = \Drupal::token()->replace($item->title, array($entity->getEntityTypeId() => $entity), array('sanitize' => FALSE, 'clear' => TRUE));
}
diff --git a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkSeparateFormatter.php b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkSeparateFormatter.php
index 40daa44..a32e611 100644
--- a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkSeparateFormatter.php
+++ b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkSeparateFormatter.php
@@ -54,7 +54,7 @@ public function viewElements(FieldItemListInterface $items) {
// If the link text field value is available, use it for the text.
if (empty($settings['url_only']) && !empty($item->title)) {
// Unsanitized token replacement here because $options['html'] is FALSE
- // by default in l().
+ // by default in _l().
$link_title = \Drupal::token()->replace($item->title, array($entity->getEntityTypeId() => $entity), array('sanitize' => FALSE, 'clear' => TRUE));
}
diff --git a/core/modules/link/src/Tests/LinkFieldTest.php b/core/modules/link/src/Tests/LinkFieldTest.php
index a508c0c..4bd30cd 100644
--- a/core/modules/link/src/Tests/LinkFieldTest.php
+++ b/core/modules/link/src/Tests/LinkFieldTest.php
@@ -275,7 +275,7 @@ function testLinkTitle() {
$this->assertText(t('entity_test @id has been created.', array('@id' => $id)));
$this->renderTestEntity($id);
- $expected_link = l($value, $value);
+ $expected_link = _l($value, $value);
$this->assertRaw($expected_link);
// Verify that a link with text is rendered using the link text.
@@ -287,7 +287,7 @@ function testLinkTitle() {
$this->assertText(t('entity_test @id has been updated.', array('@id' => $id)));
$this->renderTestEntity($id);
- $expected_link = l($title, $value);
+ $expected_link = _l($title, $value);
$this->assertRaw($expected_link);
}
@@ -354,7 +354,7 @@ function testLinkFormatter() {
// Verify that the link is output according to the formatter settings.
// Not using generatePermutations(), since that leads to 32 cases, which
// would not test actual link field formatter functionality but rather
- // l() and options/attributes. Only 'url_plain' has a dependency on
+ // _l() and options/attributes. Only 'url_plain' has a dependency on
// 'url_only', so we have a total of ~10 cases.
$options = array(
'trim_length' => array(NULL, 6),
diff --git a/core/modules/locale/src/Tests/LocaleUpdateBase.php b/core/modules/locale/src/Tests/LocaleUpdateBase.php
index 772ac2a..5e9b81e 100644
--- a/core/modules/locale/src/Tests/LocaleUpdateBase.php
+++ b/core/modules/locale/src/Tests/LocaleUpdateBase.php
@@ -53,7 +53,7 @@ protected function setUp() {
// Update module should not go out to d.o to check for updates. We override
// the url to the default update_test xml path. But without providing
// a mock xml file, no update data will be found.
- \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
+ \Drupal::config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save();
// Setup timestamps to identify old and new translation sources.
$this->timestampOld = REQUEST_TIME - 300;
diff --git a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php
index 49bc7f2..ec719c2 100644
--- a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php
+++ b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php
@@ -334,7 +334,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields['options'] = BaseFieldDefinition::create('map')
->setLabel(t('Options'))
- ->setDescription(t('A serialized array of options to be passed to the url() or l() function, such as a query string or HTML attributes.'))
+ ->setDescription(t('A serialized array of options to be passed to the _url() or _l() function, such as a query string or HTML attributes.'))
->setSetting('default_value', array());
$fields['external'] = BaseFieldDefinition::create('boolean')
diff --git a/core/modules/node/src/Tests/NodeTranslationUITest.php b/core/modules/node/src/Tests/NodeTranslationUITest.php
index 13eced4..b5fd27a 100644
--- a/core/modules/node/src/Tests/NodeTranslationUITest.php
+++ b/core/modules/node/src/Tests/NodeTranslationUITest.php
@@ -335,7 +335,7 @@ protected function doTestTranslations($path, array $values) {
protected function doTestAlternateHreflangLinks($path) {
$languages = $this->container->get('language_manager')->getLanguages();
foreach ($this->langcodes as $langcode) {
- $urls[$langcode] = url($path, array('absolute' => TRUE, 'language' => $languages[$langcode]));
+ $urls[$langcode] = _url($path, array('absolute' => TRUE, 'language' => $languages[$langcode]));
}
foreach ($this->langcodes as $langcode) {
$this->drupalGet($path, array('language' => $languages[$langcode]));
diff --git a/core/modules/node/src/Tests/NodeViewTest.php b/core/modules/node/src/Tests/NodeViewTest.php
index 03c0035..426fec1 100644
--- a/core/modules/node/src/Tests/NodeViewTest.php
+++ b/core/modules/node/src/Tests/NodeViewTest.php
@@ -24,13 +24,13 @@ public function testHtmlHeadLinks() {
$this->drupalGet($node->getSystemPath());
$result = $this->xpath('//link[@rel = "version-history"]');
- $this->assertEqual($result[0]['href'], url("node/{$node->id()}/revisions"));
+ $this->assertEqual($result[0]['href'], _url("node/{$node->id()}/revisions"));
$result = $this->xpath('//link[@rel = "edit-form"]');
- $this->assertEqual($result[0]['href'], url("node/{$node->id()}/edit"));
+ $this->assertEqual($result[0]['href'], _url("node/{$node->id()}/edit"));
$result = $this->xpath('//link[@rel = "canonical"]');
- $this->assertEqual($result[0]['href'], url("node/{$node->id()}"));
+ $this->assertEqual($result[0]['href'], _url("node/{$node->id()}"));
}
}
diff --git a/core/modules/path/src/Controller/PathController.php b/core/modules/path/src/Controller/PathController.php
index 6144b67..96dd34b 100644
--- a/core/modules/path/src/Controller/PathController.php
+++ b/core/modules/path/src/Controller/PathController.php
@@ -73,10 +73,10 @@ public function adminOverview($keys) {
$destination = drupal_get_destination();
foreach ($this->aliasStorage->getAliasesForAdminListing($header, $keys) as $data) {
$row = array();
- $row['data']['alias'] = l(truncate_utf8($data->alias, 50, FALSE, TRUE), $data->source, array(
+ $row['data']['alias'] = _l(truncate_utf8($data->alias, 50, FALSE, TRUE), $data->source, array(
'attributes' => array('title' => $data->alias),
));
- $row['data']['source'] = l(truncate_utf8($data->source, 50, FALSE, TRUE), $data->source, array(
+ $row['data']['source'] = _l(truncate_utf8($data->source, 50, FALSE, TRUE), $data->source, array(
'alias' => TRUE,
'attributes' => array('title' => $data->source),
));
diff --git a/core/modules/path/src/Form/PathFormBase.php b/core/modules/path/src/Form/PathFormBase.php
index 8564156..ecb970c 100644
--- a/core/modules/path/src/Form/PathFormBase.php
+++ b/core/modules/path/src/Form/PathFormBase.php
@@ -95,7 +95,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $pid = NU
'#maxlength' => 255,
'#size' => 45,
'#description' => $this->t('Specify the existing path you wish to alias. For example: node/28, forum/1, taxonomy/term/1.'),
- '#field_prefix' => url(NULL, array('absolute' => TRUE)),
+ '#field_prefix' => _url(NULL, array('absolute' => TRUE)),
'#required' => TRUE,
);
$form['alias'] = array(
@@ -105,7 +105,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $pid = NU
'#maxlength' => 255,
'#size' => 45,
'#description' => $this->t('Specify an alternative path by which this data can be accessed. For example, type "about" when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'),
- '#field_prefix' => url(NULL, array('absolute' => TRUE)),
+ '#field_prefix' => _url(NULL, array('absolute' => TRUE)),
'#required' => TRUE,
);
diff --git a/core/modules/path/src/Tests/PathLanguageTest.php b/core/modules/path/src/Tests/PathLanguageTest.php
index d6399a0..6f1beed 100644
--- a/core/modules/path/src/Tests/PathLanguageTest.php
+++ b/core/modules/path/src/Tests/PathLanguageTest.php
@@ -109,7 +109,7 @@ function testAliasTranslation() {
$this->drupalGet('fr/' . $edit['path[0][alias]']);
$this->assertText($french_node->body->value, 'Alias for French translation works.');
- // Confirm that the alias is returned by url(). Languages are cached on
+ // Confirm that the alias is returned by _url(). Languages are cached on
// many levels, and we need to clear those caches.
$this->container->get('language_manager')->reset();
$languages = $this->container->get('language_manager')->getLanguages();
diff --git a/core/modules/responsive_image/responsive_image.module b/core/modules/responsive_image/responsive_image.module
index 63c732a..8a8df92 100644
--- a/core/modules/responsive_image/responsive_image.module
+++ b/core/modules/responsive_image/responsive_image.module
@@ -147,7 +147,7 @@ function theme_responsive_image_formatter($variables) {
$path = $variables['path']['path'];
$options = isset($variables['path']['options']) ? $variables['path']['options'] : array();
$options['html'] = TRUE;
- return l($responsive_image, $path, $options);
+ return _l($responsive_image, $path, $options);
}
return drupal_render($responsive_image);
diff --git a/core/modules/rest/src/LinkManager/RelationLinkManager.php b/core/modules/rest/src/LinkManager/RelationLinkManager.php
index 04ed8ee..f5ed9fb 100644
--- a/core/modules/rest/src/LinkManager/RelationLinkManager.php
+++ b/core/modules/rest/src/LinkManager/RelationLinkManager.php
@@ -44,7 +44,7 @@ public function __construct(CacheBackendInterface $cache, EntityManagerInterface
*/
public function getRelationUri($entity_type, $bundle, $field_name) {
// @todo Make the base path configurable.
- return url("rest/relation/$entity_type/$bundle/$field_name", array('absolute' => TRUE));
+ return _url("rest/relation/$entity_type/$bundle/$field_name", array('absolute' => TRUE));
}
/**
diff --git a/core/modules/rest/src/LinkManager/TypeLinkManager.php b/core/modules/rest/src/LinkManager/TypeLinkManager.php
index fb21a5f..6c37782 100644
--- a/core/modules/rest/src/LinkManager/TypeLinkManager.php
+++ b/core/modules/rest/src/LinkManager/TypeLinkManager.php
@@ -42,7 +42,7 @@ public function __construct(CacheBackendInterface $cache) {
*/
public function getTypeUri($entity_type, $bundle) {
// @todo Make the base path configurable.
- return url("rest/type/$entity_type/$bundle", array('absolute' => TRUE));
+ return _url("rest/type/$entity_type/$bundle", array('absolute' => TRUE));
}
/**
diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
index c39b88f..b565cea 100644
--- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
+++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
@@ -96,7 +96,7 @@ public function post(EntityInterface $entity = NULL) {
$entity->save();
$this->logger->notice('Created entity %type with ID %id.', array('%type' => $entity->getEntityTypeId(), '%id' => $entity->id()));
- $url = url(strtr($this->pluginId, ':', '/') . '/' . $entity->id(), array('absolute' => TRUE));
+ $url = _url(strtr($this->pluginId, ':', '/') . '/' . $entity->id(), array('absolute' => TRUE));
// 201 Created responses have an empty body.
return new ResourceResponse(NULL, 201, array('Location' => $url));
}
diff --git a/core/modules/rest/src/Tests/AuthTest.php b/core/modules/rest/src/Tests/AuthTest.php
index 257e7f1..230b24c 100644
--- a/core/modules/rest/src/Tests/AuthTest.php
+++ b/core/modules/rest/src/Tests/AuthTest.php
@@ -87,7 +87,7 @@ protected function basicAuthGet($path, $username, $password) {
$out = $this->curlExec(
array(
CURLOPT_HTTPGET => TRUE,
- CURLOPT_URL => url($path, array('absolute' => TRUE)),
+ CURLOPT_URL => _url($path, array('absolute' => TRUE)),
CURLOPT_NOBODY => FALSE,
CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
CURLOPT_USERPWD => $username . ':' . $password,
diff --git a/core/modules/rest/src/Tests/CsrfTest.php b/core/modules/rest/src/Tests/CsrfTest.php
index 9099245..84bf71f 100644
--- a/core/modules/rest/src/Tests/CsrfTest.php
+++ b/core/modules/rest/src/Tests/CsrfTest.php
@@ -107,7 +107,7 @@ protected function getCurlOptions() {
CURLOPT_HTTPGET => FALSE,
CURLOPT_POST => TRUE,
CURLOPT_POSTFIELDS => $this->serialized,
- CURLOPT_URL => url('entity/' . $this->testEntityType, array('absolute' => TRUE)),
+ CURLOPT_URL => _url('entity/' . $this->testEntityType, array('absolute' => TRUE)),
CURLOPT_NOBODY => FALSE,
CURLOPT_HTTPHEADER => array(
"Content-Type: {$this->defaultMimeType}",
diff --git a/core/modules/rest/src/Tests/NodeTest.php b/core/modules/rest/src/Tests/NodeTest.php
index 4cd2bc9..96619b7 100644
--- a/core/modules/rest/src/Tests/NodeTest.php
+++ b/core/modules/rest/src/Tests/NodeTest.php
@@ -68,7 +68,7 @@ public function testNodes() {
$data = array(
'_links' => array(
'type' => array(
- 'href' => url('rest/type/node/resttest', array('absolute' => TRUE)),
+ 'href' => _url('rest/type/node/resttest', array('absolute' => TRUE)),
),
),
'title' => array(
diff --git a/core/modules/rest/src/Tests/RESTTestBase.php b/core/modules/rest/src/Tests/RESTTestBase.php
index a2e0ffe..32fa9c3 100644
--- a/core/modules/rest/src/Tests/RESTTestBase.php
+++ b/core/modules/rest/src/Tests/RESTTestBase.php
@@ -86,7 +86,7 @@ protected function httpRequest($url, $method, $body = NULL, $mime_type = NULL) {
$curl_options = array(
CURLOPT_HTTPGET => TRUE,
CURLOPT_CUSTOMREQUEST => 'GET',
- CURLOPT_URL => url($url, $options),
+ CURLOPT_URL => _url($url, $options),
CURLOPT_NOBODY => FALSE,
CURLOPT_HTTPHEADER => array('Accept: ' . $mime_type),
);
@@ -97,7 +97,7 @@ protected function httpRequest($url, $method, $body = NULL, $mime_type = NULL) {
CURLOPT_HTTPGET => FALSE,
CURLOPT_POST => TRUE,
CURLOPT_POSTFIELDS => $body,
- CURLOPT_URL => url($url, array('absolute' => TRUE)),
+ CURLOPT_URL => _url($url, array('absolute' => TRUE)),
CURLOPT_NOBODY => FALSE,
CURLOPT_HTTPHEADER => array(
'Content-Type: ' . $mime_type,
@@ -111,7 +111,7 @@ protected function httpRequest($url, $method, $body = NULL, $mime_type = NULL) {
CURLOPT_HTTPGET => FALSE,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS => $body,
- CURLOPT_URL => url($url, array('absolute' => TRUE)),
+ CURLOPT_URL => _url($url, array('absolute' => TRUE)),
CURLOPT_NOBODY => FALSE,
CURLOPT_HTTPHEADER => array(
'Content-Type: ' . $mime_type,
@@ -125,7 +125,7 @@ protected function httpRequest($url, $method, $body = NULL, $mime_type = NULL) {
CURLOPT_HTTPGET => FALSE,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_POSTFIELDS => $body,
- CURLOPT_URL => url($url, array('absolute' => TRUE)),
+ CURLOPT_URL => _url($url, array('absolute' => TRUE)),
CURLOPT_NOBODY => FALSE,
CURLOPT_HTTPHEADER => array(
'Content-Type: ' . $mime_type,
@@ -138,7 +138,7 @@ protected function httpRequest($url, $method, $body = NULL, $mime_type = NULL) {
$curl_options = array(
CURLOPT_HTTPGET => FALSE,
CURLOPT_CUSTOMREQUEST => 'DELETE',
- CURLOPT_URL => url($url, array('absolute' => TRUE)),
+ CURLOPT_URL => _url($url, array('absolute' => TRUE)),
CURLOPT_NOBODY => FALSE,
CURLOPT_HTTPHEADER => array('X-CSRF-Token: ' . $token),
);
diff --git a/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php
index 7a145b6..e7c98c6 100644
--- a/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php
+++ b/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php
@@ -269,8 +269,8 @@ public function testMultipleSearchPages() {
// Ensure both search pages have their tabs displayed.
$this->drupalGet('search');
$elements = $this->xpath('//*[contains(@class, :class)]//a', array(':class' => 'tabs primary'));
- $this->assertIdentical((string) $elements[0]['href'], url('search/' . $first['path']));
- $this->assertIdentical((string) $elements[1]['href'], url('search/' . $second['path']));
+ $this->assertIdentical((string) $elements[0]['href'], _url('search/' . $first['path']));
+ $this->assertIdentical((string) $elements[1]['href'], _url('search/' . $second['path']));
// Switch the weight of the search pages and check the order of the tabs.
$edit = array(
@@ -280,8 +280,8 @@ public function testMultipleSearchPages() {
$this->drupalPostForm('admin/config/search/pages', $edit, t('Save configuration'));
$this->drupalGet('search');
$elements = $this->xpath('//*[contains(@class, :class)]//a', array(':class' => 'tabs primary'));
- $this->assertIdentical((string) $elements[0]['href'], url('search/' . $second['path']));
- $this->assertIdentical((string) $elements[1]['href'], url('search/' . $first['path']));
+ $this->assertIdentical((string) $elements[0]['href'], _url('search/' . $second['path']));
+ $this->assertIdentical((string) $elements[1]['href'], _url('search/' . $first['path']));
// Check the initial state of the search pages.
$this->drupalGet('admin/config/search/pages');
diff --git a/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php b/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php
index b8f7c73..d1855ad 100644
--- a/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php
+++ b/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php
@@ -57,7 +57,7 @@ public function execute() {
}
return array(
array(
- 'link' => url('node'),
+ 'link' => _url('node'),
'type' => 'Dummy result type',
'title' => 'Dummy title',
'snippet' => SafeMarkup::set("Dummy search snippet to display. Keywords: {$this->keywords}\n\nConditions: " . print_r($this->searchParameters, TRUE)),
diff --git a/core/modules/serialization/src/Tests/EntityResolverTest.php b/core/modules/serialization/src/Tests/EntityResolverTest.php
index 3cf8952..2bf4ed9 100644
--- a/core/modules/serialization/src/Tests/EntityResolverTest.php
+++ b/core/modules/serialization/src/Tests/EntityResolverTest.php
@@ -58,16 +58,16 @@ function testUuidEntityResolver() {
$entity->set('field_test_entity_reference', array(array('target_id' => 1)));
$entity->save();
- $field_uri = url('rest/relation/entity_test_mulrev/entity_test_mulrev/field_test_entity_reference', array('absolute' => TRUE));
+ $field_uri = _url('rest/relation/entity_test_mulrev/entity_test_mulrev/field_test_entity_reference', array('absolute' => TRUE));
$data = array(
'_links' => array(
'type' => array(
- 'href' => url('rest/type/entity_test_mulrev/entity_test_mulrev', array('absolute' => TRUE)),
+ 'href' => _url('rest/type/entity_test_mulrev/entity_test_mulrev', array('absolute' => TRUE)),
),
$field_uri => array(
array(
- 'href' => url('entity/entity_test_mulrev/' . $entity->id()),
+ 'href' => _url('entity/entity_test_mulrev/' . $entity->id()),
),
),
),
@@ -75,7 +75,7 @@ function testUuidEntityResolver() {
$field_uri => array(
array(
'_links' => array(
- 'self' => url('entity/entity_test_mulrev/' . $entity->id()),
+ 'self' => _url('entity/entity_test_mulrev/' . $entity->id()),
),
'uuid' => array(
array(
diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php
index 171df78..b8bed09 100644
--- a/core/modules/simpletest/src/TestBase.php
+++ b/core/modules/simpletest/src/TestBase.php
@@ -745,7 +745,7 @@ protected function verbose($message) {
$verbose_filename = $this->verboseDirectory . '/' . $this->verboseClassName . '-' . $this->verboseId . '.html';
if (file_put_contents($verbose_filename, $message, FILE_APPEND)) {
$url = $this->verboseDirectoryUrl . '/' . $this->verboseClassName . '-' . $this->verboseId . '.html';
- // Not using l() to avoid invoking the theme system, so that unit tests
+ // Not using _l() to avoid invoking the theme system, so that unit tests
// can use verbose() as well.
$url = 'Verbose message';
$this->error($url, 'User notice');
diff --git a/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php b/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php
index 69712c3..869dbca 100644
--- a/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php
+++ b/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php
@@ -77,7 +77,7 @@ public function testInternalBrowser() {
// Not using File API; a potential error must trigger a PHP warning.
unlink($this->siteDirectory . '/.htkey');
global $base_url;
- $this->drupalGet(url($base_url . '/core/install.php', array('external' => TRUE, 'absolute' => TRUE)));
+ $this->drupalGet(_url($base_url . '/core/install.php', array('external' => TRUE, 'absolute' => TRUE)));
$this->assertResponse(403, 'Cannot access install.php.');
}
diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index ab560b2..3c826bf 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -1476,7 +1476,7 @@ protected function drupalGet($path, array $options = array(), array $headers = a
* @param string $path
* Path to request AJAX from.
* @param array $options
- * Array of options to pass to url().
+ * Array of options to pass to _url().
* @param array $headers
* Array of headers. Eg array('Accept: application/vnd.drupal-ajax').
*
@@ -1925,11 +1925,11 @@ protected function drupalProcessAjaxResponse($content, array $ajax_response, arr
*
* @see WebTestBase::getAjaxPageStatePostData()
* @see WebTestBase::curlExec()
- * @see url()
+ * @see _url()
*/
protected function drupalPost($path, $accept, array $post, $options = array()) {
return $this->curlExec(array(
- CURLOPT_URL => url($path, $options + array('absolute' => TRUE)),
+ CURLOPT_URL => _url($path, $options + array('absolute' => TRUE)),
CURLOPT_POST => TRUE,
CURLOPT_POSTFIELDS => $this->serializePostValues($post),
CURLOPT_HTTPHEADER => array(
diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module
index 3c80cd8..00ca78d 100644
--- a/core/modules/statistics/statistics.module
+++ b/core/modules/statistics/statistics.module
@@ -39,7 +39,7 @@ function statistics_help($route_name, RouteMatchInterface $route_match) {
function statistics_node_view(array &$build, EntityInterface $node, EntityViewDisplayInterface $display, $view_mode) {
if (!$node->isNew() && $view_mode == 'full' && node_is_page($node) && empty($node->in_preview)) {
$build['statistics_content_counter']['#attached']['library'][] = 'statistics/drupal.statistics';
- $settings = array('data' => array('nid' => $node->id()), 'url' => url(drupal_get_path('module', 'statistics') . '/statistics.php'));
+ $settings = array('data' => array('nid' => $node->id()), 'url' => _url(drupal_get_path('module', 'statistics') . '/statistics.php'));
$build['statistics_content_counter']['#attached']['js'][] = array(
'data' => array('statistics' => $settings),
'type' => 'setting',
diff --git a/core/modules/system/language.api.php b/core/modules/system/language.api.php
index 3a74f82..f52e22d 100644
--- a/core/modules/system/language.api.php
+++ b/core/modules/system/language.api.php
@@ -95,7 +95,7 @@
* Perform alterations on language switcher links.
*
* A language switcher link may need to point to a different path or use a
- * translated link text before going through l(), which will just handle the
+ * translated link text before going through _l(), which will just handle the
* path aliases.
*
* @param $links
diff --git a/core/modules/system/src/Form/SiteInformationForm.php b/core/modules/system/src/Form/SiteInformationForm.php
index d8328df..7ae14cf 100644
--- a/core/modules/system/src/Form/SiteInformationForm.php
+++ b/core/modules/system/src/Form/SiteInformationForm.php
@@ -114,7 +114,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#default_value' => $front_page,
'#size' => 40,
'#description' => t('Optionally, specify a relative URL to display as the front page. Leave blank to display the default front page.'),
- '#field_prefix' => url(NULL, array('absolute' => TRUE)),
+ '#field_prefix' => _url(NULL, array('absolute' => TRUE)),
);
$form['error_page'] = array(
'#type' => 'details',
@@ -127,7 +127,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#default_value' => $site_config->get('page.403'),
'#size' => 40,
'#description' => t('This page is displayed when the requested document is denied to the current user. Leave blank to display a generic "access denied" page.'),
- '#field_prefix' => url(NULL, array('absolute' => TRUE)),
+ '#field_prefix' => _url(NULL, array('absolute' => TRUE)),
);
$form['error_page']['site_404'] = array(
'#type' => 'textfield',
@@ -135,7 +135,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#default_value' => $site_config->get('page.404'),
'#size' => 40,
'#description' => t('This page is displayed when no other content matches the requested document. Leave blank to display a generic "page not found" page.'),
- '#field_prefix' => url(NULL, array('absolute' => TRUE)),
+ '#field_prefix' => _url(NULL, array('absolute' => TRUE)),
);
return parent::buildForm($form, $form_state);
diff --git a/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php b/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php
index 4b4e222..7efb671 100644
--- a/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php
+++ b/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php
@@ -149,7 +149,7 @@ protected function verifyPageCacheTags($path, $expected_tags) {
sort($actual_tags);
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT');
$this->assertIdentical($actual_tags, $expected_tags);
- $cid_parts = array(url($path, array('absolute' => TRUE)), 'html');
+ $cid_parts = array(_url($path, array('absolute' => TRUE)), 'html');
$cid = sha1(implode(':', $cid_parts));
$cache_entry = \Drupal::cache('render')->get($cid);
sort($cache_entry->tags);
diff --git a/core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php b/core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php
index f3a0d76..e54f97b 100644
--- a/core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php
+++ b/core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php
@@ -46,7 +46,7 @@ protected function verifyPageCache($path, $hit_or_miss, $tags = FALSE) {
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), $hit_or_miss, $message);
if ($hit_or_miss === 'HIT' && is_array($tags)) {
- $cid_parts = array(url($path, array('absolute' => TRUE)), 'html');
+ $cid_parts = array(_url($path, array('absolute' => TRUE)), 'html');
$cid = sha1(implode(':', $cid_parts));
$cache_entry = \Drupal::cache('render')->get($cid);
sort($cache_entry->tags);
diff --git a/core/modules/system/src/Tests/Common/AddFeedTest.php b/core/modules/system/src/Tests/Common/AddFeedTest.php
index 8de6090..a24581d 100644
--- a/core/modules/system/src/Tests/Common/AddFeedTest.php
+++ b/core/modules/system/src/Tests/Common/AddFeedTest.php
@@ -23,11 +23,11 @@ class AddFeedTest extends WebTestBase {
function testBasicFeedAddNoTitle() {
$path = $this->randomMachineName(12);
$external_url = 'http://' . $this->randomMachineName(12) . '/' . $this->randomMachineName(12);
- $fully_qualified_local_url = url($this->randomMachineName(12), array('absolute' => TRUE));
+ $fully_qualified_local_url = _url($this->randomMachineName(12), array('absolute' => TRUE));
$path_for_title = $this->randomMachineName(12);
$external_for_title = 'http://' . $this->randomMachineName(12) . '/' . $this->randomMachineName(12);
- $fully_qualified_for_title = url($this->randomMachineName(12), array('absolute' => TRUE));
+ $fully_qualified_for_title = _url($this->randomMachineName(12), array('absolute' => TRUE));
// Possible permutations of drupal_add_feed() to test.
// - 'input_url': the path passed to drupal_add_feed(),
@@ -35,7 +35,7 @@ function testBasicFeedAddNoTitle() {
// - 'title' == the title of the feed as passed into drupal_add_feed().
$urls = array(
'path without title' => array(
- 'url' => url($path, array('absolute' => TRUE)),
+ 'url' => _url($path, array('absolute' => TRUE)),
'title' => '',
),
'external URL without title' => array(
@@ -47,7 +47,7 @@ function testBasicFeedAddNoTitle() {
'title' => '',
),
'path with title' => array(
- 'url' => url($path_for_title, array('absolute' => TRUE)),
+ 'url' => _url($path_for_title, array('absolute' => TRUE)),
'title' => $this->randomMachineName(12),
),
'external URL with title' => array(
diff --git a/core/modules/system/src/Tests/Common/RenderElementTypesTest.php b/core/modules/system/src/Tests/Common/RenderElementTypesTest.php
index 6d83838..9757a2b 100644
--- a/core/modules/system/src/Tests/Common/RenderElementTypesTest.php
+++ b/core/modules/system/src/Tests/Common/RenderElementTypesTest.php
@@ -147,7 +147,7 @@ function testMoreLink() {
'#type' => 'more_link',
'#href' => 'a/link',
),
- 'expected' => '//div[@class="more-link"]/a[@href="' . url('a/link') . '" and text()="More"]',
+ 'expected' => '//div[@class="more-link"]/a[@href="' . _url('a/link') . '" and text()="More"]',
),
array(
'name' => "#type 'more_link' anchor tag with a route",
@@ -165,7 +165,7 @@ function testMoreLink() {
'#href' => 'admin/content',
'#options' => array('absolute' => TRUE),
),
- 'expected' => '//div[@class="more-link"]/a[@href="' . url('admin/content', array('absolute' => TRUE)) . '" and text()="More"]',
+ 'expected' => '//div[@class="more-link"]/a[@href="' . _url('admin/content', array('absolute' => TRUE)) . '" and text()="More"]',
),
array(
'name' => "#type 'more_link' anchor tag to the front page",
@@ -173,7 +173,7 @@ function testMoreLink() {
'#type' => 'more_link',
'#href' => '',
),
- 'expected' => '//div[@class="more-link"]/a[@href="' . url('') . '" and text()="More"]',
+ 'expected' => '//div[@class="more-link"]/a[@href="' . _url('') . '" and text()="More"]',
),
);
diff --git a/core/modules/system/src/Tests/Common/RenderWebTest.php b/core/modules/system/src/Tests/Common/RenderWebTest.php
index 3c8725a..3e58fb0 100644
--- a/core/modules/system/src/Tests/Common/RenderWebTest.php
+++ b/core/modules/system/src/Tests/Common/RenderWebTest.php
@@ -111,7 +111,7 @@ function testDrupalRenderFormElements() {
),
);
$this->assertRenderedElement($element, '//a[@href=:href and contains(., :title)]', array(
- ':href' => url($element['#href'], array('absolute' => TRUE)),
+ ':href' => _url($element['#href'], array('absolute' => TRUE)),
':title' => $element['#title'],
));
diff --git a/core/modules/system/src/Tests/Common/UrlTest.php b/core/modules/system/src/Tests/Common/UrlTest.php
index 4edae14..0097512 100644
--- a/core/modules/system/src/Tests/Common/UrlTest.php
+++ b/core/modules/system/src/Tests/Common/UrlTest.php
@@ -12,12 +12,12 @@
use Drupal\simpletest\WebTestBase;
/**
- * Confirm that url(),
+ * Confirm that _url(),
* \Drupal\Component\Utility\UrlHelper::filterQueryParameters(),
- * \Drupal\Component\Utility\UrlHelper::buildQuery(), and l() work correctly
+ * \Drupal\Component\Utility\UrlHelper::buildQuery(), and _l() work correctly
* with various input.
*
- * url() calls \Drupal::moduleHandler()->getImplementations(),
+ * _url() calls \Drupal::moduleHandler()->getImplementations(),
* which may issue a db query, which requires
* inheriting from a web test case rather than a unit test case.
*
@@ -31,12 +31,12 @@ class UrlTest extends WebTestBase {
* Confirms that invalid URLs are filtered in link generating functions.
*/
function testLinkXSS() {
- // Test l().
+ // Test _l().
$text = $this->randomMachineName();
$path = "";
- $link = l($text, $path);
- $sanitized_path = check_url(url($path));
- $this->assertTrue(strpos($link, $sanitized_path) !== FALSE, format_string('XSS attack @path was filtered by l().', array('@path' => $path)));
+ $link = _l($text, $path);
+ $sanitized_path = check_url(_url($path));
+ $this->assertTrue(strpos($link, $sanitized_path) !== FALSE, format_string('XSS attack @path was filtered by _l().', array('@path' => $path)));
// Test #type 'link'.
$link_array = array(
@@ -45,7 +45,7 @@ function testLinkXSS() {
'#href' => $path,
);
$type_link = drupal_render($link_array);
- $sanitized_path = check_url(url($path));
+ $sanitized_path = check_url(_url($path));
$this->assertTrue(strpos($type_link, $sanitized_path) !== FALSE, format_string('XSS attack @path was filtered by #theme', array('@path' => $path)));
}
@@ -76,7 +76,7 @@ function testLinkAttributes() {
$rendered = drupal_render($hreflang_override_link);
$this->assertTrue($this->hasAttribute('hreflang', $rendered, 'foo'), format_string('hreflang attribute with value @hreflang is present on a rendered link when @hreflang is provided in the render array.', array('@hreflang' => 'foo')));
- // Test the active class in links produced by l() and #type 'link'.
+ // Test the active class in links produced by _l() and #type 'link'.
$options_no_query = array();
$options_query = array(
'query' => array(
@@ -95,27 +95,27 @@ function testLinkAttributes() {
$path = 'common-test/type-link-active-class';
$this->drupalGet($path, $options_no_query);
- $links = $this->xpath('//a[@href = :href and contains(@class, :class)]', array(':href' => url($path, $options_no_query), ':class' => 'active'));
- $this->assertTrue(isset($links[0]), 'A link generated by l() to the current page is marked active.');
+ $links = $this->xpath('//a[@href = :href and contains(@class, :class)]', array(':href' => _url($path, $options_no_query), ':class' => 'active'));
+ $this->assertTrue(isset($links[0]), 'A link generated by _l() to the current page is marked active.');
- $links = $this->xpath('//a[@href = :href and not(contains(@class, :class))]', array(':href' => url($path, $options_query), ':class' => 'active'));
- $this->assertTrue(isset($links[0]), 'A link generated by l() to the current page with a query string when the current page has no query string is not marked active.');
+ $links = $this->xpath('//a[@href = :href and not(contains(@class, :class))]', array(':href' => _url($path, $options_query), ':class' => 'active'));
+ $this->assertTrue(isset($links[0]), 'A link generated by _l() to the current page with a query string when the current page has no query string is not marked active.');
$this->drupalGet($path, $options_query);
- $links = $this->xpath('//a[@href = :href and contains(@class, :class)]', array(':href' => url($path, $options_query), ':class' => 'active'));
- $this->assertTrue(isset($links[0]), 'A link generated by l() to the current page with a query string that matches the current query string is marked active.');
+ $links = $this->xpath('//a[@href = :href and contains(@class, :class)]', array(':href' => _url($path, $options_query), ':class' => 'active'));
+ $this->assertTrue(isset($links[0]), 'A link generated by _l() to the current page with a query string that matches the current query string is marked active.');
- $links = $this->xpath('//a[@href = :href and contains(@class, :class)]', array(':href' => url($path, $options_query_reverse), ':class' => 'active'));
- $this->assertTrue(isset($links[0]), 'A link generated by l() to the current page with a query string that has matching parameters to the current query string but in a different order is marked active.');
+ $links = $this->xpath('//a[@href = :href and contains(@class, :class)]', array(':href' => _url($path, $options_query_reverse), ':class' => 'active'));
+ $this->assertTrue(isset($links[0]), 'A link generated by _l() to the current page with a query string that has matching parameters to the current query string but in a different order is marked active.');
- $links = $this->xpath('//a[@href = :href and not(contains(@class, :class))]', array(':href' => url($path, $options_no_query), ':class' => 'active'));
- $this->assertTrue(isset($links[0]), 'A link generated by l() to the current page without a query string when the current page has a query string is not marked active.');
+ $links = $this->xpath('//a[@href = :href and not(contains(@class, :class))]', array(':href' => _url($path, $options_no_query), ':class' => 'active'));
+ $this->assertTrue(isset($links[0]), 'A link generated by _l() to the current page without a query string when the current page has a query string is not marked active.');
- // Test adding a custom class in links produced by l() and #type 'link'.
- // Test l().
+ // Test adding a custom class in links produced by _l() and #type 'link'.
+ // Test _l().
$class_l = $this->randomMachineName();
- $link_l = l($this->randomMachineName(), current_path(), array('attributes' => array('class' => array($class_l))));
- $this->assertTrue($this->hasAttribute('class', $link_l, $class_l), format_string('Custom class @class is present on link when requested by l()', array('@class' => $class_l)));
+ $link_l = _l($this->randomMachineName(), current_path(), array('attributes' => array('class' => array($class_l))));
+ $this->assertTrue($this->hasAttribute('class', $link_l, $class_l), format_string('Custom class @class is present on link when requested by _l()', array('@class' => $class_l)));
// Test #type.
$class_theme = $this->randomMachineName();
@@ -137,12 +137,12 @@ function testLinkAttributes() {
* Tests that link functions support render arrays as 'text'.
*/
function testLinkRenderArrayText() {
- // Build a link with l() for reference.
- $l = l('foo', 'http://drupal.org');
+ // Build a link with _l() for reference.
+ $l = _l('foo', 'http://drupal.org');
- // Test a renderable array passed to l().
+ // Test a renderable array passed to _l().
$renderable_text = array('#markup' => 'foo');
- $l_renderable_text = l($renderable_text, 'http://drupal.org');
+ $l_renderable_text = _l($renderable_text, 'http://drupal.org');
$this->assertEqual($l_renderable_text, $l);
// Test a themed link with plain text 'text'.
@@ -261,30 +261,30 @@ function testExternalUrls() {
// Verify external URL can contain a fragment.
$url = $test_url . '#drupal';
- $result = url($url);
+ $result = _url($url);
$this->assertEqual($url, $result, 'External URL with fragment works without a fragment in $options.');
// Verify fragment can be overidden in an external URL.
$url = $test_url . '#drupal';
$fragment = $this->randomMachineName(10);
- $result = url($url, array('fragment' => $fragment));
+ $result = _url($url, array('fragment' => $fragment));
$this->assertEqual($test_url . '#' . $fragment, $result, 'External URL fragment is overidden with a custom fragment in $options.');
// Verify external URL can contain a query string.
$url = $test_url . '?drupal=awesome';
- $result = url($url);
+ $result = _url($url);
$this->assertEqual($url, $result, 'External URL with query string works without a query string in $options.');
// Verify external URL can be extended with a query string.
$url = $test_url;
$query = array($this->randomMachineName(5) => $this->randomMachineName(5));
- $result = url($url, array('query' => $query));
+ $result = _url($url, array('query' => $query));
$this->assertEqual($url . '?' . http_build_query($query, '', '&'), $result, 'External URL can be extended with a query string in $options.');
// Verify query string can be extended in an external URL.
$url = $test_url . '?drupal=awesome';
$query = array($this->randomMachineName(5) => $this->randomMachineName(5));
- $result = url($url, array('query' => $query));
+ $result = _url($url, array('query' => $query));
$this->assertEqual($url . '&' . http_build_query($query, '', '&'), $result, 'External URL query string can be extended with a custom query string in $options.');
}
}
diff --git a/core/modules/system/src/Tests/Form/RebuildTest.php b/core/modules/system/src/Tests/Form/RebuildTest.php
index 7affa60..a1d4ac2 100644
--- a/core/modules/system/src/Tests/Form/RebuildTest.php
+++ b/core/modules/system/src/Tests/Form/RebuildTest.php
@@ -105,6 +105,6 @@ function testPreserveFormActionAfterAJAX() {
// Ensure that the form's action is correct.
$forms = $this->xpath('//form[contains(@class, "node-page-form")]');
- $this->assert(count($forms) == 1 && $forms[0]['action'] == url('node/add/page'), 'Re-rendered form contains the correct action value.');
+ $this->assert(count($forms) == 1 && $forms[0]['action'] == _url('node/add/page'), 'Re-rendered form contains the correct action value.');
}
}
diff --git a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php
index cf5ab1a..d5d7250 100644
--- a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php
+++ b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php
@@ -280,7 +280,7 @@ function testBreadCrumbs() {
// other than the breadcrumb trail.
$elements = $this->xpath('//nav[@id=:menu]/descendant::a[@href=:href]', array(
':menu' => 'block-bartik-tools',
- ':href' => url($link_path),
+ ':href' => _url($link_path),
));
$this->assertTrue(count($elements) == 1, "Link to {$link_path} appears only once.");
diff --git a/core/modules/system/src/Tests/Menu/LocalActionTest.php b/core/modules/system/src/Tests/Menu/LocalActionTest.php
index bcc443b..3c02aad 100644
--- a/core/modules/system/src/Tests/Menu/LocalActionTest.php
+++ b/core/modules/system/src/Tests/Menu/LocalActionTest.php
@@ -48,7 +48,7 @@ protected function assertLocalAction(array $actions) {
$index = 0;
foreach ($actions as $href => $title) {
$this->assertEqual((string) $elements[$index], $title);
- $this->assertEqual($elements[$index]['href'], url($href));
+ $this->assertEqual($elements[$index]['href'], _url($href));
$index++;
}
}
diff --git a/core/modules/system/src/Tests/Menu/LocalTasksTest.php b/core/modules/system/src/Tests/Menu/LocalTasksTest.php
index 957e2eb..fc61315 100644
--- a/core/modules/system/src/Tests/Menu/LocalTasksTest.php
+++ b/core/modules/system/src/Tests/Menu/LocalTasksTest.php
@@ -34,7 +34,7 @@ protected function assertLocalTasks(array $hrefs, $level = 0) {
));
$this->assertTrue(count($elements), 'Local tasks found.');
foreach ($hrefs as $index => $element) {
- $expected = url($hrefs[$index]);
+ $expected = _url($hrefs[$index]);
$method = ($elements[$index]['href'] == $expected ? 'pass' : 'fail');
$this->{$method}(format_string('Task @number href @value equals @expected.', array(
'@number' => $index + 1,
diff --git a/core/modules/system/src/Tests/Menu/MenuRouterTest.php b/core/modules/system/src/Tests/Menu/MenuRouterTest.php
index 89a6a32..48c7500 100644
--- a/core/modules/system/src/Tests/Menu/MenuRouterTest.php
+++ b/core/modules/system/src/Tests/Menu/MenuRouterTest.php
@@ -70,8 +70,8 @@ protected function doTestHookMenuIntegration() {
$this->assertLink('Local task A');
$this->assertLink('Local task B');
// Confirm correct local task href.
- $this->assertLinkByHref(url($base_path));
- $this->assertLinkByHref(url($base_path . '/b'));
+ $this->assertLinkByHref(_url($base_path));
+ $this->assertLinkByHref(_url($base_path . '/b'));
}
/**
diff --git a/core/modules/system/src/Tests/Menu/MenuTestBase.php b/core/modules/system/src/Tests/Menu/MenuTestBase.php
index fc896d8..2478af3 100644
--- a/core/modules/system/src/Tests/Menu/MenuTestBase.php
+++ b/core/modules/system/src/Tests/Menu/MenuTestBase.php
@@ -64,7 +64,7 @@ protected function assertBreadcrumbParts($trail) {
// this test would go into an infinite loop, so we need to check that too.
while ($trail && !empty($parts)) {
foreach ($trail as $path => $title) {
- $url = url($path);
+ $url = _url($path);
$part = array_shift($parts);
$pass = ($pass && $part['href'] === $url && $part['text'] === String::checkPlain($title));
}
@@ -101,7 +101,7 @@ protected function assertMenuActiveTrail($tree, $last_active) {
$part_xpath .= 'li[contains(@class, :class)]/a[contains(@href, :href) and contains(text(), :title)]';
$part_args = array(
':class' => 'active-trail',
- ':href' => url($link_path),
+ ':href' => _url($link_path),
':title' => $link_title,
);
$xpath .= $this->buildXPathQuery($part_xpath, $part_args);
@@ -121,7 +121,7 @@ protected function assertMenuActiveTrail($tree, $last_active) {
$args = array(
':class-trail' => 'active-trail',
':class-active' => 'active',
- ':href' => url($active_link_path),
+ ':href' => _url($active_link_path),
':title' => $active_link_title,
);
$elements = $this->xpath($xpath, $args);
diff --git a/core/modules/system/src/Tests/Menu/MenuTranslateTest.php b/core/modules/system/src/Tests/Menu/MenuTranslateTest.php
index 99e1401..ea4b302 100644
--- a/core/modules/system/src/Tests/Menu/MenuTranslateTest.php
+++ b/core/modules/system/src/Tests/Menu/MenuTranslateTest.php
@@ -40,7 +40,7 @@ public function testMenuTranslate() {
$this->assertResponse(403);
$elements = $this->xpath('//ul[@class=:class]/li/a[@href=:href]', array(
':class' => 'tabs primary',
- ':href' => url('foo/asdf'),
+ ':href' => _url('foo/asdf'),
));
$this->assertTrue(empty($elements), 'No tab linking to foo/asdf found');
$this->assertNoLinkByHref('foo/asdf/b');
diff --git a/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php b/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php
index 6f81d0d..7f64ddb 100644
--- a/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php
+++ b/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php
@@ -87,9 +87,9 @@ function testCurrentUrlRequestedPath() {
* Assert that an outbound path is altered to an expected value.
*
* @param $original
- * A string with the original path that is run through url().
+ * A string with the original path that is run through _url().
* @param $final
- * A string with the expected result after url().
+ * A string with the expected result after _url().
* @return
* TRUE if $original was correctly altered to $final, FALSE otherwise.
*/
@@ -107,7 +107,7 @@ protected function assertUrlOutboundAlter($original, $final) {
* @param $original
* The original path before it has been altered by inbound URL processing.
* @param $final
- * A string with the expected result after url().
+ * A string with the expected result after _url().
* @return
* TRUE if $original was correctly altered to $final, FALSE otherwise.
*/
diff --git a/core/modules/system/src/Tests/System/TokenReplaceUnitTest.php b/core/modules/system/src/Tests/System/TokenReplaceUnitTest.php
index 2152474..eaed0a6 100644
--- a/core/modules/system/src/Tests/System/TokenReplaceUnitTest.php
+++ b/core/modules/system/src/Tests/System/TokenReplaceUnitTest.php
@@ -74,7 +74,7 @@ public function testClear() {
* Tests the generation of all system site information tokens.
*/
public function testSystemSiteTokenReplacement() {
- // The use of the url() function requires the url_alias table to exist.
+ // The use of the _url() function requires the url_alias table to exist.
$this->installSchema('system', 'url_alias');
$url_options = array(
'absolute' => TRUE,
diff --git a/core/modules/system/src/Tests/Theme/FunctionsTest.php b/core/modules/system/src/Tests/Theme/FunctionsTest.php
index c970553..c8d068c 100644
--- a/core/modules/system/src/Tests/Theme/FunctionsTest.php
+++ b/core/modules/system/src/Tests/Theme/FunctionsTest.php
@@ -170,7 +170,7 @@ function testItemList() {
* Tests links.html.twig.
*/
function testLinks() {
- // Turn off the query for the l() function to compare the active
+ // Turn off the query for the _l() function to compare the active
// link correctly.
$original_query = \Drupal::request()->query->all();
\Drupal::request()->query->replace(array());
@@ -216,9 +216,9 @@ function testLinks() {
$expected_links = '';
$expected_links .= '
';
$query = array('key' => 'value');
$encoded_query = String::checkPlain(Json::encode($query));
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index fdc3e87..f721626 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -371,7 +371,7 @@ function hook_page_build(&$page) {
* this menu item (as a result of other properties), then the menu link is
* always expanded, equivalent to its 'always expanded' checkbox being set
* in the UI.
- * - options: (optional) An array of options to be passed to l() when
+ * - options: (optional) An array of options to be passed to _l() when
* generating a link from this menu item.
*
* @ingroup menu
@@ -393,7 +393,7 @@ function hook_menu_links_discovered_alter(&$links) {
* - #link: An associative array containing:
* - title: The localized title of the link.
* - href: The system path to link to.
- * - localized_options: An array of options to pass to l().
+ * - localized_options: An array of options to pass to _l().
* - #weight: The link's weight compared to other links.
* - #active: Whether the link should be marked as 'active'.
*
@@ -495,7 +495,7 @@ function hook_local_tasks_alter(&$local_tasks) {
* - title: The localized title of the link.
* - route_name: The route name of the link.
* - route_parameters: The route parameters of the link.
- * - localized_options: An array of options to pass to url().
+ * - localized_options: An array of options to pass to _url().
* - (optional) weight: The weight of the link, which is used to sort the links.
*
*
@@ -2683,7 +2683,7 @@ function hook_filetransfer_info_alter(&$filetransfer_info) {
* @param array $variables
* An associative array of variables defining a link. The link may be either a
* "route link" using \Drupal\Core\Utility\LinkGenerator::link(), which is
- * exposed as the 'link_generator' service or a link generated by l(). If the
+ * exposed as the 'link_generator' service or a link generated by _l(). If the
* link is a "route link", 'route_name' will be set, otherwise 'path' will be
* set. The following keys can be altered:
* - text: The link text for the anchor tag as a translated string.
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 17fe8c8..a44b1fe 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -619,7 +619,7 @@ function system_user_login($account) {
$config = \Drupal::config('system.date');
// If the user has a NULL time zone, notify them to set a time zone.
if (!$account->getTimezone() && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) {
- drupal_set_message(t('Configure your account time zone setting.', array('@user-edit' => url("user/$account->id()/edit", array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone')))));
+ drupal_set_message(t('Configure your account time zone setting.', array('@user-edit' => _url("user/$account->id()/edit", array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone')))));
}
}
diff --git a/core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php b/core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php
index 32bc04f..be4ce96 100644
--- a/core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php
+++ b/core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php
@@ -18,7 +18,7 @@ class CommonTestController {
/**
* Returns links to the current page, with and without query strings.
*
- * Using #type 'link' causes these links to be rendered with l().
+ * Using #type 'link' causes these links to be rendered with _l().
*/
public function typeLinkActiveClass() {
return array(
diff --git a/core/modules/update/src/Form/UpdateManagerUpdate.php b/core/modules/update/src/Form/UpdateManagerUpdate.php
index c90247f..88858a6 100644
--- a/core/modules/update/src/Form/UpdateManagerUpdate.php
+++ b/core/modules/update/src/Form/UpdateManagerUpdate.php
@@ -111,7 +111,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
// The project name to display can vary based on the info we have.
if (!empty($project['title'])) {
if (!empty($project['link'])) {
- $project_name = l($project['title'], $project['link']);
+ $project_name = _l($project['title'], $project['link']);
}
else {
$project_name = String::checkPlain($project['title']);
@@ -134,7 +134,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
}
$recommended_release = $project['releases'][$project['recommended']];
- $recommended_version = $recommended_release['version'] . ' ' . l($this->t('(Release notes)'), $recommended_release['release_link'], array('attributes' => array('title' => $this->t('Release notes for @project_title', array('@project_title' => $project['title'])))));
+ $recommended_version = $recommended_release['version'] . ' ' . _l($this->t('(Release notes)'), $recommended_release['release_link'], array('attributes' => array('title' => $this->t('Release notes for @project_title', array('@project_title' => $project['title'])))));
if ($recommended_release['version_major'] != $project['existing_major']) {
$recommended_version .= '
' . $this->t('This update is a major version update which means that it may not be backwards compatible with your currently running version. It is recommended that you read the release notes and proceed at your own risk.') . '
';
}
diff --git a/core/modules/update/src/Tests/UpdateContribTest.php b/core/modules/update/src/Tests/UpdateContribTest.php
index b389c24..118a60e 100644
--- a/core/modules/update/src/Tests/UpdateContribTest.php
+++ b/core/modules/update/src/Tests/UpdateContribTest.php
@@ -50,12 +50,12 @@ function testNoReleasesAvailable() {
// Cannot use $this->standardTests() because we need to check for the
// 'No available releases found' string.
$this->assertRaw('
');
$this->assertNoText(t('Update available'));
$this->assertText(t('No available releases found'));
- $this->assertNoRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'));
+ $this->assertNoRaw(_l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'));
$available = update_get_available();
$this->assertFalse(isset($available['aaa_update_test']['fetch_status']), 'Results are cached even if no releases are available.');
@@ -86,7 +86,7 @@ function testUpdateContribBasic() {
$this->assertText(t('Up to date'));
$this->assertRaw('
' . t('Modules') . '
');
$this->assertNoText(t('Update available'));
- $this->assertRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project appears.');
+ $this->assertRaw(_l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project appears.');
}
/**
@@ -147,10 +147,10 @@ function testUpdateContribOrder() {
$this->assertText(t('CCC Update test'));
// We want aaa_update_test included in the ccc_update_test project, not as
// its own project on the report.
- $this->assertNoRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project does not appear.');
+ $this->assertNoRaw(_l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project does not appear.');
// The other two should be listed as projects.
- $this->assertRaw(l(t('BBB Update test'), 'http://example.com/project/bbb_update_test'), 'Link to bbb_update_test project appears.');
- $this->assertRaw(l(t('CCC Update test'), 'http://example.com/project/ccc_update_test'), 'Link to bbb_update_test project appears.');
+ $this->assertRaw(_l(t('BBB Update test'), 'http://example.com/project/bbb_update_test'), 'Link to bbb_update_test project appears.');
+ $this->assertRaw(_l(t('CCC Update test'), 'http://example.com/project/ccc_update_test'), 'Link to bbb_update_test project appears.');
// We want to make sure we see the BBB project before the CCC project.
// Instead of just searching for 'BBB Update test' or something, we want
@@ -197,7 +197,7 @@ function testUpdateBaseThemeSecurityUpdate() {
);
$this->refreshUpdateStatus($xml_mapping);
$this->assertText(t('Security update required!'));
- $this->assertRaw(l(t('Update test base theme'), 'http://example.com/project/update_test_basetheme'), 'Link to the Update test base theme project appears.');
+ $this->assertRaw(_l(t('Update test base theme'), 'http://example.com/project/update_test_basetheme'), 'Link to the Update test base theme project appears.');
}
/**
@@ -247,8 +247,8 @@ function testUpdateShowDisabledThemes() {
'update_test_subtheme' => '1_0',
'update_test_basetheme' => '1_1-sec',
);
- $base_theme_project_link = l(t('Update test base theme'), 'http://example.com/project/update_test_basetheme');
- $sub_theme_project_link = l(t('Update test subtheme'), 'http://example.com/project/update_test_subtheme');
+ $base_theme_project_link = _l(t('Update test base theme'), 'http://example.com/project/update_test_basetheme');
+ $sub_theme_project_link = _l(t('Update test subtheme'), 'http://example.com/project/update_test_subtheme');
foreach (array(TRUE, FALSE) as $check_disabled) {
$update_settings->set('check.disabled_extensions', $check_disabled)->save();
$this->refreshUpdateStatus($xml_mapping);
@@ -350,9 +350,9 @@ function testUpdateBrokenFetchURL() {
$this->assertUniqueText(t('Failed to get available update data for one project.'));
// The other two should be listed as projects.
- $this->assertRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project appears.');
- $this->assertNoRaw(l(t('BBB Update test'), 'http://example.com/project/bbb_update_test'), 'Link to bbb_update_test project does not appear.');
- $this->assertRaw(l(t('CCC Update test'), 'http://example.com/project/ccc_update_test'), 'Link to bbb_update_test project appears.');
+ $this->assertRaw(_l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project appears.');
+ $this->assertNoRaw(_l(t('BBB Update test'), 'http://example.com/project/bbb_update_test'), 'Link to bbb_update_test project does not appear.');
+ $this->assertRaw(_l(t('CCC Update test'), 'http://example.com/project/ccc_update_test'), 'Link to bbb_update_test project appears.');
}
/**
@@ -394,7 +394,7 @@ function testHookUpdateStatusAlter() {
$this->drupalGet('admin/reports/updates');
$this->assertRaw('
' . t('Modules') . '
');
$this->assertText(t('Security update required!'));
- $this->assertRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project appears.');
+ $this->assertRaw(_l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project appears.');
// Visit the reports page again without the altering and make sure the
// status is back to normal.
@@ -402,7 +402,7 @@ function testHookUpdateStatusAlter() {
$this->drupalGet('admin/reports/updates');
$this->assertRaw('
' . t('Modules') . '
');
$this->assertNoText(t('Security update required!'));
- $this->assertRaw(l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project appears.');
+ $this->assertRaw(_l(t('AAA Update test'), 'http://example.com/project/aaa_update_test'), 'Link to aaa_update_test project appears.');
// Turn the altering back on and visit the Update manager UI.
$update_test_config->set('update_status', $update_status)->save();
diff --git a/core/modules/update/src/Tests/UpdateCoreTest.php b/core/modules/update/src/Tests/UpdateCoreTest.php
index 2201cf3..969f15c 100644
--- a/core/modules/update/src/Tests/UpdateCoreTest.php
+++ b/core/modules/update/src/Tests/UpdateCoreTest.php
@@ -51,9 +51,9 @@ function testNormalUpdateAvailable() {
$this->assertNoText(t('Up to date'));
$this->assertText(t('Update available'));
$this->assertNoText(t('Security update required!'));
- $this->assertRaw(l('7.1', 'http://example.com/drupal-7-1-release'), 'Link to release appears.');
- $this->assertRaw(l(t('Download'), 'http://example.com/drupal-7-1.tar.gz'), 'Link to download appears.');
- $this->assertRaw(l(t('Release notes'), 'http://example.com/drupal-7-1-release'), 'Link to release notes appears.');
+ $this->assertRaw(_l('7.1', 'http://example.com/drupal-7-1-release'), 'Link to release appears.');
+ $this->assertRaw(_l(t('Download'), 'http://example.com/drupal-7-1.tar.gz'), 'Link to download appears.');
+ $this->assertRaw(_l(t('Release notes'), 'http://example.com/drupal-7-1-release'), 'Link to release notes appears.');
}
/**
@@ -66,9 +66,9 @@ function testSecurityUpdateAvailable() {
$this->assertNoText(t('Up to date'));
$this->assertNoText(t('Update available'));
$this->assertText(t('Security update required!'));
- $this->assertRaw(l('7.2', 'http://example.com/drupal-7-2-release'), 'Link to release appears.');
- $this->assertRaw(l(t('Download'), 'http://example.com/drupal-7-2.tar.gz'), 'Link to download appears.');
- $this->assertRaw(l(t('Release notes'), 'http://example.com/drupal-7-2-release'), 'Link to release notes appears.');
+ $this->assertRaw(_l('7.2', 'http://example.com/drupal-7-2-release'), 'Link to release appears.');
+ $this->assertRaw(_l(t('Download'), 'http://example.com/drupal-7-2.tar.gz'), 'Link to download appears.');
+ $this->assertRaw(_l(t('Release notes'), 'http://example.com/drupal-7-2-release'), 'Link to release notes appears.');
}
/**
@@ -99,7 +99,7 @@ function testDatestampMismatch() {
*/
function testModulePageRunCron() {
$this->setSystemInfo7_0();
- \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
+ \Drupal::config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save();
\Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '0'))->save();
$this->cronRun();
@@ -113,7 +113,7 @@ function testModulePageRunCron() {
function testModulePageUpToDate() {
$this->setSystemInfo7_0();
// Instead of using refreshUpdateStatus(), set these manually.
- \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
+ \Drupal::config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save();
\Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '0'))->save();
$this->drupalGet('admin/reports/updates');
@@ -130,7 +130,7 @@ function testModulePageUpToDate() {
function testModulePageRegularUpdate() {
$this->setSystemInfo7_0();
// Instead of using refreshUpdateStatus(), set these manually.
- \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
+ \Drupal::config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save();
\Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '1'))->save();
$this->drupalGet('admin/reports/updates');
@@ -147,7 +147,7 @@ function testModulePageRegularUpdate() {
function testModulePageSecurityUpdate() {
$this->setSystemInfo7_0();
// Instead of using refreshUpdateStatus(), set these manually.
- \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
+ \Drupal::config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save();
\Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '2-sec'))->save();
$this->drupalGet('admin/reports/updates');
@@ -219,7 +219,7 @@ function testFetchTasks() {
function testLanguageModuleUpdate() {
$this->setSystemInfo7_0();
// Instead of using refreshUpdateStatus(), set these manually.
- \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
+ \Drupal::config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save();
\Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '1'))->save();
$this->drupalGet('admin/reports/updates');
diff --git a/core/modules/update/src/Tests/UpdateTestBase.php b/core/modules/update/src/Tests/UpdateTestBase.php
index 47a6649..98b768d 100644
--- a/core/modules/update/src/Tests/UpdateTestBase.php
+++ b/core/modules/update/src/Tests/UpdateTestBase.php
@@ -43,7 +43,7 @@
protected function refreshUpdateStatus($xml_map, $url = 'update-test') {
// Tell the Update Manager module to fetch from the URL provided by
// update_test module.
- \Drupal::config('update.settings')->set('fetch.url', url($url, array('absolute' => TRUE)))->save();
+ \Drupal::config('update.settings')->set('fetch.url', _url($url, array('absolute' => TRUE)))->save();
// Save the map for update_test_mock_page() to use.
\Drupal::config('update_test.settings')->set('xml_map', $xml_map)->save();
// Manually check the update status.
@@ -55,7 +55,7 @@ protected function refreshUpdateStatus($xml_map, $url = 'update-test') {
*/
protected function standardTests() {
$this->assertRaw('
' . t('Drupal core') . '
');
- $this->assertRaw(l(t('Drupal'), 'http://example.com/project/drupal'), 'Link to the Drupal project appears.');
+ $this->assertRaw(_l(t('Drupal'), 'http://example.com/project/drupal'), 'Link to the Drupal project appears.');
$this->assertNoText(t('No available releases found'));
}
}
diff --git a/core/modules/update/src/Tests/UpdateUploadTest.php b/core/modules/update/src/Tests/UpdateUploadTest.php
index 29d0357..fe13c08 100644
--- a/core/modules/update/src/Tests/UpdateUploadTest.php
+++ b/core/modules/update/src/Tests/UpdateUploadTest.php
@@ -79,7 +79,7 @@ function testUpdateManagerCoreSecurityUpdateMessages() {
->set('system_info', $setting)
->set('xml_map', array('drupal' => '2-sec'))
->save();
- \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save();
+ \Drupal::config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save();
// Initialize the update status.
$this->drupalGet('admin/reports/updates');
diff --git a/core/modules/user/src/Plugin/Block/UserLoginBlock.php b/core/modules/user/src/Plugin/Block/UserLoginBlock.php
index ed40273..a2111cc 100644
--- a/core/modules/user/src/Plugin/Block/UserLoginBlock.php
+++ b/core/modules/user/src/Plugin/Block/UserLoginBlock.php
@@ -41,7 +41,7 @@ public function build() {
unset($form['pass']['#description']);
$form['name']['#size'] = 15;
$form['pass']['#size'] = 15;
- $form['#action'] = url(current_path(), array('query' => drupal_get_destination(), 'external' => FALSE));
+ $form['#action'] = _url(current_path(), array('query' => drupal_get_destination(), 'external' => FALSE));
// Build action links.
$items = array();
if (\Drupal::config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) {
diff --git a/core/modules/user/src/Tests/UserAdminTest.php b/core/modules/user/src/Tests/UserAdminTest.php
index 3b18295..ae57536 100644
--- a/core/modules/user/src/Tests/UserAdminTest.php
+++ b/core/modules/user/src/Tests/UserAdminTest.php
@@ -54,7 +54,7 @@ function testUserAdmin() {
// Test for existence of edit link in table.
// @todo This cannot be converted to \Drupal::l() until
// https://www.drupal.org/node/2345725 is resolved.
- $link = l(t('Edit'), "user/" . $user_a->id() . "/edit", array('query' => array('destination' => 'admin/people')));
+ $link = _l(t('Edit'), "user/" . $user_a->id() . "/edit", array('query' => array('destination' => 'admin/people')));
$this->assertRaw($link, 'Found user A edit link on admin users page');
// Test exposed filter elements.
diff --git a/core/modules/views/src/Form/ViewsExposedForm.php b/core/modules/views/src/Form/ViewsExposedForm.php
index ee2fa2d..a425748 100644
--- a/core/modules/views/src/Form/ViewsExposedForm.php
+++ b/core/modules/views/src/Form/ViewsExposedForm.php
@@ -114,7 +114,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#id' => drupal_html_id('edit-submit-' . $view->storage->id()),
);
- $form['#action'] = url($view->display_handler->getUrl());
+ $form['#action'] = _url($view->display_handler->getUrl());
$form['#theme'] = $view->buildThemeFunctions('views_exposed_form');
$form['#id'] = drupal_clean_css_identifier('views_exposed_form-' . String::checkPlain($view->storage->id()) . '-' . String::checkPlain($display['id']));
// $form['#attributes']['class'] = array('views-exposed-form');
diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
index 140f11b..f370bea 100644
--- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
@@ -2115,7 +2115,7 @@ public function renderMoreLink() {
$url_options['query'] = $this->view->exposed_raw_input;
}
$theme = $this->view->buildThemeFunctions('views_more');
- $path = check_url(url($path, $url_options));
+ $path = check_url(_url($path, $url_options));
return array(
'#theme' => $theme,
diff --git a/core/modules/views/src/Plugin/views/display/PathPluginBase.php b/core/modules/views/src/Plugin/views/display/PathPluginBase.php
index 1fe0a35..ee8370a 100644
--- a/core/modules/views/src/Plugin/views/display/PathPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/PathPluginBase.php
@@ -393,7 +393,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#title' => $this->t('Path'),
'#description' => $this->t('This view will be displayed by visiting this path on your site. You may use "%" in your URL to represent values that will be used for contextual filters: For example, "node/%/feed". If needed you can even specify named route parameters like taxonomy/term/%taxonomy_term'),
'#default_value' => $this->getOption('path'),
- '#field_prefix' => '' . url(NULL, array('absolute' => TRUE)),
+ '#field_prefix' => '' . _url(NULL, array('absolute' => TRUE)),
'#field_suffix' => '',
'#attributes' => array('dir' => 'ltr'),
// Account for the leading backslash.
diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
index 3466e55..a56be9b 100644
--- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
+++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
@@ -1277,14 +1277,14 @@ public function renderText($alter) {
$more_link_path = $this->options['alter']['more_link_path'];
$more_link_path = strip_tags(decode_entities(strtr($more_link_path, $tokens)));
- // Make sure that paths which were run through url() work as well.
+ // Make sure that paths which were run through _url() work as well.
$base_path = base_path();
// Checks whether the path starts with the base_path.
if (strpos($more_link_path, $base_path) === 0) {
$more_link_path = drupal_substr($more_link_path, drupal_strlen($base_path));
}
- $more_link = l($more_link_text, $more_link_path, array('attributes' => array('class' => array('views-more-link'))));
+ $more_link = _l($more_link_text, $more_link_path, array('attributes' => array('class' => array('views-more-link'))));
$suffix .= " " . $more_link;
}
@@ -1344,7 +1344,7 @@ protected function renderAsLink($alter, $text, $tokens) {
'absolute' => !empty($alter['absolute']) ? TRUE : FALSE,
);
- // $path will be run through check_url() by l() so we do not need to
+ // $path will be run through check_url() by _l() so we do not need to
// sanitize it ourselves.
$path = $alter['path'];
@@ -1456,7 +1456,7 @@ protected function renderAsLink($alter, $text, $tokens) {
// parsed values.
if (isset($alter['query'])) {
// Convert the query to a string, perform token replacement, and then
- // convert back to an array form for l().
+ // convert back to an array form for _l().
$options['query'] = UrlHelper::buildQuery($alter['query']);
$options['query'] = strtr($options['query'], $tokens);
$query = array();
@@ -1482,7 +1482,7 @@ protected function renderAsLink($alter, $text, $tokens) {
$options['entity_type'] = $alter['entity_type'];
}
- $value .= l($text, $path, $options);
+ $value .= _l($text, $path, $options);
if (!empty($alter['suffix'])) {
$value .= Xss::filterAdmin(strtr($alter['suffix'], $tokens));
diff --git a/core/modules/views/src/Plugin/views/field/Url.php b/core/modules/views/src/Plugin/views/field/Url.php
index ea82308..65672ef 100644
--- a/core/modules/views/src/Plugin/views/field/Url.php
+++ b/core/modules/views/src/Plugin/views/field/Url.php
@@ -45,7 +45,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
public function render(ResultRow $values) {
$value = $this->getValue($values);
if (!empty($this->options['display_as_link'])) {
- return l($this->sanitizeValue($value), $value, array('html' => TRUE));
+ return _l($this->sanitizeValue($value), $value, array('html' => TRUE));
}
else {
return $this->sanitizeValue($value, 'url');
diff --git a/core/modules/views/src/Plugin/views/row/RssFields.php b/core/modules/views/src/Plugin/views/row/RssFields.php
index ec4830c..456958f 100644
--- a/core/modules/views/src/Plugin/views/row/RssFields.php
+++ b/core/modules/views/src/Plugin/views/row/RssFields.php
@@ -143,7 +143,7 @@ public function render($row) {
// Create the RSS item object.
$item = new \stdClass();
$item->title = $this->getField($row_index, $this->options['title_field']);
- $item->link = url($this->getField($row_index, $this->options['link_field']), array('absolute' => TRUE));
+ $item->link = _url($this->getField($row_index, $this->options['link_field']), array('absolute' => TRUE));
$item->description = $this->getField($row_index, $this->options['description_field']);
$item->elements = array(
array('key' => 'pubDate', 'value' => $this->getField($row_index, $this->options['date_field'])),
@@ -157,7 +157,7 @@ public function render($row) {
$item_guid = $this->getField($row_index, $this->options['guid_field_options']['guid_field']);
if ($this->options['guid_field_options']['guid_field_is_permalink']) {
$guid_is_permalink_string = 'true';
- $item_guid = url($item_guid, array('absolute' => TRUE));
+ $item_guid = _url($item_guid, array('absolute' => TRUE));
}
$item->elements[] = array(
'key' => 'guid',
diff --git a/core/modules/views/src/Plugin/views/style/Opml.php b/core/modules/views/src/Plugin/views/style/Opml.php
index a1a0094..ad23aae 100644
--- a/core/modules/views/src/Plugin/views/style/Opml.php
+++ b/core/modules/views/src/Plugin/views/style/Opml.php
@@ -41,7 +41,7 @@ public function attachTo(array &$build, $display_id, $path, $title) {
}
$url_options['absolute'] = TRUE;
- $url = url($this->view->getUrl(NULL, $path), $url_options);
+ $url = _url($this->view->getUrl(NULL, $path), $url_options);
if ($display->hasPath()) {
if (empty($this->preview)) {
$build['#attached']['drupal_add_feed'][] = array($url, $title);
diff --git a/core/modules/views/src/Plugin/views/style/Rss.php b/core/modules/views/src/Plugin/views/style/Rss.php
index f812ccc..c75e7d4 100644
--- a/core/modules/views/src/Plugin/views/style/Rss.php
+++ b/core/modules/views/src/Plugin/views/style/Rss.php
@@ -41,7 +41,7 @@ public function attachTo(array &$build, $display_id, $path, $title) {
}
$url_options['absolute'] = TRUE;
- $url = url($this->view->getUrl(NULL, $path), $url_options);
+ $url = _url($this->view->getUrl(NULL, $path), $url_options);
if ($display->hasPath()) {
if (empty($this->preview)) {
// Add a call for drupal_add_feed to the view attached data.
diff --git a/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php b/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
index 1b13575..c2a23dc 100644
--- a/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
+++ b/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
@@ -218,7 +218,7 @@ public function getSorts() {
public function buildForm(array $form, FormStateInterface $form_state) {
$style_options = Views::fetchPluginNames('style', 'normal', array($this->base_table));
$feed_row_options = Views::fetchPluginNames('row', 'feed', array($this->base_table));
- $path_prefix = url(NULL, array('absolute' => TRUE));
+ $path_prefix = _url(NULL, array('absolute' => TRUE));
// Add filters and sorts which apply to the view as a whole.
$this->buildFilters($form, $form_state);
diff --git a/core/modules/views/src/Tests/GlossaryTest.php b/core/modules/views/src/Tests/GlossaryTest.php
index 4518aae..61fb6a3 100644
--- a/core/modules/views/src/Tests/GlossaryTest.php
+++ b/core/modules/views/src/Tests/GlossaryTest.php
@@ -66,7 +66,7 @@ public function testGlossaryView() {
$this->assertResponse(200);
foreach ($nodes_per_char as $char => $count) {
- $href = url('glossary/' . $char);
+ $href = _url('glossary/' . $char);
$label = Unicode::strtoupper($char);
// Get the summary link for a certain character. Filter by label and href
// to ensure that both of them are correct.
diff --git a/core/modules/views/src/Tests/Handler/FieldUrlTest.php b/core/modules/views/src/Tests/Handler/FieldUrlTest.php
index 04ed05c..8373071 100644
--- a/core/modules/views/src/Tests/Handler/FieldUrlTest.php
+++ b/core/modules/views/src/Tests/Handler/FieldUrlTest.php
@@ -70,7 +70,7 @@ public function testFieldUrl() {
$this->executeView($view);
- $this->assertEqual(l('John', 'John'), $view->field['name']->advancedRender($view->result[0]));
+ $this->assertEqual(_l('John', 'John'), $view->field['name']->advancedRender($view->result[0]));
}
}
diff --git a/core/modules/views/src/Tests/Plugin/ExposedFormTest.php b/core/modules/views/src/Tests/Plugin/ExposedFormTest.php
index ecbdbc0..1be2038 100644
--- a/core/modules/views/src/Tests/Plugin/ExposedFormTest.php
+++ b/core/modules/views/src/Tests/Plugin/ExposedFormTest.php
@@ -129,7 +129,7 @@ public function testExposedFormRender() {
$this->assertFieldByXpath('//form/@id', $this->getExpectedExposedFormId($view), 'Expected form ID found.');
- $expected_action = url($view->display_handler->getUrl());
+ $expected_action = _url($view->display_handler->getUrl());
$this->assertFieldByXPath('//form/@action', $expected_action, 'The expected value for the action attribute was found.');
}
diff --git a/core/modules/views/src/Tests/TokenReplaceTest.php b/core/modules/views/src/Tests/TokenReplaceTest.php
index bb97765..13ae1cd 100644
--- a/core/modules/views/src/Tests/TokenReplaceTest.php
+++ b/core/modules/views/src/Tests/TokenReplaceTest.php
@@ -44,7 +44,7 @@ function testTokenReplacement() {
'[view:description]' => 'Test view to token replacement tests.',
'[view:id]' => 'test_tokens',
'[view:title]' => 'Test token page',
- '[view:url]' => url('test_tokens', array('absolute' => TRUE)),
+ '[view:url]' => _url('test_tokens', array('absolute' => TRUE)),
'[view:total-rows]' => (string) $view->total_rows,
'[view:base-table]' => 'views_test_data',
'[view:base-field]' => 'id',
diff --git a/core/modules/views/src/Tests/ViewStorageTest.php b/core/modules/views/src/Tests/ViewStorageTest.php
index fc78a9e..7a05428 100644
--- a/core/modules/views/src/Tests/ViewStorageTest.php
+++ b/core/modules/views/src/Tests/ViewStorageTest.php
@@ -185,7 +185,7 @@ protected function displayTests() {
* Tests the display related functions like getDisplaysList().
*/
protected function displayMethodTests() {
- // Enable the system module so l() can work using url_alias table.
+ // Enable the system module so _l() can work using url_alias table.
$this->installSchema('system', 'url_alias');
$config['display'] = array(
diff --git a/core/modules/views/src/Tests/Wizard/BasicTest.php b/core/modules/views/src/Tests/Wizard/BasicTest.php
index 99c495c..9b6e0f2 100644
--- a/core/modules/views/src/Tests/Wizard/BasicTest.php
+++ b/core/modules/views/src/Tests/Wizard/BasicTest.php
@@ -74,7 +74,7 @@ function testViewsWizardAndListing() {
$this->assertText($node2->label());
// Check if we have the feed.
- $this->assertLinkByHref(url($view2['page[feed_properties][path]']));
+ $this->assertLinkByHref(_url($view2['page[feed_properties][path]']));
$this->drupalGet($view2['page[feed_properties][path]']);
$this->assertRaw('drupalGet('admin/structure/views');
$this->assertText($view2['label']);
$this->assertText($view2['description']);
- $this->assertLinkByHref(url($view2['page[path]']));
+ $this->assertLinkByHref(_url($view2['page[path]']));
// The view should not have a REST export display.
$this->assertNoText('REST export', 'If only the page option was enabled in the wizard, the resulting view does not have a REST export display.');
@@ -123,7 +123,7 @@ function testViewsWizardAndListing() {
$this->drupalGet('admin/structure/views');
$this->assertText($view3['label']);
$this->assertText($view3['description']);
- $this->assertLinkByHref(url($view3['page[path]']));
+ $this->assertLinkByHref(_url($view3['page[path]']));
// The view should not have a REST export display.
$this->assertNoText('REST export', 'If only the page and block options were enabled in the wizard, the resulting view does not have a REST export display.');
diff --git a/core/modules/views/src/Tests/Wizard/MenuTest.php b/core/modules/views/src/Tests/Wizard/MenuTest.php
index ba3aa42..8c4f7b9 100644
--- a/core/modules/views/src/Tests/Wizard/MenuTest.php
+++ b/core/modules/views/src/Tests/Wizard/MenuTest.php
@@ -40,7 +40,7 @@ function testMenus() {
$this->drupalGet('');
$this->assertResponse(200);
$this->assertLink($view['page[link_properties][title]']);
- $this->assertLinkByHref(url($view['page[path]']));
+ $this->assertLinkByHref(_url($view['page[path]']));
// Make sure the link is associated with the main menu.
/** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc
index 81df6a1..9ab4be0 100644
--- a/core/modules/views/views.theme.inc
+++ b/core/modules/views/views.theme.inc
@@ -306,8 +306,8 @@ function template_preprocess_views_view_summary(&$variables) {
}
$active_urls = array(
- url(current_path(), array('alias' => TRUE)), // force system path
- url(current_path()), // could be an alias
+ _url(current_path(), array('alias' => TRUE)), // force system path
+ _url(current_path()), // could be an alias
);
$active_urls = array_combine($active_urls, $active_urls);
@@ -331,7 +331,7 @@ function template_preprocess_views_view_summary(&$variables) {
if (!empty($argument->options['summary_options']['base_path'])) {
$base_path = $argument->options['summary_options']['base_path'];
}
- $variables['rows'][$id]->url = url($view->getUrl($args, $base_path), $url_options);
+ $variables['rows'][$id]->url = _url($view->getUrl($args, $base_path), $url_options);
$variables['rows'][$id]->count = intval($row->{$argument->count_alias});
if (isset($active_urls[$variables['rows'][$id]->url])) {
$variables['rows'][$id]->attributes['class'][] = 'active';
@@ -366,9 +366,9 @@ function template_preprocess_views_view_summary_unformatted(&$variables) {
$count = 0;
$active_urls = array(
// Force system path.
- url(current_path(), array('alias' => TRUE)),
+ _url(current_path(), array('alias' => TRUE)),
// Could be an alias.
- url(current_path()),
+ _url(current_path()),
);
$active_urls = array_combine($active_urls, $active_urls);
@@ -395,7 +395,7 @@ function template_preprocess_views_view_summary_unformatted(&$variables) {
if (!empty($argument->options['summary_options']['base_path'])) {
$base_path = $argument->options['summary_options']['base_path'];
}
- $variables['rows'][$id]->url = url($view->getUrl($args, $base_path), $url_options);
+ $variables['rows'][$id]->url = _url($view->getUrl($args, $base_path), $url_options);
$variables['rows'][$id]->count = intval($row->{$argument->count_alias});
if (isset($active_urls[$variables['rows'][$id]->url])) {
$variables['rows'][$id]->attributes['class'][] = 'active';
@@ -484,7 +484,7 @@ function template_preprocess_views_view_table(&$variables) {
'attributes' => array('title' => $title),
'query' => $query,
);
- $variables['header'][$field]['content'] = l($label, current_path(), $link_options);
+ $variables['header'][$field]['content'] = _l($label, current_path(), $link_options);
}
// Set up the header label class.
@@ -901,7 +901,7 @@ function template_preprocess_views_view_rss(&$variables) {
$path = '';
}
- $variables['link'] = check_url(url($path, $url_options));
+ $variables['link'] = check_url(_url($path, $url_options));
}
$variables['langcode'] = String::checkPlain(\Drupal::languageManager()->getCurrentLanguage()->id);
diff --git a/core/modules/views/views.tokens.inc b/core/modules/views/views.tokens.inc
index f6e2539..4160d85 100644
--- a/core/modules/views/views.tokens.inc
+++ b/core/modules/views/views.tokens.inc
@@ -103,7 +103,7 @@ function views_tokens($type, $tokens, array $data = array(), array $options = ar
case 'url':
if ($path = $view->getUrl()) {
- $replacements[$original] = url($path, $url_options);
+ $replacements[$original] = _url($path, $url_options);
}
break;
case 'base-table':
diff --git a/core/modules/views_ui/src/Form/Ajax/Rearrange.php b/core/modules/views_ui/src/Form/Ajax/Rearrange.php
index 25cf3f1..42fda54 100644
--- a/core/modules/views_ui/src/Form/Ajax/Rearrange.php
+++ b/core/modules/views_ui/src/Form/Ajax/Rearrange.php
@@ -124,7 +124,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#id' => 'views-removed-' . $id,
'#attributes' => array('class' => array('views-remove-checkbox')),
'#default_value' => 0,
- '#suffix' => l('' . $this->t('Remove') . '', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $id, 'class' => array('views-hidden', 'views-button-remove', 'views-remove-link'), 'alt' => $this->t('Remove this item'), 'title' => $this->t('Remove this item')), 'html' => TRUE)),
+ '#suffix' => _l('' . $this->t('Remove') . '', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $id, 'class' => array('views-hidden', 'views-button-remove', 'views-remove-link'), 'alt' => $this->t('Remove this item'), 'title' => $this->t('Remove this item')), 'html' => TRUE)),
);
}
diff --git a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
index b9dc99d..6d558cd 100644
--- a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
+++ b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
@@ -149,7 +149,7 @@ public function getForm(ViewStorageInterface $view, $display_id, $js) {
$form_state->setUserInput(array());
$form_path = views_ui_build_form_path($form_state);
if (!$form_state->get('ajax')) {
- return new RedirectResponse(url($form_path, array('absolute' => TRUE)));
+ return new RedirectResponse(_url($form_path, array('absolute' => TRUE)));
}
$form_state->set('path', $form_path);
$response = views_ajax_form_wrapper($form_class, $form_state);
diff --git a/core/modules/views_ui/src/Tests/DefaultViewsTest.php b/core/modules/views_ui/src/Tests/DefaultViewsTest.php
index 67a57b9..080d774 100644
--- a/core/modules/views_ui/src/Tests/DefaultViewsTest.php
+++ b/core/modules/views_ui/src/Tests/DefaultViewsTest.php
@@ -168,7 +168,7 @@ public function testPathDestination() {
// Check that a dynamic path is shown as text.
$this->assertRaw('test_route_with_suffix/%/suffix');
- $this->assertNoLinkByHref(url('test_route_with_suffix/%/suffix'));
+ $this->assertNoLinkByHref(_url('test_route_with_suffix/%/suffix'));
}
/**
diff --git a/core/modules/views_ui/src/ViewListBuilder.php b/core/modules/views_ui/src/ViewListBuilder.php
index 16b5b84..9d12e5a 100644
--- a/core/modules/views_ui/src/ViewListBuilder.php
+++ b/core/modules/views_ui/src/ViewListBuilder.php
@@ -264,7 +264,7 @@ protected function getDisplayPaths(EntityInterface $view) {
if ($display->hasPath()) {
$path = $display->getPath();
if ($view->status() && strpos($path, '%') === FALSE) {
- $all_paths[] = l('/' . $path, $path);
+ $all_paths[] = _l('/' . $path, $path);
}
else {
$all_paths[] = String::checkPlain('/' . $path);
diff --git a/core/modules/views_ui/src/ViewUI.php b/core/modules/views_ui/src/ViewUI.php
index 1068d45..86d535b 100644
--- a/core/modules/views_ui/src/ViewUI.php
+++ b/core/modules/views_ui/src/ViewUI.php
@@ -693,7 +693,7 @@ public function renderPreview($display_id, $args = array()) {
Xss::filterAdmin($this->executable->getTitle()),
);
if (isset($path)) {
- $path = l($path, $path);
+ $path = _l($path, $path);
}
else {
$path = t('This display has no path.');
diff --git a/core/modules/views_ui/views_ui.theme.inc b/core/modules/views_ui/views_ui.theme.inc
index ce5bcd1..80f2f45 100644
--- a/core/modules/views_ui/views_ui.theme.inc
+++ b/core/modules/views_ui/views_ui.theme.inc
@@ -166,7 +166,7 @@ function theme_views_ui_build_group_filter_form($variables) {
'title' => drupal_render($form['group_items'][$group_id]['title']),
'operator' => drupal_render($form['group_items'][$group_id]['operator']),
'value' => drupal_render($form['group_items'][$group_id]['value']),
- 'remove' => drupal_render($form['group_items'][$group_id]['remove']) . l('' . t('Remove') . '', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $group_id, 'class' => array('views-hidden', 'views-button-remove', 'views-groups-remove-link', 'views-remove-link'), 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => true)),
+ 'remove' => drupal_render($form['group_items'][$group_id]['remove']) . _l('' . t('Remove') . '', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $group_id, 'class' => array('views-hidden', 'views-button-remove', 'views-groups-remove-link', 'views-remove-link'), 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => true)),
);
$rows[] = array('data' => $data, 'id' => 'views-row-' . $group_id, 'class' => array('draggable'));
}
diff --git a/core/tests/Drupal/Tests/Core/DrupalTest.php b/core/tests/Drupal/Tests/Core/DrupalTest.php
index 988cf6c..f56dee2 100644
--- a/core/tests/Drupal/Tests/Core/DrupalTest.php
+++ b/core/tests/Drupal/Tests/Core/DrupalTest.php
@@ -250,7 +250,7 @@ public function testUrlGenerator() {
}
/**
- * Tests the url() method.
+ * Tests the _url() method.
*
* @see \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute()
*/
@@ -276,7 +276,7 @@ public function testLinkGenerator() {
}
/**
- * Tests the l() method.
+ * Tests the _l() method.
*
* @see \Drupal\Core\Utility\LinkGeneratorInterface::generate()
*/
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
index 4787e62..d1e8114 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
@@ -152,7 +152,7 @@ public function testUrlInfoForNewEntity() {
}
/**
- * Tests the url() method.
+ * Tests the _url() method.
*
* @covers ::url()
*/