Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Drupal\Core\Routing; use Drupal\Component\HttpFoundation\SecuredRedirect..

Decoded Output download

<?php

namespace Drupal\Core\Routing;

use Drupal\Component\HttpFoundation\SecuredRedirectResponse;
use Drupal\Core\Cache\CacheableResponseInterface;
use Drupal\Core\Cache\CacheableResponseTrait;
use Symfony\Component\HttpFoundation\RedirectResponse;

/**
 * Provides a common base class for cacheable safe redirects.
 */
abstract class CacheableSecuredRedirectResponse extends SecuredRedirectResponse implements CacheableResponseInterface {

  use CacheableResponseTrait;

  /**
   * {@inheritdoc}
   */
  protected function fromResponse(RedirectResponse $response) {
    parent::fromResponse($response);

    $metadata = $this->getCacheableMetadata();
    if ($response instanceof CacheableResponseInterface) {
      $metadata->addCacheableDependency($response->getCacheableMetadata());
    }
    else {
      $metadata->setCacheMaxAge(0);
    }
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Drupal\Core\Routing;

use Drupal\Component\HttpFoundation\SecuredRedirectResponse;
use Drupal\Core\Cache\CacheableResponseInterface;
use Drupal\Core\Cache\CacheableResponseTrait;
use Symfony\Component\HttpFoundation\RedirectResponse;

/**
 * Provides a common base class for cacheable safe redirects.
 */
abstract class CacheableSecuredRedirectResponse extends SecuredRedirectResponse implements CacheableResponseInterface {

  use CacheableResponseTrait;

  /**
   * {@inheritdoc}
   */
  protected function fromResponse(RedirectResponse $response) {
    parent::fromResponse($response);

    $metadata = $this->getCacheableMetadata();
    if ($response instanceof CacheableResponseInterface) {
      $metadata->addCacheableDependency($response->getCacheableMetadata());
    }
    else {
      $metadata->setCacheMaxAge(0);
    }
  }

}

Function Calls

None

Variables

None

Stats

MD5 e597794604a515dec4f9f5927520784b
Eval Count 0
Decode Time 91 ms