Commit f6015954 authored by catch's avatar catch
Browse files

Issue #3236284 by alexpott: Passing request headers to string functions causes...

Issue #3236284 by alexpott: Passing request headers to string functions causes deprecations in PHP 8.1
parent 8e56a527
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public function onResponse(ResponseEvent $event) {
    $response = $event->getResponse();

    // Only care about HTML responses.
    if (stripos($response->headers->get('Content-Type'), 'text/html') === FALSE) {
    if (stripos($response->headers->get('Content-Type', ''), 'text/html') === FALSE) {
      return;
    }

+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ public function onResponse(ResponseEvent $event) {
      // @see https://www.drupal.org/node/1009382
      // @see https://www.drupal.org/node/2339491
      // @see Drupal.ajax.prototype.beforeSend()
      $accept = $event->getRequest()->headers->get('accept');
      $accept = $event->getRequest()->headers->get('accept', '');

      if (strpos($accept, 'text/html') !== FALSE) {
        $response->headers->set('Content-Type', 'text/html; charset=utf-8');
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ class RssResponseRelativeUrlFilter implements EventSubscriberInterface {
   */
  public function onResponse(ResponseEvent $event) {
    // Only care about RSS responses.
    if (stripos($event->getResponse()->headers->get('Content-Type'), 'application/rss+xml') === FALSE) {
    if (stripos($event->getResponse()->headers->get('Content-Type', ''), 'application/rss+xml') === FALSE) {
      return;
    }

+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ public function setValidator(Validator $validator = NULL) {
   */
  public function onResponse(ResponseEvent $event) {
    $response = $event->getResponse();
    if (strpos($response->headers->get('Content-Type'), 'application/vnd.api+json') === FALSE) {
    if (strpos($response->headers->get('Content-Type', ''), 'application/vnd.api+json') === FALSE) {
      return;
    }