<?
/*
PTK - DFLabs
Copyright (C) 2008 - DFLabs srl - All rights reserved
hide@address.com
*/
include("check_session.php");
include("check_session_image.php");
include("sanitize.php");
include("loggerClass.php");
if (isset($_SESSION['filter_token']) && strcmp($_SESSION['filter_token'],$_GET['tk']) == 0){
$arr = $_GET['arg1'];
$arr = preg_replace("/[^a-zA-Z0-9\|\,\-\:\ ]/", "", $arr);
$name = $_GET['arg2'];
$name = charset_decode_utf_8($name);
$name = preg_replace("/[^a-zA-Z0-9]/", "", $name);
$name = $name.".ptk";
if (file_exists("../filter/".$name)){
echo "<b style='color:red'>Warning, change filter name</b>";
}else{
$file = fopen("../filter/".$name, "w");
fwrite($file, $arr."\n");
fclose($file);
if (file_exists("../filter/".$name)) echo "<b style='color:green'>Ok, new filter created</b>";
}
}else{
new AuditLog('Unauthorized access to new_filter ');
header("location: goto_home.php");
}
?>