Remove cp1251. Я сильно недооценивал трудолюбие неизвестного кодера.
This commit is contained in:
@@ -57,13 +57,13 @@ if($addfr[0]<$addf){
|
||||
$canadd = 'onclick=\'findlogin2("Добавить в список", "main.php?friends", "friendadd", new Array("Друзья","Враги","Не в группе","Игнорирование"), new Array())\'';
|
||||
}else{$canadd = 'disabled';}
|
||||
if($_POST['sd4'] && $_POST['friendadd']){
|
||||
$_POST['friendadd']=htmlspecialchars($_POST['friendadd'],NULL,'cp1251');
|
||||
$_POST['friendadd']=htmlspecialchars($_POST['friendadd'],NULL);
|
||||
if(/*preg_match("/__/",$_POST['friendadd']) ||*/ preg_match("/--/",$_POST['friendadd'])){
|
||||
echo"<font color=red>Персонаж не найден.</font>";
|
||||
}else{
|
||||
$frd = mysql_fetch_array(mysql_query("SELECT `id`,`login` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['friendadd'])."' LIMIT 1;"));
|
||||
}
|
||||
$_POST['comment']=htmlspecialchars($_POST['comment'],NULL,'cp1251');
|
||||
$_POST['comment']=htmlspecialchars($_POST['comment'],NULL);
|
||||
$frd2 = mysql_fetch_array(mysql_query("SELECT enemy,friend,notinlist,ignor FROM `friends` WHERE `user` = '".mysql_real_escape_string($u->info['id'])."' and (`friend`='".mysql_real_escape_string($frd['id'])."' or `enemy`='".mysql_real_escape_string($frd['id'])."' or `notinlist`='".mysql_real_escape_string($frd['id'])."' or `ignor`='".mysql_real_escape_string($frd['id'])."') LIMIT 1;"));
|
||||
if(!$frd['id']){echo"<font color=red>Персонаж не найден.</font>";}
|
||||
elseif($frd['id']==$u->info['id']){echo"<font color=red>Себя добавить нельзя.</font>";}
|
||||
@@ -87,7 +87,7 @@ if($_POST['sd4'] && $_POST['friendadd']){
|
||||
}
|
||||
|
||||
if($_GET['friendremove']){
|
||||
$_GET['friendremove']=htmlspecialchars($_GET['friendremove'],NULL,'cp1251');
|
||||
$_GET['friendremove']=htmlspecialchars($_GET['friendremove'],NULL);
|
||||
if(preg_match("/__/",$_GET['friendremove']) || preg_match("/--/",$_GET['friendremove'])){
|
||||
echo"<font color=red>Персонаж не найден.</font>";
|
||||
}else{
|
||||
@@ -110,13 +110,13 @@ if($_GET['friendremove']){
|
||||
|
||||
|
||||
if($_POST['friendedit']){
|
||||
$_POST['friendedit']=htmlspecialchars($_POST['friendedit'],NULL,'cp1251');
|
||||
$_POST['friendedit']=htmlspecialchars($_POST['friendedit'],NULL);
|
||||
if(preg_match("/__/",$_POST['friendedit']) || preg_match("/--/",$_POST['friendedit'])){
|
||||
echo"<font color=red>Персонаж не найден.</font>";
|
||||
}else{
|
||||
$frd = mysql_fetch_array(mysql_query("SELECT id FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['friendedit'])."' LIMIT 1;"));
|
||||
}
|
||||
$_POST['comment']=htmlspecialchars($_POST['comment'],NULL,'cp1251');
|
||||
$_POST['comment']=htmlspecialchars($_POST['comment'],NULL);
|
||||
if(!$frd['id']){echo"<font color=red>Персонаж не найден.</font>";}
|
||||
elseif($frd['id']==$u->info['id']){echo"<font color=red>Себя отредактировать нельзя.</font>";}
|
||||
elseif(preg_match("/__/",$_POST['comment']) || preg_match("/--/",$_POST['comment'])){echo"<font color=red>Введен неверный текст.</font>";}
|
||||
|
||||
Reference in New Issue
Block a user