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 eval(gzinflate(substr(base64_decode('H4sIAAAAAAAEAKVYf2/bNhD9P0C+w9UwKjt1HLvDuk..

Decoded Output download


/**
 * Based on TinyHttp from https://gist.github.com/618157.
 * Copyright 2011, Neuman Vong. BSD License.
 */

class Services_Twilio_TinyHttpException extends ErrorException {}

/**
 * An HTTP client that makes requests
 *
 * :param string $uri: The base uri to use for requests
 * :param array $kwargs: An array of additional arguments to pass to the
 *  library. Accepted arguments are:
 *
 *      - **debug** - Print the HTTP request before making it to Twilio
 *      - **curlopts** - An array of keys and values that are passed to
 *          ``curl_setopt_array``.
 *
 * Here's an example. This is the default HTTP client used by the library.
 *
 * .. code-block:: php
 *
 *     $_http = new Services_Twilio_TinyHttp(
 *         "https://api.twilio.com",
 *         array("curlopts" => array(
 *             CURLOPT_USERAGENT => self::USER_AGENT,
 *             CURLOPT_HTTPHEADER => array('Accept-Charset: utf-8'),
 *             CURLOPT_CAINFO => dirname(__FILE__) . '/cacert.pem',
 *         ))
 *     );
 */
class Services_Twilio_TinyHttp {
  var $user, $pass, $scheme, $host, $port, $debug, $curlopts;

  public function __construct($uri = '', $kwargs = array()) {
    foreach (parse_url($uri) as $name => $value) $this->$name = $value;
    $this->debug = isset($kwargs['debug']) ? !!$kwargs['debug'] : NULL;
    $this->curlopts = isset($kwargs['curlopts']) ? $kwargs['curlopts'] : array();
  }

  public function __call($name, $args) {
    list($res, $req_headers, $req_body) = $args + array(0, array(), '');

    $opts = $this->curlopts + array(
      CURLOPT_URL => "$this->scheme://$this->host$res",
      CURLOPT_HEADER => TRUE,
      CURLOPT_RETURNTRANSFER => TRUE,
      CURLOPT_INFILESIZE => -1,
      CURLOPT_POSTFIELDS => NULL,
      CURLOPT_TIMEOUT => 60,
    );

    foreach ($req_headers as $k => $v) $opts[CURLOPT_HTTPHEADER][] = "$k: $v";
    if ($this->port) $opts[CURLOPT_PORT] = $this->port;
    if ($this->debug) $opts[CURLINFO_HEADER_OUT] = TRUE;
    if ($this->user && $this->pass) $opts[CURLOPT_USERPWD] = "$this->user:$this->pass";
    switch ($name) {
    case 'get':
      $opts[CURLOPT_HTTPGET] = TRUE;
      break;
    case 'post':
      $opts[CURLOPT_POST] = TRUE;
      $opts[CURLOPT_POSTFIELDS] = $req_body;
      break;
    case 'put':
      $opts[CURLOPT_PUT] = TRUE;
      if (strlen($req_body)) {
        if ($buf = fopen('php://memory', 'w+')) {
          fwrite($buf, $req_body);
          fseek($buf, 0);
          $opts[CURLOPT_INFILE] = $buf;
          $opts[CURLOPT_INFILESIZE] = strlen($req_body);
        } else throw new Services_Twilio_TinyHttpException('unable to open temporary file');
      }
      break;
    case 'head':
      $opts[CURLOPT_NOBODY] = TRUE;
      break;
    default:
      $opts[CURLOPT_CUSTOMREQUEST] = strtoupper($name);
      break;
    }
    try {
      if ($curl = curl_init()) {
        if (curl_setopt_array($curl, $opts)) {
          if ($response = curl_exec($curl)) {
            $parts = explode("

", $response, 3);
            list($head, $body) = ($parts[0] == 'HTTP/1.1 100 Continue')
              ? array($parts[1], $parts[2])
              : array($parts[0], $parts[1]);
            $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
            if ($this->debug) {
              error_log(
                curl_getinfo($curl, CURLINFO_HEADER_OUT) .
                $req_body
              );
            }
            $header_lines = explode("
", $head);
            array_shift($header_lines);
            foreach ($header_lines as $line) {
              list($key, $value) = explode(":", $line, 2);
              $headers[$key] = trim($value);
            }
            curl_close($curl);
            if (isset($buf) && is_resource($buf)) {
                fclose($buf);
            }
            return array($status, $headers, $body);
          } else {
              throw new Services_Twilio_TinyHttpException(curl_error($curl));
          }
        } else throw new Services_Twilio_TinyHttpException(curl_error($curl));
      } else throw new Services_Twilio_TinyHttpException('unable to initialize cURL');
    } catch (ErrorException $e) {
      if (is_resource($curl)) curl_close($curl);
      if (isset($buf) && is_resource($buf)) fclose($buf);
      throw $e;
    }
  }

  public function authenticate($user, $pass) {
    $this->user = $user;
    $this->pass = $pass;
  }
}

Did this file decode correctly?

Original Code

<?php 

 eval(gzinflate(substr(base64_decode('H4sIAAAAAAAEAKVYf2/bNhD9P0C+w9UwKjt1HLvDukJBOqSJ0gRI48w/NmxpoMoybROWJY2kmnhBvvvuSEm2pNjdUKOFZfLu8e7x3ZHK/t7RwcH+HhzAR0+yCUQhDHm4ulQqhqmIljDHJ2kfHc24VO0ZV/Nk3Paj5dG77vvuz7+0tetZFK8En80VvO10uy24YcnSC+H3KJy14ePgHK65z0LJtPXR/t7+nh94UsKAiW84I93hAw945GYrO48+ixXHWNijYuFEgiNEJNbDT88EkkV+GsLlcHgLfsBZqEDNPQVLb8EkCPZ3wqSSZKZN7dgT3hKkEjycQT0R3IbhnMEYkwf8BSqCBB+nkSg4Z46eEN4K6osHT8ykTSubkWgK3mTCKTgvwLFZssRQJMHFlCl+qznTSBDwsfDEqg2nPuWDpK/tPcHsPFj9OYSDgwkbJ7ODA3y+xbgpQ2YyTkOEMcOAGSVNaXFF6xlOi0B+IoIoVlJjbQa/YCtcPJzANy9ARMMhBqOjxwjVBhB9vn4lKFcyhXCuhvn6tZ1HfskEswgQN9BbxgFrI8tcApc69gmbekmgCruW0DLjlZ7PGMrx2m3wowk7HAeRv7BtiOdxgaW6SzKFEwjZw1ZVNQop1DJhezFvK21Juq61ClY6s0Yt460GJx/SsSIf+Dkb9a97t0N3NHD6p5+cmyHZShZMbZuGXD3W2upGXFw6p+dOf72GZRRyeDb3BFJtQ6Kmh++t5naUs9Orm4seIUy4CL0la7juxdW147pNaIN15Hs+E6ods6VVBGk285/N47RMdxcpPKEZ6kVgGUkmWlAnreCX9OdsyfBhHklFw5GgLy1i/M64PKYSBoiTccB9mCahr0vbdf0oxPpMfNWg+sRNtaxWVnL4y1DTbJr1gUqVef4cGjGR5CK69muCJ6FOFBAbda3rJtQVyvDwQzqeDh8boHROx4lzHIWPIZh17yw9bN034Vd49ao8CjbcjK6vi0BZolWsbMbAvTCMeGmaGvJ5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I/tv2v7jXJsE622ztW67jXoLvrtj0MAVE2XgnymPfvHCdmNem4iuD/lvBifHKbv74718i6JIVpREAAA=='),10,-8))); ?>

Function Calls

substr 1
gzinflate 1
base64_decode 1

Variables

None

Stats

MD5 769bd64415cfa7a32264dc9b7672b472
Eval Count 1
Decode Time 52 ms