本文整理汇总了PHP中check_hp函数的典型用法代码示例。如果您正苦于以下问题:PHP check_hp函数的具体用法?PHP check_hp怎么用?PHP check_hp使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_hp函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRefererURL
function getRefererURL()
{
global $config;
$request_uri = '';
if (check_hp($_SERVER['HTTP_REFERER'])) {
$url = parse_url($_SERVER['HTTP_REFERER']);
if (!empty($url['host']) && strpos($config['furl'], $url['host']) !== FALSE) {
$request_uri = $_SERVER['HTTP_REFERER'];
}
$request_uri = preg_replace('~(\\?|&)s=[A-Za-z0-9]*~i', '', $request_uri);
if (empty($url['path'])) {
$url['path'] = '';
}
$file = basename($url['path']);
if (!empty($loc) && file_exists($file) && $file != 'log.php') {
if (strpos($loc, '?') === false) {
$request_uri .= SID2URL_1;
} else {
$request_uri .= SID2URL_x;
}
}
return $request_uri;
} else {
return '';
}
}
示例2: createFeed
function createFeed() {
global $config;
$now = new FeedDate();
$this->descriptionTruncSize = 500;
$feed = '<?xml version="1.0" encoding="'.$this->encoding.'"?>'."\n";
$feed .= $this->_createGeneratorComment();
$feed .= '<klip>'."\n";
$feed .= ' <owner>'."\n";
$feed .= ' <author>'.$this->htmlspecialchars(FeedCreator::iTrunc($this->editor,100)).'</author>'."\n";
$feed .= ' <copyright>'.$this->htmlspecialchars(FeedCreator::iTrunc($this->copyright,100)).'</copyright>'."\n";
if (!empty($this->editorEmail)) {
$feed .= ' <email>'.$this->htmlspecialchars($this->editorEmail).'</email>'."\n";
}
$feed .= ' <web>'.$this->link.'</web>'."\n";
$feed .= ' </owner>'."\n";
$feed .= ' <identity>'."\n";
$feed .= ' <title>'.$this->htmlspecialchars(FeedCreator::iTrunc($this->title,100)).'</title>'."\n";
$feed .= ' <uniqueid>'.md5($config['cryptkey']).'</uniqueid>'."\n";
$feed .= ' <version>1.0</version>'."\n";
$feed .= ' <lastmodified>'.$this->htmlspecialchars($now->v0001()).'</lastmodified>'."\n";
$feed .= ' <description>'.$this->getDescription($this->encoding).'</description>'."\n";
$feed .= ' <keywords>Viscacha '.$this->htmlspecialchars($this->title).'</keywords>'."\n";
$feed .= ' </identity>'."\n";
$feed .= ' <locations>'."\n";
$feed .= ' <defaultlink>'.$this->link.'</defaultlink>'."\n";
$feed .= ' <contentsource>'.$config['furl'].'/external.php?action=KLIPFOOD</contentsource>'."\n";
$feed .= ' <kliplocation>'.$config['furl'].'/external.php?action=KLIPFOLIO</kliplocation>'."\n";
$feed .= ' </locations>'."\n";
$feed .= ' <setup>'."\n";
$feed .= ' <refresh>'.$this->htmlspecialchars($this->ttl).'</refresh>'."\n";
if (!check_hp($_SERVER['HTTP_REFERER'])) {
$_SERVER['HTTP_REFERER'] = $this->link;
}
$feed .= ' <referer>'.$this->htmlspecialchars($_SERVER['HTTP_REFERER']).'</referer>'."\n";
$feed .= ' <country>'.$this->language.'</country>'."\n";
$feed .= ' <language>'.$this->language.'</language>'."\n";
$feed .= ' </setup>'."\n";
$feed .= ' <messages>'."\n";
$feed .= ' <loading>Getting data...</loading>'."\n";
$feed .= ' <nodata>No items to display.</nodata>'."\n";
$feed .= ' </messages>'."\n";
$feed .= "</klip>\n";
return $feed;
}
示例3:
if (strxlen($query['name']) < $config['minnamelength']) {
$error[] = $lang->phrase('admin_member_too_less_chars');
}
if (strlen($query['email']) > 200) {
$error[] = $lang->phrase('admin_member_email_too_many_chars');
}
if ($user['mail'] != $_POST['email'] && double_udata('mail', $_POST['email']) == false) {
$error[] = $lang->phrase('email_already_used');
}
if (strxlen($query['signature']) > $config['maxsiglength']) {
$error[] = $lang->phrase('admin_member_signature_too_many_chars');
}
if (strlen($query['hp']) > 255) {
$error[] = $lang->phrase('admin_member_hp_too_many_chars');
}
if (!check_hp($query['hp'])) {
$query['hp'] = '';
}
if (strlen($query['location']) > 50) {
$error[] = $lang->phrase('admin_member_location_too_many_chars');
}
if ($query['gender'] != 'm' && $query['gender'] != 'w' && $query['gender'] != '') {
$error[] = $lang->phrase('admin_member_gender_not_valid');
}
if ($query['birthday'] > 31) {
$error[] = $lang->phrase('admin_member_day_not_valid');
}
if ($query['birthmonth'] > 12) {
$error[] = $lang->phrase('admin_member_month_not_valid');
}
if (($query['birthyear'] < gmdate('Y')-120 || $query['birthyear'] > gmdate('Y')) && $query['birthyear'] != 0 ) {
示例4: ok
$c->savedata();
ok('admin.php?action=settings&job=settings');
} elseif ($job == 'general') {
echo head();
// HTTP_HOST is having the correct browser url in most cases...
$server_name = !empty($_SERVER['HTTP_HOST']) ? strtolower($_SERVER['HTTP_HOST']) : (!empty($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
$https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
$source = !empty($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
if (!$source) {
$source = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
}
// Replace backslashes and doubled slashes (could happen on some proxy setups)
$source = str_replace(array('\\', '//', '/admin'), '/', $source);
$source = trim(trim(dirname($source)), '/');
$furl = $https . $server_name . '/' . $source;
if (!check_hp($furl)) {
$furl = $lang->phrase('admin_unable_to_analyze_url');
}
$fpath = str_replace('\\', '/', realpath('./'));
?>
<form name="form" method="post" action="admin.php?action=settings&job=general2">
<table class="border" border="0" cellspacing="0" cellpadding="4" align="center">
<tr>
<td class="obox" colspan="2"><?php
echo $lang->phrase('admin_general_forum_settings');
?>
</td>
</tr>
<tr>
<td class="mbox" width="50%"><?php
echo $lang->phrase('admin_page_name');
示例5: parse
//.........这里部分代码省略.........
$text = $this->ListWorkAround($text);
$text = preg_replace('/\\[note=([^\\]]+?)\\](.+?)\\[\\/note\\]/is', "\\1 (<i>\\2</i>)", $text);
$text = preg_replace("~\\[url\\]((telnet://|callto://|irc://|teamspeak://|http://|https://|ftp://|www.|mailto:|ed2k://|\\w+?.\\w{2,7})+:\\/\\/[a-z0-9;\\/\\?:@=\\&\$\\-_\\.\\+!\\*'\\(\\),\\~%#]+?)\\[\\/url\\]~is", "<a href=\"\\1\">\\1</a>", $text);
$text = preg_replace("~\\[url=((telnet://|callto://|irc://|teamspeak://|http://|https://|ftp://|www.|mailto:|ed2k://|\\w+?.\\w{2,7})[a-z0-9;\\/\\?:@=\\&\$\\-_\\.\\+!\\*'\\(\\),\\~%#]+?)\\](.+?)\\[\\/url\\]~is", "<a href=\"\\1\">\\3</a>", $text);
$text = empty($this->profile['disallow']['img']) ? preg_replace("/\\[img\\](([^?&=\\[\\]]+?)\\.(png|gif|bmp|jpg|jpe|jpeg))\\[\\/img\\]/is", "<img src=\"\\1\">", $text) : $text;
$text = preg_replace("/\\[img\\](.+?)\\[\\/img\\]/is", "<a href=\"\\1\">\\1</a>", $text);
// Correct incorrect urls
$text = preg_replace('/\\[color=\\#?([0-9A-F]{3,6})\\](.+?)\\[\\/color\\]/is', "<font color=\"#\\1\">\\2</font>", $text);
$text = preg_replace('/\\[align=(left|center|right|justify)\\](.+?)\\[\\/align\\]/is', "<p align=\"\\1\">\\2</p>", $text);
$text = preg_replace("/\\[email\\]([a-z0-9\\-_\\.\\+]+@[a-z0-9\\-]+\\.[a-z0-9\\-\\.]+?)\\[\\/email\\]/is", "<a href=\"mailto:\\1\">\\1</a>", $text);
$text = empty($this->profile['disallow']['h']) ? preg_replace_callback('/\\n?\\[h=(middle|small|large)\\](.+?)\\[\\/h\\]\\n?/is', array(&$this, 'cb_header'), $text) : $text;
$text = preg_replace_callback('/\\[size=(small|extended|large)\\](.+?)\\[\\/size\\]/is', array(&$this, 'cb_pdf_size'), $text);
while (preg_match('/\\[quote=(.+?)\\](.+?)\\[\\/quote\\]/is', $text)) {
$text = preg_replace('/\\[quote=(.+?)\\](.+?)\\[\\/quote\\]\\n?/is', "<br><b>" . $lang->phrase('bb_quote_by') . " \\1:</b><hr><i>\\2</i><hr>", $text);
}
while (preg_match('/\\[quote](.+?)\\[\\/quote\\]/is', $text)) {
$text = preg_replace('/\\[quote](.+?)\\[\\/quote\\]\\n?/is', "<br><b>" . $lang->phrase('bb_quote') . "</b><hr><i>\\1</cite></i><hr>", $text);
}
while (empty($this->profile['disallow']['edit']) && preg_match('/\\[edit\\](.+?)\\[\\/edit\\]/is', $text)) {
$text = preg_replace('/\\[edit\\](.+?)\\[\\/edit\\]\\n?/is', "<br><b>" . $lang->phrase('bb_edit_author') . "</b><hr>\\1<hr>", $text);
}
while (empty($this->profile['disallow']['edit']) && preg_match('/\\[edit=(.+?)\\](.+?)\\[\\/edit\\]/is', $text)) {
$text = preg_replace('/\\[edit=(.+?)\\](.+?)\\[\\/edit\\]\\n?/is', "<br><b>" . $lang->phrase('bb_edit_mod') . " \\1:</b><hr>\\2<hr>", $text);
}
while (empty($this->profile['disallow']['ot']) && preg_match('/\\[ot\\](.+?)\\[\\/ot\\]/is', $text)) {
$text = preg_replace('/\\[ot\\](.+?)\\[\\/ot\\]\\n?/is', "<br><b>" . $lang->phrase('bb_offtopic') . "</b><hr><span style=\"color: #999999\" size=\"7\">\\1</span><hr>", $text);
}
$text = preg_replace('/\\[b\\](.+?)\\[\\/b\\]/is', "<b>\\1</b>", $text);
$text = preg_replace('/\\[i\\](.+?)\\[\\/i\\]/is', "<i>\\1</i>", $text);
$text = preg_replace('/\\[u\\](.+?)\\[\\/u\\]/is', "<u>\\1</u>", $text);
$text = preg_replace('/\\[tt\\](.+?)\\[\\/tt\\]/is', "<tt>\\1</tt>", $text);
$text = preg_replace('/\\n?(\\[hr\\]){1,}\\n?/is', "<hr>", $text);
$text = preg_replace('/\\[sub\\](.+?)\\[\\/sub\\]/is', "<sub>\\1</sub>", $text);
$text = preg_replace('/\\[sup\\](.+?)\\[\\/sup\\]/is', "<sup>\\1</sup>", $text);
$text = preg_replace_callback('/\\[table(=(\\d+\\%;head|head;\\d+\\%|\\d+\\%|head))?\\]\\n*(.+?)\\n*\\[\\/table\\]\\n?/is', array(&$this, 'cb_pdf_table'), $text);
$text = str_ireplace('[tab]', "\t", $text);
$text = $this->tab2space($text);
$text = $this->parseSmileys($text);
} else {
$text = empty($this->profile['disallow']['code']) ? preg_replace_callback('/\\[code\\](.+?)\\[\\/code\\](\\n?)/is', array(&$this, 'cb_code'), $text) : $text;
$text = empty($this->profile['disallow']['code']) ? preg_replace_callback('/\\[code=(\\w+?)\\](.+?)\\[\\/code\\](\\n?)/is', array(&$this, 'cb_hlcode'), $text) : $text;
$text = $this->ListWorkAround($text);
$text = preg_replace_callback('/\\[note=([^\\]]+?)\\](.+?)\\[\\/note\\]/is', array(&$this, 'cb_note'), $text);
$text = preg_replace_callback("~\\[url\\]((telnet://|callto://|irc://|teamspeak://|http://|https://|ftp://|www.|mailto:|ed2k://|\\w+?.\\w{2,7})+:\\/\\/[a-z0-9;\\/\\?:@=\\&\$\\-_\\.\\+!\\*'\\(\\),\\~%#]+?)\\[\\/url\\]~is", array(&$this, 'cb_url'), $text);
$text = preg_replace_callback("~\\[url=((telnet://|callto://|irc://|teamspeak://|http://|https://|ftp://|www.|mailto:|ed2k://|\\w+?.\\w{2,7})[a-z0-9;\\/\\?:@=\\&\$\\-_\\.\\+!\\*'\\(\\),\\~%#]+?)\\](.+?)\\[\\/url\\]~is", array(&$this, 'cb_title_url'), $text);
$text = preg_replace_callback("~((et://|svn://|telnet://|callto://|irc://|teamspeak://|http://|https://|ftp://|ed2k://|www.)[a-zA-Z0-9\\-\\.@]+\\.[a-zA-Z0-9]{1,7}(:\\d*)?/?([a-zA-Z0-9\\-\\.:;_\\?\\,/\\\\+&%\$#\\=\\~]*)?([a-zA-Z0-9/\\\\+\\=\\?]{1}))([^\\'\"\\<\\>\\s\r\n\t]{0,8})~is", array(&$this, 'cb_auto_url'), $text);
$text = empty($this->profile['disallow']['img']) ? preg_replace("/\\[img\\](([^?&=\\[\\]]+?)\\.(png|gif|bmp|jpg|jpe|jpeg))\\[\\/img\\]/is", '<img src="\\1" alt=""' . iif($this->profile['resizeImg'] > 0, ' name="resize"') . ' />', $text) : $text;
$text = preg_replace("/\\[img\\](.+?)\\[\\/img\\]/is", '<a href="\\1" target="_blank">\\1</a>', $text);
// Correct incorrect urls
$text = preg_replace('/\\[color=\\#?([0-9A-F]{3,6})\\](.+?)\\[\\/color\\]/is', '<span style="color: #\\1">\\2</span>', $text);
$text = preg_replace('/\\[align=(left|center|right|justify)\\](.+?)\\[\\/align\\]/is', "<p style='text-align: \\1'>\\2</p>", $text);
$text = preg_replace_callback("/\\[email\\]([a-z0-9\\-_\\.\\+]+@[a-z0-9\\-]+\\.[a-z0-9\\-\\.]+?)\\[\\/email\\]/is", array(&$this, 'cb_mail'), $text);
$text = empty($this->profile['disallow']['h']) ? preg_replace_callback('/\\n?\\[h=(middle|small|large)\\](.+?)\\[\\/h\\]\\n?/is', array(&$this, 'cb_header'), $text) : $text;
$text = preg_replace_callback('/\\[size=(small|extended|large)\\](.+?)\\[\\/size\\]/is', array(&$this, 'cb_size'), $text);
while (preg_match('/\\[quote=(.+?)\\](.+?)\\[\\/quote\\]/is', $text, $values)) {
if (isset($values[1]) && check_hp($values[1])) {
$quote_html = '<a href="\\1" target="_blank">\\1</a>';
} else {
$quote_html = "\\1";
}
$text = preg_replace('/\\[quote=(.+?)\\](.+?)\\[\\/quote\\]\\n?/is', "<div class='bb_quote'><strong>" . $lang->phrase('bb_quote_by') . " {$quote_html}:</strong><br /><blockquote>\\2</blockquote></div>", $text);
}
while (preg_match('/\\[quote](.+?)\\[\\/quote\\]/is', $text)) {
$text = preg_replace('/\\[quote](.+?)\\[\\/quote\\]\\n?/is', "<div class='bb_quote'><strong>" . $lang->phrase('bb_quote') . "</strong><br /><blockquote>\\1</blockquote></div>", $text);
}
while (empty($this->profile['disallow']['edit']) && preg_match('/\\[edit\\](.+?)\\[\\/edit\\]/is', $text)) {
$text = preg_replace('/\\[edit\\](.+?)\\[\\/edit\\]\\n?/is', "<div class='bb_edit'><strong>" . $lang->phrase('bb_edit_author') . "</strong><br /><ins>\\1</ins></div>", $text);
}
while (empty($this->profile['disallow']['edit']) && preg_match('/\\[edit=(.+?)\\](.+?)\\[\\/edit\\]/is', $text)) {
$text = preg_replace('/\\[edit=(.+?)\\](.+?)\\[\\/edit\\]\\n?/is', "<div class='bb_edit'><strong>" . $lang->phrase('bb_edit_mod') . " \\1:</strong><br /><ins>\\2</ins></div>", $text);
}
while (empty($this->profile['disallow']['ot']) && preg_match('/\\[ot\\](.+?)\\[\\/ot\\]/is', $text)) {
$text = preg_replace('/\\[ot\\](.+?)\\[\\/ot\\]\\n?/is', "<div class='bb_ot'><strong>" . $lang->phrase('bb_offtopic') . "</strong><br /><span>\\1</span></div>", $text);
}
$text = preg_replace('/\\[b\\](.+?)\\[\\/b\\]/is', "<strong>\\1</strong>", $text);
$text = preg_replace('/\\[i\\](.+?)\\[\\/i\\]/is', "<em>\\1</em>", $text);
$text = preg_replace('/\\[u\\](.+?)\\[\\/u\\]/is', "<u>\\1</u>", $text);
$text = preg_replace('/\\[sub\\](.+?)\\[\\/sub\\]/is', "<sub>\\1</sub>", $text);
$text = preg_replace('/\\[sup\\](.+?)\\[\\/sup\\]/is', "<sup>\\1</sup>", $text);
$text = preg_replace('/\\n?(\\[hr\\]){1,}\\n?/is', "<hr />", $text);
$text = preg_replace('/\\[tt\\](.+?)\\[\\/tt\\]/is', "<tt>\\1</tt>", $text);
$text = preg_replace_callback('/\\[table(=(\\d+\\%;head|head;\\d+\\%|\\d+\\%|head))?\\]\\n*(.+?)\\n*\\[\\/table\\]\\n?/is', array(&$this, 'cb_table'), $text);
$text = str_ireplace('[tab]', "\t", $text);
$text = $this->tab2space($text);
$text = $this->parseSmileys($text);
$text = $this->wordwrap($text);
}
$text = str_ireplace('[reader]', $this->reader, $text);
$text = $this->customBB($text, $type);
$text = $this->parseDoc($text);
$text = $this->dict($text, $type);
$text = $this->replace($text);
$text = $this->nl2br($text, $type);
$text = $this->replacePID($text);
$text = $this->censor($text);
$text = $this->highlight($text);
$thiszm2 = benchmarktime();
$this->benchmark['bbcode'] += $thiszm2 - $thiszm1;
return $text;
}
示例6: array
${$string}[$key]['example'] = array();
foreach (${$string}[$key]['syntax'] as $syntax) {
${$string}[$key]['example'][] = str_replace('{param}', $lang->phrase('bbcodes_example_text'), str_replace('{option}', $lang->phrase('bbcodes_example_text2'), $syntax));
}
}
}
}
$breadcrumb->Add($lang->phrase('bbhelp_title'));
echo $tpl->parse("header");
echo $tpl->parse("menu");
($code = $plugins->load('misc_bbhelp_prepared')) ? eval($code) : null;
echo $tpl->parse("misc/bbhelp");
($code = $plugins->load('misc_bbhelp_end')) ? eval($code) : null;
} elseif ($_GET['action'] == "markasread") {
$my->p = $slog->Permissions();
if (check_hp($_SERVER['HTTP_REFERER'])) {
$url = parse_url($_SERVER['HTTP_REFERER']);
if (strpos($config['furl'], $url['host']) !== FALSE) {
$loc = htmlspecialchars($_SERVER['HTTP_REFERER']);
}
}
if (empty($loc)) {
$loc = 'javascript:history.back(-1);';
}
$slog->mark_read();
ok($lang->phrase('marked_as_read'), $loc);
} elseif ($_GET['action'] == "markforumasread") {
$board = $gpc->get('board', int);
$my->p = $slog->Permissions($board);
if (!is_id($board) || $my->p['forum'] == 0) {
errorLogin();
示例7:
if (strxlen($_POST['name']) > $config['maxnamelength'] && $config['changename_allowed'] == 1) {
$error[] = $lang->phrase('name_too_long');
}
if (strxlen($_POST['name']) < $config['minnamelength'] && $config['changename_allowed'] == 1) {
$error[] = $lang->phrase('name_too_short');
}
if (strxlen($_POST['email']) > 200) {
$error[] = $lang->phrase('email_too_long');
}
if (strxlen($_POST['signature']) > $config['maxsiglength']) {
$error[] = $lang->phrase('editprofile_signature_too_long');
}
if (strxlen($_POST['hp']) > 254) {
$error[] = $lang->phrase('editprofile_homepage_too_long');
}
if (!check_hp($_POST['hp'])) {
$_POST['hp'] = '';
}
if (strxlen($_POST['location']) > 50) {
$error[] = $lang->phrase('editprofile_location_too_short');
}
if ($_POST['gender'] != 'm' && $_POST['gender'] != 'w' && $_POST['gender'] != '') {
$error[] = $lang->phrase('editprofile_gender_incorrect');
}
if ($_POST['birthday'] > 31) {
$error[] = $lang->phrase('editprofile_birthday_incorrect');
}
if ($_POST['birthmonth'] > 12) {
$error[] = $lang->phrase('editprofile_birthmonth_incorrect');
}
if (($_POST['birthyear'] < gmdate('Y') - 120 || $_POST['birthyear'] > gmdate('Y')) && $_POST['birthyear'] != 0) {
示例8: msg_handler
//.........这里部分代码省略.........
margin-left: 15px;
padding: 2px;
font-family: Monospace;
list-style: none;
}
.lineone {
padding:0 5px;
margin:2px 0;
background:#F9F9F9;
}
.center {
text-align: center;
}
.linetwo {
padding:0 5px;
margin:2px 0;
background:#FCFCFC;
}
.mark {
padding:0 5px;
margin:2px 0;
background: #eedddd;
color: #880000;
font-weight: bold;
}
-->
</style>
</head>
<body>
<h1>General Error</h1>
<p class="center">
[<a href="<?php
echo $config['furl'];
?>
/index.php">Return to Index</a>]
<?php
if (check_hp($_SERVER['HTTP_REFERER'])) {
?>
[<a href="<?php
echo htmlspecialchars($_SERVER['HTTP_REFERER']);
?>
">Return to last Page</a>]
<?php
}
?>
</p>
<h3>Error Message</h3>
<p><strong><?php
echo $errortype[$errno];
?>
</strong>: <?php
echo $errtext;
?>
</p>
<h3>Error Details</h3>
<p>
File: <?php
echo $errfile;
?>
<br />
Line: <?php
echo $errline;
?>
<br />
Date: <?php
echo $errdate;
?>
<br />
</p>
<h3>Code Snippet</h3>
<?php
echo getErrorCodeSnippet($errfile, $errline);
?>
<h3>Backtrace</h3>
<?php
echo get_backtrace();
?>
<h3>Contact</h3>
<p>Please notify the board administrator: <a href="mailto:<?php
echo $config['forenmail'];
?>
"><?php
echo $config['forenmail'];
?>
</a></p>
<h3>Copyright</h3>
<p>
<strong><a href="http://www.viscacha.org" target="_blank">Viscacha <?php
echo $config['version'];
?>
</a></strong><br />
Copyright © by MaMo Net
</p>
</body>
</html>
<?php
exit;
break;
}
}
示例9: getRefererURL
function getRefererURL()
{
global $config;
$request_uri = '';
if (check_hp($_SERVER['HTTP_REFERER'])) {
$url = parse_url($_SERVER['HTTP_REFERER']);
if (!empty($url['query'])) {
parse_str($url['query'], $q);
if (!empty($q['action']) && substr($q['action'], -1) == '2') {
return '';
// When the last char of the value of action is 2 we have in most cases a "POST" form
}
}
if (!empty($url['host']) && strpos($config['furl'], $url['host']) !== FALSE) {
$request_uri = $_SERVER['HTTP_REFERER'];
}
$request_uri = preg_replace('~(\\?|&)s=[A-Za-z0-9]*~i', '', $request_uri);
if (empty($url['path'])) {
$url['path'] = '';
}
$file = basename($url['path']);
if (!empty($loc) && file_exists($file) && $file != 'log.php' && $file != 'register.php') {
if (strpos($loc, '?') === false) {
$request_uri .= SID2URL_1;
} else {
$request_uri .= SID2URL_x;
}
}
return $request_uri;
} else {
return '';
}
}
示例10: ok
ok('admin.php?action=cms&job=doc', $lang->phrase('admin_cms_documents_deleted'));
} else {
error('admin.php?action=cms&job=doc', $lang->phrase('admin_cms_havent_checked_box'));
}
} elseif ($job == 'doc_edit') {
echo head();
$tpl = new tpl();
$id = $gpc->get('id', int);
$types = doctypes();
$result = $db->query("SELECT * FROM {$db->pre}documents WHERE id = '{$id}'", __LINE__, __FILE__);
$row = $db->fetch_assoc($result);
if ($db->num_rows($result) == 0) {
error('admin.php?action=cms&job=doc', 'Keine gültige ID übergeben');
}
$format = $types[$row['type']];
if (!empty($row['file']) && $format['remote'] != 1 && !check_hp($row['file'])) {
$row['content'] = file_get_contents($row['file']);
}
$groups = $db->query("SELECT id, name FROM {$db->pre}groups", __LINE__, __FILE__);
$garr = explode(',', $row['groups']);
$memberdata_obj = $scache->load('memberdata');
$memberdata = $memberdata_obj->get();
?>
<form id="form" method="post" action="admin.php?action=cms&job=doc_edit2&id=<?php
echo $id;
?>
">
<table class="border" border="0" cellspacing="0" cellpadding="4" align="center">
<tr>
<td class="obox" colspan="4"><?php
echo $lang->phrase('admin_cms_create_doc_step_2');
示例11: parse
function parse($text, $type = 'html')
{
global $lang, $my;
$thiszm1 = benchmarktime();
$this->cache_bbcode();
$this->noparse = array();
$text = preg_replace("/(\r\n|\r|\n)/", "\n", $text);
if ($type == 'html' && (!empty($my->p['admin']) || $my->id > 0 && $my->id == $this->author)) {
$text = preg_replace('/\\n?\\[hide\\](.+?)\\[\\/hide\\]/is', '<br /><div class="bb_hide"><strong>' . $lang->phrase('bb_hidden_content') . '</strong><span>\\1</span></div>', $text);
} else {
$text = preg_replace('/\\[hide\\](.+?)\\[\\/hide\\]/is', '', $text);
}
if ($type == 'plain') {
$text = preg_replace("~\\[url={$this->url_regex2}\\](.+?)\\[\\/url\\]~is", "\\3 (\\1)", $text);
$search = array('[sub]', '[/sub]', '[sup]', '[/sup]', '[u]', '[/u]', '[b]', '[/b]', '[i]', '[/i]', '[email]', '[/email]', '[url]', '[/url]', '[img]', '[/img]', '[tt]', '[/tt]');
$text = str_ireplace($search, '', $text);
$text = empty($this->profile['disallow']['code']) ? preg_replace_callback('/\\[code(=\\w+?)?\\](.+?)\\[\\/code\\]/is', array(&$this, 'cb_plain_code'), $text) : $text;
while (empty($this->profile['disallow']['list']) && preg_match('/\\[list(?:=(a|A|I|i|OL|ol))?\\](.+?)\\[\\/list\\]/is', $text)) {
$text = preg_replace_callback('/\\[list(?:=(a|A|I|i|OL|ol))?\\](.+?)\\[\\/list\\]/is', array(&$this, 'cb_plain_list'), $text);
}
$text = preg_replace('/\\[note=([^\\]]+?)\\](.+?)\\[\\/note\\]/is', "\\1 (\\2)", $text);
$text = preg_replace('/\\[color=(\\#?[0-9A-F]{3,6})\\](.+?)\\[\\/color\\]/is', "\\2", $text);
$text = preg_replace('/\\[align=(left|center|right|justify)\\](.+?)\\[\\/align\\]/is', "\\2", $text);
$text = empty($this->profile['disallow']['h']) ? preg_replace('/\\n?\\[h=(middle|small|large)\\](.+?)\\[\\/h\\]\\n?/is', "\\2", $text) : $text;
$text = preg_replace('/\\[size=(small|extended|large)\\](.+?)\\[\\/size\\]/is', "\\2", $text);
while (preg_match('/\\[quote=(.+?)\\](.+?)\\[\\/quote\\]/is', $text)) {
$text = preg_replace('/\\[quote=(.+?)\\](.+?)\\[\\/quote\\]\\n?/is', "\n" . $lang->phrase('bb_quote_by') . " \\1:\n-------------------\n\\2\n-------------------\n", $text);
}
while (preg_match('/\\[quote](.+?)\\[\\/quote\\]/is', $text)) {
$text = preg_replace('/\\[quote](.+?)\\[\\/quote\\]\\n?/is', "\n" . $lang->phrase('bb_quote') . "\n-------------------\n\\1\n-------------------\n", $text);
}
while (empty($this->profile['disallow']['edit']) && preg_match('/\\[edit\\](.+?)\\[\\/edit\\]/is', $text)) {
$text = preg_replace('/\\[edit\\](.+?)\\[\\/edit\\]\\n?/is', "\n" . $lang->phrase('bb_edit_author') . "\n-------------------\n\\1\n-------------------\n", $text);
}
while (empty($this->profile['disallow']['edit']) && preg_match('/\\[edit=(.+?)\\](.+?)\\[\\/edit\\]/is', $text)) {
$text = preg_replace('/\\[edit=(.+?)\\](.+?)\\[\\/edit\\]\\n?/is', "\n" . $lang->phrase('bb_edit_mod') . " \\1:\n-------------------\n\\2\n-------------------\n", $text);
}
while (empty($this->profile['disallow']['ot']) && preg_match('/\\[ot\\](.+?)\\[\\/ot\\]/is', $text)) {
$text = preg_replace('/\\[ot\\](.+?)\\[\\/ot\\]\\n?/is', "\n" . $lang->phrase('bb_offtopic') . "\n-------------------\n\\1\n-------------------\n", $text);
}
$text = preg_replace('/\\[table(=[^\\]]+)?\\](.+?)\\[\\/table\\]\\n?/is', "\n", $text);
// ToDo: Plain Table
$text = preg_replace('/(\\[hr\\]){1,}/is', "\n-------------------\n", $text);
$text = str_ireplace('[tab]', "\t", $text);
$text = $this->customBB($text, $type);
} else {
$text = empty($this->profile['disallow']['code']) ? preg_replace_callback('/\\[code(=(\\w+?))?\\](.+?)\\[\\/code\\](\\n?)/is', array(&$this, 'cb_hlcode'), $text) : $text;
while (preg_match('/\\[quote=(.+?)\\](.+?)\\[\\/quote\\]/is', $text, $values)) {
$pid = $this->noparse_id();
if (check_hp($values[1])) {
$this->noparse[$pid] = '<a href="' . $values[1] . '" target="_blank">' . $values[1] . '</a>';
} else {
$this->noparse[$pid] = $values[1];
//"\\1";
}
$text = preg_replace('/\\[quote=(.+?)\\](.+?)\\[\\/quote\\]\\n?/is', "<div class='bb_quote'><strong>" . $lang->phrase('bb_quote_by') . " <!PID:{$pid}>:</strong><br /><blockquote>\\2</blockquote></div>", $text, 1);
}
$text = $this->ListWorkAround($text);
$text = preg_replace_callback('/\\[note=([^\\]]+?)\\](.+?)\\[\\/note\\]/is', array(&$this, 'cb_note'), $text);
$text = empty($this->profile['disallow']['img']) ? preg_replace_callback("~\\[img\\]([^?&=\\[\\]]+\\.(png|gif|bmp|jpg|jpe|jpeg))\\[\\/img\\]~is", array($this, 'cb_image'), $text) : $text;
$text = preg_replace_callback("~\\[img\\]{$this->url_regex2}\\[\\/img\\]~is", array(&$this, 'cb_plain_url'), $text);
// Correct invalid image urls
$text = preg_replace('/\\[color=\\#?([0-9A-F]{3,6})\\](.+?)\\[\\/color\\]/is', '<span style="color: #\\1">\\2</span>', $text);
$text = preg_replace('/\\[align=(left|center|right|justify)\\](.+?)\\[\\/align\\]/is', "<p style='text-align: \\1'>\\2</p>", $text);
$text = preg_replace_callback("/\\[email\\]([a-z0-9\\-_\\.\\+]+@[a-z0-9\\-]+\\.[a-z0-9\\-\\.]+?)\\[\\/email\\]/is", array(&$this, 'cb_mail'), $text);
$text = empty($this->profile['disallow']['h']) ? preg_replace_callback('/\\n?\\[h=(middle|small|large)\\](.+?)\\[\\/h\\]\\n?/is', array(&$this, 'cb_header'), $text) : $text;
$text = preg_replace_callback('/\\[size=(small|extended|large)\\](.+?)\\[\\/size\\]/is', array(&$this, 'cb_size'), $text);
while (preg_match('/\\[quote](.+?)\\[\\/quote\\]/is', $text)) {
$text = preg_replace('/\\[quote](.+?)\\[\\/quote\\]\\n?/is', "<div class='bb_quote'><strong>" . $lang->phrase('bb_quote') . "</strong><br /><blockquote>\\1</blockquote></div>", $text);
}
while (empty($this->profile['disallow']['edit']) && preg_match('/\\[edit\\](.+?)\\[\\/edit\\]/is', $text)) {
$text = preg_replace('/\\[edit\\](.+?)\\[\\/edit\\]\\n?/is', "<div class='bb_edit'><strong>" . $lang->phrase('bb_edit_author') . "</strong><br /><ins>\\1</ins></div>", $text);
}
while (empty($this->profile['disallow']['edit']) && preg_match('/\\[edit=(.+?)\\](.+?)\\[\\/edit\\]/is', $text)) {
$text = preg_replace('/\\[edit=(.+?)\\](.+?)\\[\\/edit\\]\\n?/is', "<div class='bb_edit'><strong>" . $lang->phrase('bb_edit_mod') . " \\1:</strong><br /><ins>\\2</ins></div>", $text);
}
while (empty($this->profile['disallow']['ot']) && preg_match('/\\[ot\\](.+?)\\[\\/ot\\]/is', $text)) {
$text = preg_replace('/\\[ot\\](.+?)\\[\\/ot\\]\\n?/is', "<div class='bb_ot'><strong>" . $lang->phrase('bb_offtopic') . "</strong><br /><span>\\1</span></div>", $text);
}
$text = preg_replace('/\\[b\\](.+?)\\[\\/b\\]/is', "<strong>\\1</strong>", $text);
$text = preg_replace('/\\[i\\](.+?)\\[\\/i\\]/is', "<em>\\1</em>", $text);
$text = preg_replace('/\\[u\\](.+?)\\[\\/u\\]/is', "<u>\\1</u>", $text);
$text = preg_replace('/\\[sub\\](.+?)\\[\\/sub\\]/is', "<sub>\\1</sub>", $text);
$text = preg_replace('/\\[sup\\](.+?)\\[\\/sup\\]/is', "<sup>\\1</sup>", $text);
$text = preg_replace('/\\n?(\\[hr\\]){1,}\\n?/is', "<hr />", $text);
$text = preg_replace('/\\[tt\\](.+?)\\[\\/tt\\]/is', "<tt>\\1</tt>", $text);
$text = preg_replace_callback("~\\[url\\]{$this->url_regex2}\\[\\/url\\]~is", array(&$this, 'cb_plain_url'), $text);
$text = preg_replace_callback("~\\[url={$this->url_regex2}\\](.+?)\\[\\/url\\]~is", array(&$this, 'cb_title_url'), $text);
$text = preg_replace_callback('/\\[table(=(\\d+\\%;head|head;\\d+\\%|\\d+\\%|head))?\\]\\n*(.+?)\\n*\\[\\/table\\]\\n?/is', array(&$this, 'cb_table'), $text);
// Old way of doing this, superseded by table bb code - $text = $this->tab2space($text);
$text = str_ireplace("\t", "[tab]", $text);
// Avoid conflicts with custom bb codes
// Apply custom bb codes
$text = $this->customBB($text, $type);
// BEFORE Auto URL Parsing
// Auto replace urls
$text = preg_replace_callback("~([\t\r\n \\(\\),\\.:;\\?!\\<>\\[\\]]|^){$this->url_regex}([\t\r\n \\(\\)\\[\\]<>]|\$)~is", array(&$this, 'cb_auto_url'), $text);
// Apply tabs finally
$text = str_ireplace('[tab]', " ", $text);
// One normal whitespace to avoid really long lines
//.........这里部分代码省略.........
示例12: msg_handler
/**
* Custom Error handler, call with trigger_error if required.
*/
function msg_handler($errno, $errtext, $errfile, $errline)
{
$replevel = error_reporting();
// If the @ error suppression operator was used, error_reporting is temporarily set to 0
if ($replevel == 0) {
return;
}
// This checks whether the error should be shown - according to what we set before with error_reporting()
if (($errno & $replevel) != $errno) {
return;
}
global $db, $config, $error_handler_history;
$errdate = date("Y-m-d H:i:s (T)");
$errortype = array(E_RECOVERABLE_ERROR => "PHP Error", E_WARNING => "PHP Warning", E_NOTICE => "PHP Notice", E_DEPRECATED => "PHP Deprecated", E_STRICT => "PHP Strict", E_USER_ERROR => "Viscacha Error", E_USER_WARNING => "Viscacha Warning", E_USER_NOTICE => "Viscacha Notice", E_USER_DEPRECATED => "Viscacha Deprecated");
log_handler($errno, $errtext, $errfile, $errline);
switch ($errno) {
case E_WARNING:
case E_NOTICE:
case E_USER_WARNING:
case E_USER_NOTICE:
echo "<br /><strong>{$errortype[$errno]}</strong>: {$errtext} (File: <tt>{$errfile}</tt> on line <tt>{$errline}</tt>)";
$error_handler_history[] = compact('errno', 'errtext', 'errfile', 'errline');
return true;
// Avoid PHP error handler
break;
case E_USER_ERROR:
case E_RECOVERABLE_ERROR:
if (isset($db) && is_a($db, 'DB_Driver')) {
$db->close();
}
while (ob_get_length() !== false) {
ob_end_clean();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>Viscacha <?php
echo $config['version'];
?>
» Error</title>
<style type="text/css">
<!--
body { color: #000; background-color: #fafafa; font-size: 12px; line-height: 130%; font-family: sans-serif; margin: auto 10%; border: 1px solid #aaa; }
p { margin: 0; padding: 2px 5px 2px 15px; }
a { color: #a80000; }
a:hover { color: #000; }
h1 { text-align: center; padding: 10px; margin: 0 0 20px 0; background-color: #eee; border-bottom: 1px solid #aaaaaa; }
h3 { padding: 0 5px; margin: 20px 0 7px 0; color: #a80000; border-bottom: 1px solid #eee; }
.code { background: #fff; border: 1px solid #ddd; margin: 2px 5px 2px 15px; padding: 2px; font-family: monospace; list-style: none; }
.lineone { padding: 0 5px; margin: 2px 0; background:#f9f9f9; }
.linetwo { padding: 0 5px; margin: 2px 0; background: #fcfcfc; }
.mark { padding: 0 5px; margin: 2px 0; background: #eedddd; color: #880000; font-weight: bold; }
.center { text-align: center; }
-->
</style>
</head>
<body>
<h1><?php
echo $errortype[$errno];
?>
</h1>
<p class="center">
[<a href="<?php
echo $config['furl'];
?>
/index.php">Return to Index</a>]
<?php
if (check_hp($_SERVER['HTTP_REFERER'])) {
?>
[<a href="<?php
echo htmlspecialchars($_SERVER['HTTP_REFERER']);
?>
">Return to last Page</a>]
<?php
}
?>
</p>
<h3>Error Message</h3>
<p><?php
echo $errtext;
?>
</p>
<h3>Error Details</h3>
<p>
<strong>File:</strong> <?php
echo $errfile;
?>
<br />
<strong>Line:</strong> <?php
echo $errline;
?>
<br />
<strong>Date:</strong> <?php
echo $errdate;
?>
//.........这里部分代码省略.........