From 03f372f3f7dadac50e04ad81bd88ce4e11a682a1 Mon Sep 17 00:00:00 2001
From: webchick <drupal@webchick.net>
Date: Sun, 1 Feb 2015 10:23:26 -0800
Subject: [PATCH] Issue #2418109 by yched: Misleading param name in
 LinkWidget::getUserEnteredStringAsUri()

---
 .../src/Plugin/Field/FieldWidget/LinkWidget.php    | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
index 7d22f53f5290..0606f42b7bcc 100644
--- a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
+++ b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
@@ -65,21 +65,21 @@ protected static function getUriAsDisplayableString($uri) {
    *
    * Schemeless URIs are treated as 'user-path:' URIs.
    *
-   * @param string $uri
+   * @param string $string
    *   The user-entered string.
    *
    * @return string
-   *   The URI, if a non-empty $uri was passed.
+   *   The URI, if a non-empty $string was passed.
    */
-  protected static function getUserEnteredStringAsUri($uri) {
-    if (!empty($uri)) {
+  protected static function getUserEnteredStringAsUri($string) {
+    if (!empty($string)) {
       // Users can enter relative URLs, but we need a valid URI, so add an
       // explicit scheme when necessary.
-      if (parse_url($uri, PHP_URL_SCHEME) === NULL) {
-        $uri = 'user-path:' . $uri;
+      if (parse_url($string, PHP_URL_SCHEME) === NULL) {
+        return 'user-path:' . $string;
       }
     }
-    return $uri;
+    return $string;
   }
 
   /**
-- 
GitLab