Added striptags setting

This commit is contained in:
ivan 2017-09-29 21:13:22 +03:00
parent 6710a295d0
commit 8e3f90f6c0
3 changed files with 23 additions and 8 deletions

View File

@ -70,16 +70,29 @@ function AddEntry() {
global $GBlinkfield;
global $GBsubjectfield;
global $GBcategoryfield;
$NewEntry[name]=$_POST['name'];
if ($GBcityfield) $NewEntry[from]=$_POST['from']; else $NewEntry[from]="";
if ($GBlinkfield) $NewEntry[link]=$_POST['link']; else $NewEntry[link]="";
global $GBstriptags;
if (!$GBstriptags) $NewEntry[name]=$_POST['name'];
else $NewEntry[name]=strip_tags($_POST['name']);
if ($GBcityfield) {
if (!$GBstriptags) $NewEntry[from]=$_POST['from'];
else $NewEntry[from]=strip_tags($_POST['from']);
} else $NewEntry[from]="";
if ($GBlinkfield) {
if (!$GBstriptags) $NewEntry[link]=$_POST['link'];
else $NewEntry[link]=strip_tags($_POST['link']);
} else $NewEntry[link]="";
$NewEntry[email]=$_POST['email'];
if ($UploadedFile) $NewEntry[text]=$_POST['text']." <br><img src=\"$UploadedFile\">";
else $NewEntry[text]=$_POST['text'];
if (!$GBstriptags) $NewEntry[text]=$_POST['text'];
else $NewEntry[text]=strip_tags($_POST['text']);
if ($UploadedFile) $NewEntry[text]=$NewEntry[text]." <br><img src=\"$UploadedFile\">";
$NewEntry[datetime]=time();
$NewEntry[response]="";
if ($GBsubjectfield) $NewEntry[subj]=$_POST['subj']; else $NewEntry[subj]="";
if ($GBcategoryfield) $NewEntry[category]=$_POST['category']; else $NewEntry[category]="";
if ($GBsubjectfield) {
if (!$GBstriptags) $NewEntry[subj]=$_POST['subj'];
else $NewEntry[subj]=strip_tags($_POST['subj']);
} else $NewEntry[subj]="";
if ($GBcategoryfield) $NewEntry[category]=strip_tags($_POST['category']);
else $NewEntry[category]="";
$NewEntry[parameters]="";
$fhandle=fopen($GBdata,"a");
fputcsv($fhandle,$NewEntry);

View File

@ -13,7 +13,7 @@ $GBpassword="password";
$GBpagination=10; // pagination for entries, 0 - disabled
$GBreadmore=255; // number of symbols for 'Read More' feature, 0 - shows full entries
$GBsearch=true; // enable or disable search bar
$GBcaptcha=true; // enable or disable captcha
$GBcaptcha=false; // enable or disable captcha
$GBupload=true; // enable or disable upload image feature
$GBimagesize=1048576; // maximum image size
$GBnotificationmailto=""; // leave empty if you don't want send notification
@ -29,6 +29,7 @@ $GBcategoryfield=array(
3=>"Suppot",
4=>"Order",
5=>"Other");
$GBstriptags=true; // enable or disable strip tags function during adding new entry
$Titles[HeadTitle]="Guestbook";
$Titles[Page]="Guestbook";
$Titles[Name]="Your name";

View File

@ -30,6 +30,7 @@ $GBcategoryfield=array(
3=>"Suppot",
4=>"Order",
5=>"Other");
$GBstriptags=true; // включение или отключение функции обрезания тегов при добавлении новой записи
$Titles[HeadTitle]="Гостевая книга";
$Titles[Page]="Гостевая книга";
$Titles[Name]="Ваше имя";