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 /* This script is adapted with permission from the export html plugin written by M..
Decoded Output download
?><?php
/*
This script is adapted with permission from the export html plugin written by Mandy Taylor ([email protected])
*/
?>
<?php
if( !function_exists( 'add_action' ) ) {
header('Status: 403 Forbidden');
header('HTTP/1.1 403 Forbidden');
exit;
}
if(!class_exists('CG_Sneaky_Html')) {
class CG_Sneaky_Html {
public function __construct() {
//register actions
$this->register_hooks();
}
function register_hooks(){
if(is_admin()){
add_action( 'post_submitbox_misc_actions', array(&$this,'html_export_link') );
add_action('admin_init', array(&$this, 'admin_init_plugin'));
add_action( 'admin_print_scripts', array(&$this, 'admin_enqueues'));
add_action('wp_ajax_save_html_file', array(&$this, 'save_html_file'));
add_action('admin_enqueue_scripts', array(&$this, 'ajaxurl'));
}
}
function html_export_link(){
global $post;
if(get_post_type($post) == 'presell-crusher'){
$posturl = get_permalink( $post->ID );
echo "<h3 style='margin:auto; text-align: center;'><a id='sneakyhtmlid' href=''>Export Survey to HTML</a></h3><iframe id='sneakyhtmliframe' width='1' height='1' src='".$posturl."'></iframe>";
echo "<iframe id='downloadhtmliframe' src='' width='1' height='1'></iframe>";
}
}
function admin_init_plugin(){
if(current_user_can('edit_posts')){
if($_GET['post'] && $_GET['action'] == 'edit'){
wp_register_script('sneakystatic', plugins_url('../js/sneakystatic.js', __FILE__), array('jquery') , '1.1', true);
if($_GET['htmlaction']=='downloadfile'){
$file=$_GET['filepath'];
$filedir = dirname(__FILE__).'/html_pages';
$filepath = $filedir.'/'.$file;
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename= " . $file);
header("Content-Transfer-Encoding: binary");
readfile($filepath);
exit();
}
}
}
}
function admin_enqueues(){
if($_GET['post'] && $_GET['action'] == 'edit'){
wp_print_scripts('sneakystatic');
}
}
function save_html_file(){
$htmlcontent = $_POST['htmlcontent'];
$posttitle = $_POST['posttitle'];
global $wpdb;
$posttitle = preg_replace("/[^a-zA-Z 0-9]+/", " ", $posttitle);
$posttitle = str_replace(' ','_',$posttitle);
$posttitle = strtolower($posttitle);
$posttitle = $posttitle.'_'.date('Y-m-d-His');
$filedir = dirname(__FILE__).'/html_pages';
$filename = $posttitle.".html";
$myFile = $filedir."/".$filename;
if ( !file_exists($filedir) ) {
mkdir($filedir);
chmod($filedir, 0755);
$fh = @fopen( $filedir.'/index.html', "w" );
@fclose( $fh );
}
$fh = fopen($myFile, 'w') or die("Can't open or create file. Are your permissions okay?");
//fix jquery link
$htmlcontent = str_replace('//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js','http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js',$htmlcontent);
$stringData = $htmlcontent;
$stringData = stripslashes($stringData);
fwrite($fh, $stringData);
fclose($fh);
echo "$filename";
die();
}
function ajaxurl() { echo '<script type="text/javascript"> var ajaxurl = "'.admin_url("admin-ajax.php").'"; </script>'; }
}
}
if(class_exists('CG_Sneaky_Html')) {
$cg_sneaky_html = new CG_Sneaky_Html();
}
?>
Did this file decode correctly?
Original Code
<?php
/*
This script is adapted with permission from the export html plugin written by Mandy Taylor ([email protected])
*/
eval("\x65\x76\x61\x6C\x28\x67\x7A\x69\x6E\x66\x6C\x61\x74\x65\x28\x62\x61\x73\x65\x36\x34\x5F\x64\x65\x63\x6F\x64\x65\x28'TVe3DsTIDf0XN7ahQjksXCmscs4SrlHOOevrveczYBcEMSQncvhIFmfS/+Nvf9wE/sdNEj8O/4j940aoHyd/MvrHPz/6/oj4S/enDYn9Nec/dsh/ZehfMvRnh/70OP8b/9eO+FP3f2OE+vvtFyi7hUlfQqF+E63V9vXcc4aRXytlr/2oGgC6ly8npnU5rXw8ZVxNBcYdjxAIGqGJYCwIaEMTA98S4ICDEReZGsq27GWgKmsGkE30/bSO8Zo6SIU1+Kr1ic8W+rkJDTCbF/yEqPg1URScHNMLSXTUVUT0eYD7tPAOq5cGb7BXXRcAWnaWIw0u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m/xzpwgDRa4PRSuxUNlsfRTTUJCCyhPPa0a2Xjr2WzTaqRA3wcNuA3GmHpMk/beUS886h4vGEYgGPM/d+RD+sT61afEQ8Gl6dLP0MCiGjdfphYbo246I66OaQ+bbOnQgNmMrxV83tS0Tn7QNyahR4qYd9PB/EQVliCvX5r9rkFsthJiKDzAdwmlAbJH5zomdKwrr2LyCQwrDN3Eh+Cpy2sBzIR33FtlJZMxz0ko+ShSewtrjDDnG6NqPFGYhQUZX+nsbT5pgmuJhuHqg2ZgDHWZfkE6btGPZEyn17s6dUjelYQVR6iN8w08ZTATC9cnRVDhghlvPAHibxWgVn0GYSb/OprbrfZywnSq1vwyhJgc5nOqbmz02VIvHdgQQLSeSY9t5ROhIMFH5rMfyLcFAjwadDQ4hXvXq8zPoJWMljn5r3xReVPznJrJzieXqBLca/MS//7rij//I5T52z//9W8='\x29\x29\x29\x3B");
?>
Function Calls
gzinflate | 13 |
ddwkvw29832 | 1 |
dvtknd29831 | 1 |
dzlene29833 | 1 |
base64_decode | 13 |
Stats
MD5 | 516e47f027979bd5ffece52653c1da13 |
Eval Count | 23 |
Decode Time | 154 ms |