Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v0.9
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 45 lines (40 sloc) 1.27 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
<?php
include("common.php");

$name = stripslashes($_POST['name']);
$name = str_replace("\n","",$name);
$name = str_replace("\r\n","",$name);
$name = str_replace("\r","",$name);
$name = str_replace("~","",$name);
$description = stripslashes($_POST['description']);
$description = str_replace("\n","",$description);
$description = str_replace("\r\n","",$description);
$description = str_replace("\r","",$description);
$description = str_replace("~","",$description);
$description = substr($description,3,strlen($description)-7);

if (trim($name) == "")
{
header("Location: forumListEdit.php?forumId=".$_GET['forumId']."&error=1");
exit();
}
if (trim($description) == "")
{
header("Location: forumListEdit.php?forumId=".$_GET['forumId']."&error=2");
exit();
}

$fileC = file("db/forumList.dat",FILE_IGNORE_NEW_LINES);
$str = "";
foreach ($fileC as $statistic)
{
$temp = new Forum($statistic);
if ($temp->getForumId() == $_GET['forumId'])
{
$str .= $temp->getForumId()."~".$name."~".$description."~".$temp->getTotalTopics()."~".$temp->getTotalPosts()."\n";
}
else
{
$str .= $statistic."\n";
}
}
file_put_contents("db/forumList.dat",$str);

header("Location: index.php");
?>
Something went wrong with that request. Please try again.