Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / http-kernel / Fragment / AbstractSurrogateFragmentRenderer.php
index 1968001a86b9864cbae644c61a48fbe5ea0079d4..a8dca41ba20c12319aaaf8c68878ab10a82dc8c7 100644 (file)
@@ -29,8 +29,6 @@ abstract class AbstractSurrogateFragmentRenderer extends RoutableFragmentRendere
     private $signer;
 
     /**
-     * Constructor.
-     *
      * The "fallback" strategy when surrogate is not available should always be an
      * instance of InlineFragmentRenderer.
      *
@@ -64,6 +62,10 @@ abstract class AbstractSurrogateFragmentRenderer extends RoutableFragmentRendere
     public function render($uri, Request $request, array $options = array())
     {
         if (!$this->surrogate || !$this->surrogate->hasSurrogateCapability($request)) {
+            if ($uri instanceof ControllerReference && $this->containsNonScalars($uri->attributes)) {
+                @trigger_error('Passing non-scalar values as part of URI attributes to the ESI and SSI rendering strategies is deprecated since Symfony 3.1, and will be removed in 4.0. Use a different rendering strategy or pass scalar values.', E_USER_DEPRECATED);
+            }
+
             return $this->inlineStrategy->render($uri, $request, $options);
         }
 
@@ -92,4 +94,17 @@ abstract class AbstractSurrogateFragmentRenderer extends RoutableFragmentRendere
 
         return substr($fragmentUri, strlen($request->getSchemeAndHttpHost()));
     }
+
+    private function containsNonScalars(array $values)
+    {
+        foreach ($values as $value) {
+            if (is_array($value)) {
+                return $this->containsNonScalars($value);
+            } elseif (!is_scalar($value) && null !== $value) {
+                return true;
+            }
+        }
+
+        return false;
+    }
 }