<?php
class Timer {
var $startTime;
var $endTime;
function start() {
$this->startTime = gettimeofday();
}
function stop() {
$this->endTime = gettimeofday();
}
function elapsed() {
return (($this->endTime["sec"] - $this->startTime["sec"]) * 1000000 + ($this->endTime["usec"] - $this->startTime["usec"])) / 1000000;
}
}
$timer = new Timer();
$timer->start();
session_start();
include("../settings-data.php");
include("../lib.php");
checkPermissions($login, $password);
if (file_exists("../dictionary-data.php"))
include("../dictionary-data.php");
if (!isset($censor))
$censor = array();
if (!isset($word))
$word = "";
$word = str_replace(".","", $word);
$word = str_replace("+","", $word);
$word = str_replace("?","", $word);
$word = str_replace("\\","", $word);
$word = str_replace("\$","", $word);
$censoredWord = explode(",",$word);
for($i = 0; $i < sizeof($censoredWord); $i++)
{
$censoredWord[$i] = strtolower(translateHtml($censoredWord[$i], false));
}
$newCensor = array();
$newWord = "<?php\n";
$censoredWord = array_merge($censoredWord,$censor);
$censoredWord = array_values(array_unique($censoredWord));
for($i = 0; $i < sizeof($censoredWord); $i++)
{
if ($censoredWord[$i] != "")
{
$newWord .= "\t\$censor[] = \"".$censoredWord[$i]."\";\n";
}
}
$newWord .= "?>";
reWriteDataInFile ($newWord,"../dictionary-data.php");
$timer->stop();
Header("Location: censored.php?".$timer->elapsed());exit;
?>