- 1
include($b2bcontext_path."modules/"."costyl".".php");
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+170
include($b2bcontext_path."modules/"."costyl".".php");
Самое интересное - инклюд безусловный. Он просто есть. Костыль - он такой костыль...
+152
public function getObject()
{
$args = func_get_args();
if (empty($args)) {
$this->_throwException('wrong call of method - interface should be as 1st parameter');
}
$interface = array_shift($args);
$class = $this->getInjection($interface);
$argsCnt = count($args);
if ($argsCnt == 0) {
$object = new $class;
}
else if ($argsCnt == 1) {
$object = new $class($args[0]);
}
else if ($argsCnt == 2) {
$object = new $class($args[0], $args[1]);
}
else if ($argsCnt == 3) {
$object = new $class($args[0], $args[1], $args[2]);
}
else if ($argsCnt == 4) {
$object = new $class($args[0], $args[1], $args[2], $args[3]);
}
else if ($argsCnt == 5) {
$object = new $class($args[0], $args[1], $args[2], $args[3], $args[4]);
}
else if ($argsCnt == 6) {
$object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5]);
}
else if ($argsCnt == 7) {
$object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6]);
}
else if ($argsCnt == 8) {
$object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7]);
}
else if ($argsCnt == 9) {
$object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8]);
}
else if ($argsCnt == 10) {
$object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9]);
}
else if ($argsCnt == 11) {
$object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9], $args[10]);
}
else if ($argsCnt == 12) {
$object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9], $args[10], $args[11]);
}
else if ($argsCnt == 13) {
$object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9], $args[10], $args[11], $args[12]);
}
else if ($argsCnt == 14) {
$object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9], $args[10], $args[11], $args[12], $args[13]);
}
else if ($argsCnt == 15) {
$object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9], $args[10], $args[11], $args[12], $args[13], $args[14]);
}
else {
$this->_throwException('it looks like you use more than 15 arguments when trying to instantiate an object of class '.$class.' - that\'s ugly');
}
return $object;
}
+80
try {
...
} catch (Exception ex) {
wdComponentAPI.getMessageManager().reportException("ERROR", true);
}
Информативно так
+144
<span onmouseover="this.style.color='green'" onmouseout="this.style.color='black'">текст</span>
:hover для лохов
+160
<?php
function antihack(&$var){
if(is_array($var)) array_walk($var, 'antihack');
else $var = htmlspecialchars(stripslashes(mysql_real_escape_string($var)), ENT_QUOTES, 'UTF-8');
}
foreach(array('_SERVER', '_GET', '_POST', '_COOKIE', '_REQUEST') as $v){
if(!empty(${$v})) array_walk(${$v}, 'antihack');
}
?>
http://homephp.ru/phpcode/index.php?system=bild&stat=173445591-534250613&
+171
var e=("article,aside,footer,header,nav,section").split(',');
Найдено в дебрях одного сайта.
+156
<?php
if(isset($_GET["status"])) {
//Определяем переменные
$user_id = $_GET['user_id'];
$operator_id = $_GET['operator_id'];
$smsid = $_GET['smsid'];
$operator_id_str = $_GET['operator_id_str'];
$num = $_GET['num'];
$msg_trans = $_GET['msg_trans'];
$msg = $_GET['msg'];
$cost_rur = $_GET['cost_rur'];
$ratepoints = $cost_rur; //Рейтинг = стоимость смс
//Подключаемся к бд
$dblocation = "localhost"; // Имя сервера
$dbuser = "****"; // Имя пользователя
$dbpasswd = "******"; // Пароль
$dbname = "******"; //Имя бд
$dbcnx = @mysql_connect($dblocation,$dbuser,$dbpasswd);
if (!$dbcnx) {
echo("Не удалось установить соеденение");
exit();
} else {
if (!@mysql_select_db($dbname, $dbcnx)) {
echo "База данных недоступна <br />" ;
exit();
} else {
//Проверяем зарегестрирован ли пользователь
$changeuser = @mysql_query("SELECT * FROM jos_users WHERE username='$user_id'");
if(@mysql_num_rows($changeuser) > 0) {
//Пользователь зарегестрирован
@mysql_query("INSERT INTO sms (operator_id, operator_id_str, user_id, smsid, num, msg_trans, msg, cost_rur) VALUES ('$operator_id','$operator_id_str','$user_id','$smsid','$num','$msg_trans','$msg','$cost_rur')"); //Добавляем смс
@mysql_query("UPDATE jos_users SET rate = rate +1 WHERE username='$user_id'"); //Увеличиваем рейтинг
@mysql_query("UPDATE jos_users SET sms = sms +1 WHERE username='$user_id'"); //Увеличиваем кол-во смс
$rate = @mysql_fetch_array(@mysql_query("SELECT rate FROM jos_users WHERE username='$user_id'"));
echo "SMS Send OK rate +1 your rate: ".$rate['rate']."";
} else {
/*Пользователь не зарегестрирован,
Регестрируем пользователя*/
$regdate = date("Y-m-d H:i:s");
//Генерируем пароль
$pass = rand(10000, 99999);
$sqlpass = md5($pass);
//Добавляем пользователя
@mysql_query("INSERT INTO jos_users (name, username, password, usertype, gid, registerDate, lastvisitDate) VALUES ('$user_id', '$user_id', '$sqlpass', 'Registered', '18', '$regdate', '$regdate')");
$getnewuserid = @mysql_fetch_array(@mysql_query("SELECT id FROM jos_users WHERE username='$user_id'"));
@mysql_query("INSERT INTO jos_core_acl_aro (section_value, value, order_value, name, hidden) VALUES ('users', '{$getnewuserid['id']}', '0', '$user_id', '0')");
$getaro_id = @mysql_fetch_array(@mysql_query("SELECT id FROM jos_core_acl_aro WHERE name='$user_id'"));
@mysql_query("INSERT INTO jos_core_acl_groups_aro_map (group_id, aro_id) VALUES ('18', '{$getaro_id['id']}')");
@mysql_query("INSERT INTO sms (operator_id, operator_id_str, user_id, smsid, num, msg_trans, msg, cost_rur) VALUES ('$operator_id','$operator_id_str','$user_id','$smsid','$num','$msg_trans','$msg','$cost_rur')");
@mysql_query("UPDATE jos_users SET rate = rate +1 WHERE username='$user_id'");
@mysql_query("UPDATE jos_users SET sms = sms +1 WHERE username='$user_id'");
$rate = @mysql_fetch_array(@mysql_query("SELECT rate FROM jos_users WHERE username='$user_id'"));
echo "SMS Register complete. Login: ".$user_id." Pass: ".$pass." Your rate: ".$rate['rate']."";
}
}
}
}
?>
+154
public function assign($a, $b) {
parent::assign($a, $b);
}
Из того же проекта.
И все-таки хорошо, что программеры понимают ООП :-)
+187
if($query && !$query) {
$query = null;
}
Оо
−136
Если СтрФайлЗагрузки = Ложь Тогда
СтрФайлЗагрузки = ФайлЗагрузки;
Иначе
ФайлЗагрузки = СтрФайлЗагрузки;
КонецЕсли;