";
}
echo "\n";
}
fclose($file);
if ($delete) {
fclose($tfile);
unlink($latestnews);
rename("$latestnews.tmp", $latestnews);
}
}
function clean($name, $max) {
# Turn tabs and CRs into spaces so they can't
# fake other fields or extra entries
#$name = preg_replace("[[:space:]]", ' ', $name);
# Escape < > and and & so they
# can't mess withour HTML markup
$name = str_replace('&', '&', $name);
$name = str_replace('<', '<', $name);
$name = str_replace('>', '>', $name);
# Don't allow excessively long entries
$news = substr($news, 0, $max);
# Undo PHP's "magic quotes" feature, which has
# inserted a \ in front of any " characters.
# We undo this because we're using a file, not a
# database, so we don't want " escaped. Those
# using databases should do the opposite:
# call addslashes if get_magic_quotes_gpc()
# returns false.
return $name;
}
function passwordField() {
global $admin;
global $password;
if (!$admin) {
return;
}
hiddenField('password', $password);
}
function hiddenField($news, $value) {
echo "";
}
?>