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('H4sIAAAAAAAEAKVY+2/aSBD+uZHyP0wRqiElPHq6Xk..

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(), '');

	  if (strpos($res, 'http') === 0) {
		  // We got handed a complete URL, just use it
		  $url = $res;
	  } else {
		  // Build from path and default scheme/host.
		  $url = "$this->scheme://$this->host$res";
	  }

    $opts = $this->curlopts + array(
      CURLOPT_URL => $url,
      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('H4sIAAAAAAAEAKVY+2/aSBD+uZHyP0wRqiElPHq6XkWUnvIgTaQ05HhcdZcix5gF9jC2b3fdhIvyv9/Mrm2wHeidilphdme+mfnmsevs7zUODvb34ABOHckmEPgw4P7qUqkQpiJYwhyfZLvRmHGp6jOu5tG47gbLxvvWh9bPv9S16lkQrgSfzRW8a7ZaNbhh0dLx4ffAn9XhtH8O19xlvmRaurG/t7/neo6U0GfiG+5Ie/DAPR7YieXOo8tCxdEX9qiYP5HQESIQ6+WnZwJJPD/x4XIwuAXX48xXoOaOgqWzYBIE+ztiUkkS06Lt0BHOEqQS3J9BORK8DYM5gzEGD/gLVAARPk4DkVFOFB0hnBWUFw+OmMk2WTYrwRScyYSTc46Ha7Noia5IggspUvxWc6aRwONj4YhVHU5cigdJX8s7grVTZ/XnEA4OJmwczQ4O8PkW/aYImYk4dhHGDB1mFDSFxRXZM5xmgdxIeEGopMbadH7BVmjcn8A3x0NEwyE6o71HD9UGEH3u7wnKlkwhnK1h7u/rqeeXTDCLADGBzjL0WB1Z5hK41L5P2NSJPJXJWkRmxiu9nzCU4tXr4AYTdjj2AnfRbkM4DzMslW0qUzgGnz1srapKJoRSUthOyOtKS1Jdl2oZKR1ZpZTwVoLjj/Falg/8nA17193bgT3sd3onnzo3A5KVzJu227Rk67XaVjXi4rJzct7prW1YpkIOz+aOQKrbEKnp4Qeruh3l7OTq5qJLCBMufGfJKrZ9cXXdse0q1MFquI7LhKqHbGllQarV9Gf1KG7T3U0KTyiG9SKwjSQTNShTreCXdOdsyfBhHkhFy4GgL13E+J1weUQtDBBGY4+7MI18V7e2bbuBj/0ZuapC/YlJtaxa0nL4y1BTrRr7QK3KHHcOlZBIshFd61XBkVAmCo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Mzass5n8YpTQDygutzLmOGDjp6eoEfUyb4PlRLL40bTrXJI9Kswbu8rTQWeUf61G34mrmsxDC7adDUu14gWVz4L2Q2vkXivKvSaceljeUeRMI1Q7XYK5qBGJQEdrsgmIqEn1SrqcRaGlPSNBmM9YUta/T/zFDT8VSVSctnTfzQgN4B/mPjnoYfdzz+DwMXOyQd9c841fXtIfcXi/JmrZlkbmQvHnXbi+C/pf/FXJsAy2xztG95oXAifPvGoYchIMrGW13q++aF69i8+GVfevRfO46NVvLugv/+BfHPa55nEgAA'),10,-8))); ?>

Function Calls

substr 1
gzinflate 1
base64_decode 1

Variables

None

Stats

MD5 a836f9a3f59858606c7ca167800c7f9d
Eval Count 1
Decode Time 61 ms