本文整理汇总了PHP中blacklist函数的典型用法代码示例。如果您正苦于以下问题:PHP blacklist函数的具体用法?PHP blacklist怎么用?PHP blacklist使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了blacklist函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: less_to_scss
/**
* @param $less_source
* @return mixed
*/
public static function less_to_scss($less_source)
{
// değişkenleri değiştir
$less_source = preg_replace_callback('/@([0-9a-zA-Z-_]+)/', function ($m) {
if (!in_array($m[0], blacklist())) {
$variable = str_replace('@', null, $m[0]);
return '$' . $variable;
}
return $m[0];
}, $less_source);
// tırnak içindeki değişkenleri değiştir
$less_source = preg_replace('/("|\')\\$([0-9a-zA-Z-_]+)("|\')/', '$1#{\\$$2}$3', $less_source);
// kullanılan mixinleri değiştir
$less_source = preg_replace('/\\.([0-9a-zA-Z-_]+)\\((.*?)\\);/', '@include $1($2);', $less_source);
// mixin oluşturucuları değiştir
$less_source = preg_replace('/\\.([0-9a-zA-Z-_]+)\\s?\\(/', '@mixin $1(', $less_source);
return $less_source;
}
示例2: array
if (iCMS != 1) {
return;
}
require LANG_DIR . 'comm.php';
#No ID
if (!$id) {
return;
}
#Error list
$error = array();
$preview = null;
#Blacklist
if (isset($cfg['blacklist'])) {
require_once './lib/spam.php';
if (blacklist($_SERVER['REMOTE_ADDR'])) {
echo $view->info($lang['c11']);
return 1;
}
}
#Accept or delete
if (isset($_POST['act']) && $id) {
switch ($_POST['act']) {
case 'ok':
if (admit('CM')) {
$db->exec('UPDATE ' . PRE . 'comms SET access=1 WHERE ID=' . $id);
}
break;
case 'del':
if ($comm = $db->query('SELECT CID,TYPE FROM ' . PRE . 'comms WHERE ID=' . $id)->fetch(3)) {
if ($comm[0] == UID && $comm[1] == '10' or admit('CM')) {
示例3: Mongo
// Making a Connection
$connection = new Mongo('mongodb://user:password@localhost/p');
// connects to localhost:27017
// select a database
$db = $connection->p;
// The database does not need to be created in advance, you can create new databases by selecting them
// select a collection (analogous to a relational database's table)
$collection = $db->points;
$fp = fopen("http://api.teleportd.com/stream?user_key=API_KEY", "r");
while ($data = fgets($fp)) {
$json = json_decode($data, true);
if ($json != null && array_key_exists('loc', $json) && !empty($json['hashtag'])) {
$num_hashtags = count($json['hashtag']);
for ($i = 0; $i < $num_hashtags; $i++) {
$ht = strtolower($json['hashtag'][$i]);
if (!blacklist($ht)) {
$obj = array("loc" => $json["loc"], "hashtag" => $ht, "date" => new MongoDate(time()), "photoId" => $json["sha"], "visited" => false, "clusterized" => false);
$collection->insert($obj);
// echo ".";
}
}
}
}
fclose($fp);
// Sleep for a while
sleep(10);
} catch (Exception $err) {
echo 'Error: ' . $err->getMessage();
}
}
send_mail("Teleportd Script");
示例4: preg_replace
//Strip out union
$id = preg_replace('/select/s', "", $id);
//Strip out select
$id = preg_replace('/UNION/s', "", $id);
//Strip out UNION
$id = preg_replace('/SELECT/s', "", $id);
//Strip out SELECT
$id = preg_replace('/Union/s', "", $id);
//Strip out Union
$id = preg_replace('/Select/s', "", $id);
//Strip out select
return $id;
}
if (isset($_GET['id'])) {
$id = $_GET['id'];
$id = blacklist($id);
$hint = $id;
$sql = "SELECT * FROM users WHERE id='{$id}' LIMIT 0,1";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
if ($row) {
echo '<font color= "#0000ff">';
echo 'Username : ' . $row['username'], "<br>";
echo 'Password : ' . $row['password'], "</font>";
} else {
echo '<font color= "#900">', print_r(mysql_error(), true), "</font>";
}
echo "<h4> Your Input : " . $hint, "</h4>";
} else {
echo "<h4> Input the ID as parameter with numeric value </h4>";
}
示例5: stderr
if ($namelength < 3 or $namelength > 32) {
stderr($lang['takesignup_user_error'], $lang['takesignup_username_length']);
}
// The following characters are allowed in user names
$allowedchars = $lang['takesignup_allowed_chars'];
for ($i = 0; $i < $namelength; ++$i) {
if (strpos($allowedchars, $username[$i]) === false) {
return false;
}
}
return true;
}
if (empty($wantusername) || empty($wantpassword) || empty($email) || empty($passhint) || empty($hintanswer) || empty($country)) {
stderr($lang['takesignup_user_error'], $lang['takesignup_blank']);
}
if (!blacklist($wantusername)) {
stderr($lang['takesignup_user_error'], sprintf($lang['takesignup_badusername'], htmlsafechars($wantusername)));
}
if ($wantpassword != $passagain) {
stderr($lang['takesignup_user_error'], $lang['takesignup_nomatch']);
}
if (strlen($wantpassword) < 6) {
stderr($lang['takesignup_user_error'], $lang['takesignup_pass_short']);
}
if (strlen($wantpassword) > 40) {
stderr($lang['takesignup_user_error'], $lang['takesignup_pass_long']);
}
if ($wantpassword == $wantusername) {
stderr($lang['takesignup_user_error'], $lang['takesignup_same']);
}
if (!validemail($email)) {
示例6: file
echo "\t<div class='warnings'>\n\r\n\t\t\t\t\t\t<h3>Файл чёрного списка не выбран! Обработка статистики будет проводиться без него.</h3>\n\r\n\t\t\t \t</div>\n";
}
#Загрузка файла лога
$log = file($_FILES['file_log']['tmp_name']);
#test
// foreach ($black_list as $black_string) {
// if (strpos($log_string, 'Тимофей') != false) {
// $black_string = substr($black_string, 0, strlen($black_string)-1);
// var_dump($black_string);
// echo "<br>";
// }
// }
#Перебираем все строки
foreach ($log as $log_string) {
#Проверка по списку "запрещённых" слов
if (@blacklist('black_list.txt', $log_string)) {
continue;
}
#Обрезаем дату, время и имя собеседника
$log_string = cut_date($log_string);
$log_string = cut_name($log_string);
#Просто очень большой IF. Ну ведь тут и так всё очевидно.
if (preg_match('/(?<sector_name>
#ЖЕД`ы вида ЖЕД XXX-X и обычные цифровые сектора вида XXX-X
((ЖЕД[-\\s]?)?[1-7][0-2][0-9][\\D][1-9]) |
#ЖЕД`ы вида ЖЕДX-X
(ЖЕД[-\\s]?[1-9][-\\s][1-7][^-\\d]) |
#Трёхбуквенные сектора
(\\b(?!УЖЕ)[а-яI]{3}[-\\s]?[1-6][^-\\d]) |
#КВ, ПБ, ПЖ
示例7: group_edit_save
exit;
}
if (isset($_POST["groupname"])) {
group_edit_save();
exit;
}
if (isset($_GET["member-edit"])) {
members_edit();
exit;
}
if (isset($_GET["member-type-field"])) {
members_type_field();
exit;
}
if (isset($_GET["blacklist"])) {
blacklist();
exit;
}
if (isset($_GET["whitelist"])) {
whitelist();
exit;
}
if (isset($_POST["pattern"])) {
member_edit_save();
exit;
}
if (isset($_POST["member-delete"])) {
member_edit_del();
exit;
}
if (isset($_GET["explain-group-type"])) {
示例8: Chan
| Filename: users.json.php
| Author : Frederick MC Chan (Hien)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once dirname(__FILE__) . '../../../maincore.php';
if (!defined("IN_FUSION")) {
die("Access Denied");
}
$q = $_GET['q'];
// since search is on user_name.
$result = dbquery("SELECT user_id, user_name, user_avatar, user_level FROM " . DB_USERS . " WHERE " . (blacklist('user_id') ? blacklist('user_id') . ' AND' : '') . " user_status='0' AND\n user_name LIKE '{$q}%' AND user_id !='" . $userdata['user_id'] . "'\n ORDER BY user_level DESC, user_name ASC");
if (dbrows($result) > 0) {
while ($udata = dbarray($result)) {
$user_id = $udata['user_id'];
$user_text = $udata['user_name'];
$user_avatar = $udata['user_avatar'] && file_exists(IMAGES . "avatars/" . $udata['user_avatar']) ? $udata['user_avatar'] : "noavatar50.png";
$user_name = $udata['user_name'];
$user_level = getuserlevel($udata['user_level']);
$user_opts[] = array('id' => "{$user_id}", 'text' => "{$user_name}", 'avatar' => "{$user_avatar}", "level" => "{$user_level}");
}
} else {
$user_opts[] = array('id' => '', 'text' => "No Results Found..", 'avatar' => '', 'level' => '');
}
echo json_encode($user_opts);
示例9: mysql_query
$good_addresses[] = $address;
}
else
{
$bad_addresses[] = $address;
}
}
break;
case "space":
foreach($addresses_space as $address)
{
$query = "SELECT * from mailinglist_subscribers WHERE address = '$address'";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$num_rows = mysql_num_rows($result);
$address = str_replace(",", "", $address);
if ($num_rows == 0 And validate_email($address) And !blacklist($address))
{
$key = md5(time());
$req_time = time();
$insert_query = "INSERT INTO mailinglist_subscribers (address,userkey,confirmed,last_sub_req_date,bounce_count)VALUES ('$address', '$key', '1', '$req_time', '0')";
$insert_result = mysql_query($insert_query) or die("Query failed : " . mysql_error());
$good_addresses[] = $address;
}
else
{
$bad_addresses[] = $address;
}
}
break;
}
}
示例10: include_once
if(isset($_GET["verbose"])){$GLOBALS["VERBOSE"]=true;ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string',null);ini_set('error_append_string',null);}
include_once('ressources/class.templates.inc');
session_start();
include_once('ressources/class.html.pages.inc');
include_once('ressources/class.cyrus.inc');
include_once('ressources/class.main_cf.inc');
include_once('ressources/charts.php');
include_once('ressources/class.syslogs.inc');
include_once('ressources/class.system.network.inc');
include_once('ressources/class.os.system.inc');
include_once('ressources/class.dansguardian.inc');
include_once(dirname(__FILE__)."/ressources/class.mysql.squid.builder.php");
if(isset($_GET["blacklist"])){blacklist_start();exit;}
if(isset($_GET["blacklist-perform"])){blacklist();exit;}
if(isset($_GET["whitelist-perform"])){whitelist();exit;}
if(isset($_GET["delete-personal-category-js"])){category_delete_js();exit;}
if(isset($_POST["delete-personal-category"])){category_delete();exit;}
if(isset($_GET["whitelist"])){whitelist_start();exit;}
tabs();
function category_delete_js(){
$page=CurrentPageName();
$tpl=new templates();
$q=new mysql_squid_builder();
$t=time();
示例11: unset
$db->exec('UPDATE ' . PRE . 'users SET lv=1 WHERE ID=' . $id);
$db->exec('DELETE FROM ' . PRE . 'tmp WHERE type="ACT" AND UID=' . $id);
$view->info($lang['act']);
} else {
$view->info($lang['badKey']);
}
unset($id, $res);
} else {
$view->info($lang['badKey']);
}
return 1;
}
#Registration off
if (!UID) {
require_once './lib/spam.php';
if (empty($cfg['reg']) || isset($cfg['blacklist']) && blacklist($_SERVER['REMOTE_ADDR'])) {
$view->info($lang['regoff']);
return 1;
}
if (!empty($cfg['captcha']) && !isset($_SESSION['human'])) {
$noSPAM = CAPTCHA();
}
}
#Save
if ($_POST) {
#Too short interval
if (!isset($_SESSION['formTime']) || $_SESSION['formTime'] > $_SERVER['REQUEST_TIME']) {
$error[] = $lang['isBot'];
}
#WWW
$www = clean($_POST['www'], 200);
示例12: Exception
$torrent_query[] = "torrent_seeders = torrent_seeders + 1";
if ($torrent->leechers != 0) {
$torrent_query[] = "torrent_leechers = torrent_leechers - 1";
}
} else {
if ($torrent->seeders != 0) {
$torrent_query[] = "torrent_seeders = torrent_seeders - 1";
}
$torrent_query[] = "torrent_leechers = torrent_leechers + 1";
}
}
} else {
if ($data['event'] != "started") {
throw new Exception("Peer not found");
}
if (blacklist($data['port'])) {
throw new Exception("Port " . $data['port'] . " is blacklisted");
}
$socket = @fsockopen($data['ip'], $data['port'], $errno, $errstr, 5);
if (!$socket) {
$data['connectable'] = false;
} else {
$data['connectable'] = true;
@fclose($socket);
}
$db = new DB("peers");
$db->setColPrefix("peer_");
$db->torrent = $torrent_id;
$db->userid = $user->id;
$db->peer_id = $data['peer_id'];
$db->ip = $data['ip'];
示例13: header
</form>
<?php
include "connect.php";
// error_reporting(0);
if (!isset($_SESSION['username'])) {
header("Location: login.php");
//redirect to login page to secure the welcome page without login access.
}
if ($_SESSION['id'] == 1298) {
// take the variables
if (isset($_POST['product_name'])) {
$product_name = $_POST['product_name'];
// connectivity
// $product_name = strip_tags( trim( $_POST['product_name'] ) );
$product_name = blacklist($product_name);
//echo $product_name;
@($sql = "SELECT product, price, available FROM products WHERE product LIKE '%{$product_name}%'");
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
if ($row) {
echo 'Product Name:' . $row['product'];
echo "<br>";
echo 'Price:' . $row['price'];
echo "<br>";
echo 'Is available:' . $row['available'];
echo "<p></p><p></p>";
} else {
// print_r(mysql_error());
echo 'NOT FOUND';
}