Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / security_review / src / Checks / Field.php
index 5ca3067fae11977b0bc86f243af5b22a56682ae7..fa0e6e72ded630ac68b8715ba0f4a24490344bb2 100644 (file)
@@ -1,13 +1,7 @@
 <?php
 
-/**
- * @file
- * Contains \Drupal\security_review\Checks\Field.
- */
-
 namespace Drupal\security_review\Checks;
 
-use Drupal\Core\Entity\Entity;
 use Drupal\Core\Entity\FieldableEntityInterface;
 use Drupal\Core\TypedData\TypedDataInterface;
 use Drupal\security_review\Check;
@@ -138,9 +132,9 @@ class Field extends Check {
           ->load($entity_id);
 
         foreach ($fields as $field => $finding) {
-          $url = $entity->toUrl('edit-form')->toString();
+          $url = $entity->toUrl('edit-form');
           if ($url === NULL) {
-            $url = $entity->toUrl()->toString();
+            $url = $entity->toUrl();
           }
           $items[] = $this->t(
             '@vulnerabilities found in <em>@field</em> field of <a href=":url">@label</a>',
@@ -148,7 +142,7 @@ class Field extends Check {
               '@vulnerabilities' => implode(' and ', $finding),
               '@field' => $field,
               '@label' => $entity->label(),
-              ':url' => $url,
+              ':url' => $url->toString(),
             ]
           );
         }
@@ -179,9 +173,9 @@ class Field extends Check {
           ->load($entity_id);
 
         foreach ($fields as $field => $finding) {
-          $url = $entity->urlInfo('edit-form');
+          $url = $entity->toUrl('edit-form');
           if ($url === NULL) {
-            $url = $entity->url();
+            $url = $entity->toUrl();
           }
           $output .= "\t" . $this->t(
               '@vulnerabilities in @field of :link',