- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
//Из библиотеки prototype
....
unescapeHTML: function() {
return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
}
....
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+160
//Из библиотеки prototype
....
unescapeHTML: function() {
return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
}
....
Смеяться надо из-за того, что замена & на & идёт первой, таким образом &lt замениться на <, а не на <
+159.1
$from = 'UTF-8';
$to = 'windows-1251';
if(!$decode) {
$from = $to;
$to = 'UTF-8';
}
Обмен переменными в обвеске для iconv, одной мало известной cms
+153.9
$basket=array('fk_user'=>$_SESSION['user']['pk_user'],
'fk_album'=>$pk_album,
'fk_song'=>$song['pk_song'],
'date'=>$time,
'title'=>str_replace('"', '\"', $album['title'].' - '.$song['name']),
'symlink'=>$r1[$k],
'filesize'=>$song['filesize'],
'track'=>$song['track'],
);
Очень правильный эскейп
+76
if(!doc.getElementsByTagName(TAG_NAME).equals(null)){
///...
}
+159
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>БД</title>
<link rel="stylesheet" type="text/css" href="/adminini/design20f.css">
</head>
<body>
<?php
switch ($curr_page_des)
{
//
// авторизация
case 'login':
?>
<?php print $content ?>
<?php
break;
//
// список разделов
case 'sections':
?>
<?php print $content ?>
<?php
break;
}
?>
</body>
</html>
Код не мой... надеюсь правила не запрещают..
Фаил для вывода контента..
design.php
+70.8
<center><b><font color="#CCCCCC">1. Статус и ответственность сторон соглашения:</b></center><br><center></font>
<UL>
1.1.
<br><br>1.1.1.
<br><br>1.1.2.
<br><br>1.1.3.
<br><br>1.1.4.
<br><br>1.1.5.
<br><br><br>1.2.
<br><br><br>1.2.1.
+135.1
this.txtGroupSubject.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
Виетнамский кастинг :)
+7
std::string s1;
std::string s2;
int ret = strcmp(s1.c_str(), s2.c_str()); //А здесь мы сравниваем строки
if (ret == 0)
{
....
}
+148
if(mysql_num_rows($records_sql)<1){
$_SESSION['site_msg']='no_user_found';
header('Location: customer_listing.php');
echo '<script type="text/javascript">';
echo 'window.location.href="customer_listing.php";';
echo '</script>';
echo '<noscript>';
echo '<meta http-equiv="refresh" content="0;url=customer_listing.php" />';
echo '</noscript>';
exit();
}
чтоб наверняка
+152.7
function handleServerResponse()
{
document.getElementById("guest").innerHTML = "<table width='100%'><tr><td align='center' valign='center'><p style='color:gray;text-align:center;'>" + xmlHttp.responseXML.documentElement.getElementsByTagName("ok").item(0).firstChild.data + "</p></td></tr></table>\n";
}
Обработка данных AJAX-ом.