diff --git a/index.php b/index.php index d03df7b..bbfa49c 100644 --- a/index.php +++ b/index.php @@ -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']."
"; - else $NewEntry[text]=$_POST['text']; + if (!$GBstriptags) $NewEntry[text]=$_POST['text']; + else $NewEntry[text]=strip_tags($_POST['text']); + if ($UploadedFile) $NewEntry[text]=$NewEntry[text]."
"; $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); diff --git a/settings.php b/settings.php index c85e77b..98d805e 100644 --- a/settings.php +++ b/settings.php @@ -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"; diff --git a/settings_ru.php b/settings_ru.php index 0d32ac3..327b73c 100644 --- a/settings_ru.php +++ b/settings_ru.php @@ -30,6 +30,7 @@ $GBcategoryfield=array( 3=>"Suppot", 4=>"Order", 5=>"Other"); +$GBstriptags=true; // включение или отключение функции обрезания тегов при добавлении новой записи $Titles[HeadTitle]="Гостевая книга"; $Titles[Page]="Гостевая книга"; $Titles[Name]="Ваше имя";