/* -------------------------------------------------------------------- Copyright (c) 2004 Daniel Pedemont (dan@pedemont.net) -------------------------------------------------------------------- */ global $oin_func_replace; $oin_func_replace = array( "header" => "sonic_www_php_header", "die" => "sonic_www_php_exit", "exit" => "sonic_www_php_exit", "setcookie" => "sonic_www_php_setcookie", "setrawcookie" => "sonic_www_php_setrawcookie", "session_start" => "sonic_www_php_session_start", ); global $pcode_plain; /* //test phpcode $pcode_plain =<<< EOF header("Howdy: Doody"); if ( ! ( setcookie (asdasdasdk")"asdasd;!@#) ) { die() } if (setcookie(asdasdasdk"),"asdasd;!@#) {} if (setcookie(asdasdasdk"))"asdasd;!@#) { die("omph") ; } else if (setcookie(asdasdasdk")"asdasd;!@#); exit("k baiz"); ?> EOF; */ $pcode_plain =<<< EOF EOF; function main() { global $pcode_plain, $oin_func_replace; // if ($pc_mode = $_REQUEST["pc_mode"]); else $pc_mode = "straight"; $pc_shift_funcs = $_REQUEST["pc_shift_funcs"]; $pc_shift_globs = $_REQUEST["pc_shift_globs"]; $pc_shift_space = $_REQUEST["pc_shift_space"]; $download = $_REQUEST["download"]; $pc_opts["mode"] = $pc_mode; $pc_opts["shift_funcs"] = $pc_shift_funcs; $pc_opts["shift_globs"] = $pc_shift_globs; $pc_opts["shift_space"] = $pc_shift_space; if ($_pc_txt = $_REQUEST["pc_txt"]) { // $pcode_plain = stripslashes($_pc_txt); $pcode_plain = $_pc_txt; } unset($_pc_txt); if ($pcf = $_FILES["pc_txt_file"]) { if ($pcf["error"]+0 == 0) $pcode_plain = file_get_contents($pcf["tmp_name"]); // unset($pcf); //need this below } $pcode_sonic = oldisnew($pcode_plain, $pc_opts); if ($download) { if ($d_file = $pcf["name"]) $d_file = "sonic.www.".$d_file; else $d_file = time().".txt"; if ($_SERVER["SONIC_WWW_SELF"]) { $_SERVER["SONIC_WWW_SELF"]->sonic_www_php_header('Content-Disposition: attachment; filename='.$d_file); $_SERVER["SONIC_WWW_SELF"]->sonic_www_php_header('Content-Type: application/x-octet-stream'); $_SERVER["SONIC_WWW_SELF"]->sonic_www_php_header('Content-Description: http://dev.pedemont.com/sonic/'); } else { header('Content-Disposition: attachment; filename='.$d_file); // header('Content-Type: application/octet-stream'); //run dont ask header('Content-Type: application/x-octet-stream'); header('Content-Description: http://dev.pedemont.com/sonic/'); } echo $pcode_sonic; } else echo "" .''."\n" .''."\n" ."
\n" ."