mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
- added confirmation to removing bbcodes
- added optional MX and DNSBL checks - added backtrace (triggering sql error) on error within sql_in_set as well as making sure it is handling an array - let users having f_list access to a forum actually see the forum without a topic list and not displaying an error message - this allows for giving people access to subforums but not the parent forum without the need to add the (sub-)forum to the index. - some additional bugfixes git-svn-id: file:///svn/phpbb/trunk@6414 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
67accdb072
commit
26befa0941
20 changed files with 415 additions and 177 deletions
|
@ -208,8 +208,20 @@ class acp_bbcodes
|
||||||
|
|
||||||
if ($row)
|
if ($row)
|
||||||
{
|
{
|
||||||
$db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id");
|
if (confirm_box(true))
|
||||||
add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']);
|
{
|
||||||
|
$db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id");
|
||||||
|
add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
|
||||||
|
'bbcode' => $bbcode_id,
|
||||||
|
'i' => $id,
|
||||||
|
'mode' => $mode,
|
||||||
|
'action' => $action))
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -300,6 +300,8 @@ class acp_board
|
||||||
'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true),
|
'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true),
|
||||||
'ip_check' => array('lang' => 'IP_VALID', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true),
|
'ip_check' => array('lang' => 'IP_VALID', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true),
|
||||||
'browser_check' => array('lang' => 'BROWSER_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'browser_check' => array('lang' => 'BROWSER_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
|
'check_dnsbl' => array('lang' => 'CHECK_DNSBL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
|
'email_check_mx' => array('lang' => 'EMAIL_CHECK_MX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
|
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
|
||||||
'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||||
'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||||
|
|
|
@ -238,7 +238,13 @@ class dbal
|
||||||
{
|
{
|
||||||
if (!sizeof($array))
|
if (!sizeof($array))
|
||||||
{
|
{
|
||||||
trigger_error('No values specified for SQL IN comparison', E_USER_ERROR);
|
// Not optimal, but at least the backtrace should help in identifying where the problem lies.
|
||||||
|
$this->sql_error('No values specified for SQL IN comparison');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_array($array))
|
||||||
|
{
|
||||||
|
$array = array($array);
|
||||||
}
|
}
|
||||||
|
|
||||||
$values = array();
|
$values = array();
|
||||||
|
|
|
@ -2705,6 +2705,52 @@ function truncate_string($string, $max_length = 60)
|
||||||
return implode('', array_slice($chars, 0, $max_length));
|
return implode('', array_slice($chars, 0, $max_length));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper for php's checkdnsrr function
|
||||||
|
* The windows failover is from this page: http://www.zend.com/codex.php?id=370&single=1
|
||||||
|
* Please make sure to check the return value for === true and === false, since NULL could
|
||||||
|
* be returned too.
|
||||||
|
*
|
||||||
|
* @return true if entry found, false if not, NULL if this function is not supported by this environment
|
||||||
|
*/
|
||||||
|
function phpbb_checkdnsrr($host, $type = '')
|
||||||
|
{
|
||||||
|
$type = (!$type) ? 'MX' : $type;
|
||||||
|
|
||||||
|
if (strpos(PHP_OS, 'WIN') !== false)
|
||||||
|
{
|
||||||
|
if (!function_exists('exec'))
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host), $output);
|
||||||
|
|
||||||
|
foreach ($output as $line)
|
||||||
|
{
|
||||||
|
if (!trim($line))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Valid records begin with host name:
|
||||||
|
if (strpos($line, $host) === 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (function_exists('checkdnsrr'))
|
||||||
|
{
|
||||||
|
return (checkdnsrr($domain, $type)) ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Handler, header and footer
|
// Handler, header and footer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2777,7 +2823,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||||
|
|
||||||
if (!empty($config['board_contact']))
|
if (!empty($config['board_contact']))
|
||||||
{
|
{
|
||||||
echo ' <p>Please notify the board administrator or webmaster : <a href="mailto:' . $config['board_contact'] . '">' . $config['board_contact'] . '</a></p>';
|
echo ' <p>Please notify the board administrator or webmaster: <a href="mailto:' . $config['board_contact'] . '">' . $config['board_contact'] . '</a></p>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo ' </div>';
|
echo ' </div>';
|
||||||
|
|
|
@ -1414,7 +1414,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||||
'post_subject' => $subject,
|
'post_subject' => $subject,
|
||||||
'post_text' => $data['message'],
|
'post_text' => $data['message'],
|
||||||
'post_checksum' => $data['message_md5'],
|
'post_checksum' => $data['message_md5'],
|
||||||
'post_attachment' => (sizeof($data['attachment_data'])) ? 1 : 0,
|
'post_attachment' => (!empty($data['attachment_data'])) ? 1 : 0,
|
||||||
'bbcode_bitfield' => $data['bbcode_bitfield'],
|
'bbcode_bitfield' => $data['bbcode_bitfield'],
|
||||||
'bbcode_uid' => $data['bbcode_uid'],
|
'bbcode_uid' => $data['bbcode_uid'],
|
||||||
'post_postcount' => ($auth->acl_get('f_postcount', $data['forum_id'])) ? 1 : 0,
|
'post_postcount' => ($auth->acl_get('f_postcount', $data['forum_id'])) ? 1 : 0,
|
||||||
|
@ -1467,7 +1467,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||||
'post_edit_reason' => $data['post_edit_reason'],
|
'post_edit_reason' => $data['post_edit_reason'],
|
||||||
'post_edit_user' => (int) $data['post_edit_user'],
|
'post_edit_user' => (int) $data['post_edit_user'],
|
||||||
'post_checksum' => $data['message_md5'],
|
'post_checksum' => $data['message_md5'],
|
||||||
'post_attachment' => (sizeof($data['attachment_data'])) ? 1 : 0,
|
'post_attachment' => (!empty($data['attachment_data'])) ? 1 : 0,
|
||||||
'bbcode_bitfield' => $data['bbcode_bitfield'],
|
'bbcode_bitfield' => $data['bbcode_bitfield'],
|
||||||
'bbcode_uid' => $data['bbcode_uid'],
|
'bbcode_uid' => $data['bbcode_uid'],
|
||||||
'post_edit_locked' => $data['post_edit_locked'])
|
'post_edit_locked' => $data['post_edit_locked'])
|
||||||
|
@ -1496,7 +1496,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||||
'topic_first_poster_colour' => (($user->data['user_id'] != ANONYMOUS) ? $user->data['user_colour'] : ''),
|
'topic_first_poster_colour' => (($user->data['user_id'] != ANONYMOUS) ? $user->data['user_colour'] : ''),
|
||||||
'topic_type' => $topic_type,
|
'topic_type' => $topic_type,
|
||||||
'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0,
|
'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0,
|
||||||
'topic_attachment' => (sizeof($data['attachment_data'])) ? 1 : 0,
|
'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($poll['poll_options']) && !empty($poll['poll_options']))
|
if (isset($poll['poll_options']) && !empty($poll['poll_options']))
|
||||||
|
@ -1549,7 +1549,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||||
'poll_length' => (isset($poll['poll_options'])) ? ($poll['poll_length'] * 86400) : 0,
|
'poll_length' => (isset($poll['poll_options'])) ? ($poll['poll_length'] * 86400) : 0,
|
||||||
'poll_vote_change' => (isset($poll['poll_vote_change'])) ? $poll['poll_vote_change'] : 0,
|
'poll_vote_change' => (isset($poll['poll_vote_change'])) ? $poll['poll_vote_change'] : 0,
|
||||||
|
|
||||||
'topic_attachment' => (sizeof($data['attachment_data'])) ? 1 : (isset($data['topic_attachment']) ? $data['topic_attachment'] : 0),
|
'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : (isset($data['topic_attachment']) ? $data['topic_attachment'] : 0),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1737,7 +1737,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||||
}
|
}
|
||||||
|
|
||||||
// Submit Attachments
|
// Submit Attachments
|
||||||
if (sizeof($data['attachment_data']) && $data['post_id'] && in_array($mode, array('post', 'reply', 'quote', 'edit')))
|
if (!empty($data['attachment_data']) && $data['post_id'] && in_array($mode, array('post', 'reply', 'quote', 'edit')))
|
||||||
{
|
{
|
||||||
$space_taken = $files_added = 0;
|
$space_taken = $files_added = 0;
|
||||||
$orphan_rows = array();
|
$orphan_rows = array();
|
||||||
|
|
|
@ -1322,7 +1322,7 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr
|
||||||
'enable_sig' => $data['enable_sig'],
|
'enable_sig' => $data['enable_sig'],
|
||||||
'message_subject' => $subject,
|
'message_subject' => $subject,
|
||||||
'message_text' => $data['message'],
|
'message_text' => $data['message'],
|
||||||
'message_attachment'=> (sizeof($data['attachment_data'])) ? 1 : 0,
|
'message_attachment'=> (!empty($data['attachment_data'])) ? 1 : 0,
|
||||||
'bbcode_bitfield' => $data['bbcode_bitfield'],
|
'bbcode_bitfield' => $data['bbcode_bitfield'],
|
||||||
'bbcode_uid' => $data['bbcode_uid'],
|
'bbcode_uid' => $data['bbcode_uid'],
|
||||||
'to_address' => implode(':', $to),
|
'to_address' => implode(':', $to),
|
||||||
|
@ -1340,7 +1340,7 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr
|
||||||
'enable_sig' => $data['enable_sig'],
|
'enable_sig' => $data['enable_sig'],
|
||||||
'message_subject' => $subject,
|
'message_subject' => $subject,
|
||||||
'message_text' => $data['message'],
|
'message_text' => $data['message'],
|
||||||
'message_attachment'=> (sizeof($data['attachment_data'])) ? 1 : 0,
|
'message_attachment'=> (!empty($data['attachment_data'])) ? 1 : 0,
|
||||||
'bbcode_bitfield' => $data['bbcode_bitfield'],
|
'bbcode_bitfield' => $data['bbcode_bitfield'],
|
||||||
'bbcode_uid' => $data['bbcode_uid']
|
'bbcode_uid' => $data['bbcode_uid']
|
||||||
);
|
);
|
||||||
|
|
|
@ -468,8 +468,10 @@ class template_compile
|
||||||
}
|
}
|
||||||
else if (preg_match('#^\.(([a-z0-9\-_]+\.?)+)$#s', $token, $varrefs))
|
else if (preg_match('#^\.(([a-z0-9\-_]+\.?)+)$#s', $token, $varrefs))
|
||||||
{
|
{
|
||||||
|
// Allow checking if loops are set with .loopname
|
||||||
|
// It is also possible to check the loop count by doing <!-- IF .loopname > 1 --> for example
|
||||||
$_tok = $this->generate_block_data_ref($varrefs[1], false);
|
$_tok = $this->generate_block_data_ref($varrefs[1], false);
|
||||||
$token = "(isset($_tok) && sizeof($_tok))";
|
$token = "sizeof($_tok)";
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -138,7 +138,7 @@ class filespec
|
||||||
/**
|
/**
|
||||||
* Check if the file got correctly uploaded
|
* Check if the file got correctly uploaded
|
||||||
*
|
*
|
||||||
* @return true if it is a valid upload and the file exist, false if not
|
* @return true if it is a valid upload, false if not
|
||||||
*/
|
*/
|
||||||
function is_uploaded()
|
function is_uploaded()
|
||||||
{
|
{
|
||||||
|
@ -147,7 +147,12 @@ class filespec
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (file_exists($this->filename)) ? true : false;
|
if ($this->local && !file_exists($this->filename))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1216,6 +1216,18 @@ function validate_email($email)
|
||||||
return 'EMAIL_INVALID';
|
return 'EMAIL_INVALID';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check MX record.
|
||||||
|
// The idea for this is from reading the UseBB blog/announcement. :)
|
||||||
|
if ($config['email_check_mx'])
|
||||||
|
{
|
||||||
|
list(, $domain) = explode('@', $email);
|
||||||
|
|
||||||
|
if (phpbb_checkdnsrr($domain, 'MX') === false)
|
||||||
|
{
|
||||||
|
return 'DOMAIN_NO_MX_RECORD';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($user->check_ban(false, false, $email, true) == true)
|
if ($user->check_ban(false, false, $email, true) == true)
|
||||||
{
|
{
|
||||||
return 'EMAIL_BANNED';
|
return 'EMAIL_BANNED';
|
||||||
|
|
|
@ -846,6 +846,45 @@ class session
|
||||||
return ($banned) ? true : false;
|
return ($banned) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if ip is blacklisted
|
||||||
|
* This should be called only where absolutly necessary
|
||||||
|
*
|
||||||
|
* Only IPv4 (rbldns does not support AAAA records/IPv6 lookups)
|
||||||
|
*
|
||||||
|
* @author satmd (from the php manual)
|
||||||
|
* @return false if ip is not blacklisted, else an array([checked server], [lookup])
|
||||||
|
*/
|
||||||
|
function check_dnsbl($ip = false)
|
||||||
|
{
|
||||||
|
if ($ip === false)
|
||||||
|
{
|
||||||
|
$ip = $this->ip;
|
||||||
|
}
|
||||||
|
|
||||||
|
$dnsbl_check = array(
|
||||||
|
'bl.spamcop.net' => 'http://spamcop.net/bl.shtml?',
|
||||||
|
'list.dsbl.org' => 'http://dsbl.org/listing?',
|
||||||
|
'sbl-xbl.spamhaus.org' => 'http://www.spamhaus.org/query/bl?ip=',
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($ip)
|
||||||
|
{
|
||||||
|
$quads = explode('.', $ip);
|
||||||
|
$reverse_ip = $quads[3] . '.' . $quads[2] . '.' . $quads[1] . '.' . $quads[0];
|
||||||
|
|
||||||
|
foreach ($dnsbl_check as $dnsbl => $lookup)
|
||||||
|
{
|
||||||
|
if (phpbb_checkdnsrr($reverse_ip . '.' . $dnsbl . '.', 'A') === true)
|
||||||
|
{
|
||||||
|
return array($dnsbl, $lookup . $ip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/Update a persistent login key
|
* Set/Update a persistent login key
|
||||||
*
|
*
|
||||||
|
|
|
@ -146,6 +146,15 @@ class ucp_register
|
||||||
// Replace "error" strings with their real, localised form
|
// Replace "error" strings with their real, localised form
|
||||||
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
|
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
|
||||||
|
|
||||||
|
// DNSBL check
|
||||||
|
if ($config['check_dnsbl'])
|
||||||
|
{
|
||||||
|
if (($dnsbl = $user->check_dnsbl()) !== false)
|
||||||
|
{
|
||||||
|
$error[] = sprintf($user->lang['IP_BLACKLISTED'], $user->ip, $dnsbl[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// validate custom profile fields
|
// validate custom profile fields
|
||||||
$cp->submit_cp_field('register', $user->get_iso_lang_id(), $cp_data, $error);
|
$cp->submit_cp_field('register', $user->get_iso_lang_id(), $cp_data, $error);
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,18 @@
|
||||||
*
|
*
|
||||||
* @package phpBB3
|
* @package phpBB3
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @copyright (c) 2005 phpBB Group
|
* @copyright (c) 2006 phpBB Group
|
||||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
if (!defined('IN_PHPBB'))
|
||||||
|
{
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UTF-8 tools
|
* UTF-8 tools
|
||||||
*
|
*
|
||||||
|
@ -20,12 +27,12 @@
|
||||||
if (!extension_loaded('xml'))
|
if (!extension_loaded('xml'))
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Implementation of PHP's native utf8_encode for people without XML support
|
* Implementation of PHP's native utf8_encode for people without XML support
|
||||||
* This function exploits some nice things that ISO-8859-1 and UTF-8 have in common
|
* This function exploits some nice things that ISO-8859-1 and UTF-8 have in common
|
||||||
*
|
*
|
||||||
* @param string $str ISO-8859-1 encoded data
|
* @param string $str ISO-8859-1 encoded data
|
||||||
* @return string UTF-8 encoded data
|
* @return string UTF-8 encoded data
|
||||||
*/
|
*/
|
||||||
function utf8_encode($str)
|
function utf8_encode($str)
|
||||||
{
|
{
|
||||||
$out = '';
|
$out = '';
|
||||||
|
@ -51,17 +58,18 @@ if (!extension_loaded('xml'))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of PHP's native utf8_decode for people without XML support
|
* Implementation of PHP's native utf8_decode for people without XML support
|
||||||
*
|
*
|
||||||
* @author GetID3()
|
* @author GetID3()
|
||||||
* @param string $string UTF-8 encoded data
|
* @param string $string UTF-8 encoded data
|
||||||
* @return string ISO-8859-1 encoded data
|
* @return string ISO-8859-1 encoded data
|
||||||
*/
|
*/
|
||||||
function utf8_decode($string)
|
function utf8_decode($string)
|
||||||
{
|
{
|
||||||
$newcharstring = '';
|
$newcharstring = '';
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
$stringlength = strlen($string);
|
$stringlength = strlen($string);
|
||||||
|
|
||||||
while ($offset < $stringlength)
|
while ($offset < $stringlength)
|
||||||
{
|
{
|
||||||
$ord = ord($string{$offset});
|
$ord = ord($string{$offset});
|
||||||
|
@ -101,11 +109,13 @@ if (!extension_loaded('xml'))
|
||||||
$charval = false;
|
$charval = false;
|
||||||
$offset += 1;
|
$offset += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($charval !== false)
|
if ($charval !== false)
|
||||||
{
|
{
|
||||||
$newcharstring .= (($charval < 256) ? chr($charval) : '?');
|
$newcharstring .= (($charval < 256) ? chr($charval) : '?');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $newcharstring;
|
return $newcharstring;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,6 +144,7 @@ if (extension_loaded('mbstring'))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mb_strrpos($str, $search);
|
return mb_strrpos($str, $search);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -164,7 +175,7 @@ if (extension_loaded('mbstring'))
|
||||||
* @param string needle
|
* @param string needle
|
||||||
* @param integer offset in characters (from left)
|
* @param integer offset in characters (from left)
|
||||||
* @return mixed integer position or FALSE on failure
|
* @return mixed integer position or FALSE on failure
|
||||||
*/
|
*/
|
||||||
function utf8_strpos($str, $needle, $offset = null)
|
function utf8_strpos($str, $needle, $offset = null)
|
||||||
{
|
{
|
||||||
if ($offset === false)
|
if ($offset === false)
|
||||||
|
@ -262,11 +273,12 @@ else
|
||||||
{
|
{
|
||||||
$ar = explode($needle, $str);
|
$ar = explode($needle, $str);
|
||||||
|
|
||||||
if (count($ar) > 1)
|
if (sizeof($ar) > 1)
|
||||||
{
|
{
|
||||||
// Pop off the end of the string where the last match was made
|
// Pop off the end of the string where the last match was made
|
||||||
array_pop($ar);
|
array_pop($ar);
|
||||||
$str = join($needle,$ar);
|
$str = join($needle, $ar);
|
||||||
|
|
||||||
return utf8_strlen($str);
|
return utf8_strlen($str);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -278,14 +290,14 @@ else
|
||||||
trigger_error('utf8_strrpos expects parameter 3 to be long', E_USER_WARNING);
|
trigger_error('utf8_strrpos expects parameter 3 to be long', E_USER_WARNING);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$str = utf8_substr($str, $offset);
|
$str = utf8_substr($str, $offset);
|
||||||
|
|
||||||
if (false !== ($pos = utf8_strrpos($str, $needle)))
|
if (false !== ($pos = utf8_strrpos($str, $needle)))
|
||||||
{
|
{
|
||||||
return $pos + $offset;
|
return $pos + $offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -299,14 +311,14 @@ else
|
||||||
* @param string needle
|
* @param string needle
|
||||||
* @param integer offset in characters (from left)
|
* @param integer offset in characters (from left)
|
||||||
* @return mixed integer position or FALSE on failure
|
* @return mixed integer position or FALSE on failure
|
||||||
*/
|
*/
|
||||||
function utf8_strpos($str, $needle, $offset = null)
|
function utf8_strpos($str, $needle, $offset = null)
|
||||||
{
|
{
|
||||||
// native
|
// native
|
||||||
if (is_null($offset))
|
if (is_null($offset))
|
||||||
{
|
{
|
||||||
$ar = explode($needle, $str);
|
$ar = explode($needle, $str);
|
||||||
if (count($ar) > 1)
|
if (sizeof($ar) > 1)
|
||||||
{
|
{
|
||||||
return utf8_strlen($ar[0]);
|
return utf8_strlen($ar[0]);
|
||||||
}
|
}
|
||||||
|
@ -331,97 +343,97 @@ else
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$UTF8_UPPER_TO_LOWER = array(
|
$UTF8_UPPER_TO_LOWER = array(
|
||||||
0x0041=>0x0061, 0x03A6=>0x03C6, 0x0162=>0x0163, 0x00C5=>0x00E5, 0x0042=>0x0062,
|
0x0041=>0x0061, 0x03A6=>0x03C6, 0x0162=>0x0163, 0x00C5=>0x00E5, 0x0042=>0x0062,
|
||||||
0x0139=>0x013A, 0x00C1=>0x00E1, 0x0141=>0x0142, 0x038E=>0x03CD, 0x0100=>0x0101,
|
0x0139=>0x013A, 0x00C1=>0x00E1, 0x0141=>0x0142, 0x038E=>0x03CD, 0x0100=>0x0101,
|
||||||
0x0490=>0x0491, 0x0394=>0x03B4, 0x015A=>0x015B, 0x0044=>0x0064, 0x0393=>0x03B3,
|
0x0490=>0x0491, 0x0394=>0x03B4, 0x015A=>0x015B, 0x0044=>0x0064, 0x0393=>0x03B3,
|
||||||
0x00D4=>0x00F4, 0x042A=>0x044A, 0x0419=>0x0439, 0x0112=>0x0113, 0x041C=>0x043C,
|
0x00D4=>0x00F4, 0x042A=>0x044A, 0x0419=>0x0439, 0x0112=>0x0113, 0x041C=>0x043C,
|
||||||
0x015E=>0x015F, 0x0143=>0x0144, 0x00CE=>0x00EE, 0x040E=>0x045E, 0x042F=>0x044F,
|
0x015E=>0x015F, 0x0143=>0x0144, 0x00CE=>0x00EE, 0x040E=>0x045E, 0x042F=>0x044F,
|
||||||
0x039A=>0x03BA, 0x0154=>0x0155, 0x0049=>0x0069, 0x0053=>0x0073, 0x1E1E=>0x1E1F,
|
0x039A=>0x03BA, 0x0154=>0x0155, 0x0049=>0x0069, 0x0053=>0x0073, 0x1E1E=>0x1E1F,
|
||||||
0x0134=>0x0135, 0x0427=>0x0447, 0x03A0=>0x03C0, 0x0418=>0x0438, 0x00D3=>0x00F3,
|
0x0134=>0x0135, 0x0427=>0x0447, 0x03A0=>0x03C0, 0x0418=>0x0438, 0x00D3=>0x00F3,
|
||||||
0x0420=>0x0440, 0x0404=>0x0454, 0x0415=>0x0435, 0x0429=>0x0449, 0x014A=>0x014B,
|
0x0420=>0x0440, 0x0404=>0x0454, 0x0415=>0x0435, 0x0429=>0x0449, 0x014A=>0x014B,
|
||||||
0x0411=>0x0431, 0x0409=>0x0459, 0x1E02=>0x1E03, 0x00D6=>0x00F6, 0x00D9=>0x00F9,
|
0x0411=>0x0431, 0x0409=>0x0459, 0x1E02=>0x1E03, 0x00D6=>0x00F6, 0x00D9=>0x00F9,
|
||||||
0x004E=>0x006E, 0x0401=>0x0451, 0x03A4=>0x03C4, 0x0423=>0x0443, 0x015C=>0x015D,
|
0x004E=>0x006E, 0x0401=>0x0451, 0x03A4=>0x03C4, 0x0423=>0x0443, 0x015C=>0x015D,
|
||||||
0x0403=>0x0453, 0x03A8=>0x03C8, 0x0158=>0x0159, 0x0047=>0x0067, 0x00C4=>0x00E4,
|
0x0403=>0x0453, 0x03A8=>0x03C8, 0x0158=>0x0159, 0x0047=>0x0067, 0x00C4=>0x00E4,
|
||||||
0x0386=>0x03AC, 0x0389=>0x03AE, 0x0166=>0x0167, 0x039E=>0x03BE, 0x0164=>0x0165,
|
0x0386=>0x03AC, 0x0389=>0x03AE, 0x0166=>0x0167, 0x039E=>0x03BE, 0x0164=>0x0165,
|
||||||
0x0116=>0x0117, 0x0108=>0x0109, 0x0056=>0x0076, 0x00DE=>0x00FE, 0x0156=>0x0157,
|
0x0116=>0x0117, 0x0108=>0x0109, 0x0056=>0x0076, 0x00DE=>0x00FE, 0x0156=>0x0157,
|
||||||
0x00DA=>0x00FA, 0x1E60=>0x1E61, 0x1E82=>0x1E83, 0x00C2=>0x00E2, 0x0118=>0x0119,
|
0x00DA=>0x00FA, 0x1E60=>0x1E61, 0x1E82=>0x1E83, 0x00C2=>0x00E2, 0x0118=>0x0119,
|
||||||
0x0145=>0x0146, 0x0050=>0x0070, 0x0150=>0x0151, 0x042E=>0x044E, 0x0128=>0x0129,
|
0x0145=>0x0146, 0x0050=>0x0070, 0x0150=>0x0151, 0x042E=>0x044E, 0x0128=>0x0129,
|
||||||
0x03A7=>0x03C7, 0x013D=>0x013E, 0x0422=>0x0442, 0x005A=>0x007A, 0x0428=>0x0448,
|
0x03A7=>0x03C7, 0x013D=>0x013E, 0x0422=>0x0442, 0x005A=>0x007A, 0x0428=>0x0448,
|
||||||
0x03A1=>0x03C1, 0x1E80=>0x1E81, 0x016C=>0x016D, 0x00D5=>0x00F5, 0x0055=>0x0075,
|
0x03A1=>0x03C1, 0x1E80=>0x1E81, 0x016C=>0x016D, 0x00D5=>0x00F5, 0x0055=>0x0075,
|
||||||
0x0176=>0x0177, 0x00DC=>0x00FC, 0x1E56=>0x1E57, 0x03A3=>0x03C3, 0x041A=>0x043A,
|
0x0176=>0x0177, 0x00DC=>0x00FC, 0x1E56=>0x1E57, 0x03A3=>0x03C3, 0x041A=>0x043A,
|
||||||
0x004D=>0x006D, 0x016A=>0x016B, 0x0170=>0x0171, 0x0424=>0x0444, 0x00CC=>0x00EC,
|
0x004D=>0x006D, 0x016A=>0x016B, 0x0170=>0x0171, 0x0424=>0x0444, 0x00CC=>0x00EC,
|
||||||
0x0168=>0x0169, 0x039F=>0x03BF, 0x004B=>0x006B, 0x00D2=>0x00F2, 0x00C0=>0x00E0,
|
0x0168=>0x0169, 0x039F=>0x03BF, 0x004B=>0x006B, 0x00D2=>0x00F2, 0x00C0=>0x00E0,
|
||||||
0x0414=>0x0434, 0x03A9=>0x03C9, 0x1E6A=>0x1E6B, 0x00C3=>0x00E3, 0x042D=>0x044D,
|
0x0414=>0x0434, 0x03A9=>0x03C9, 0x1E6A=>0x1E6B, 0x00C3=>0x00E3, 0x042D=>0x044D,
|
||||||
0x0416=>0x0436, 0x01A0=>0x01A1, 0x010C=>0x010D, 0x011C=>0x011D, 0x00D0=>0x00F0,
|
0x0416=>0x0436, 0x01A0=>0x01A1, 0x010C=>0x010D, 0x011C=>0x011D, 0x00D0=>0x00F0,
|
||||||
0x013B=>0x013C, 0x040F=>0x045F, 0x040A=>0x045A, 0x00C8=>0x00E8, 0x03A5=>0x03C5,
|
0x013B=>0x013C, 0x040F=>0x045F, 0x040A=>0x045A, 0x00C8=>0x00E8, 0x03A5=>0x03C5,
|
||||||
0x0046=>0x0066, 0x00DD=>0x00FD, 0x0043=>0x0063, 0x021A=>0x021B, 0x00CA=>0x00EA,
|
0x0046=>0x0066, 0x00DD=>0x00FD, 0x0043=>0x0063, 0x021A=>0x021B, 0x00CA=>0x00EA,
|
||||||
0x0399=>0x03B9, 0x0179=>0x017A, 0x00CF=>0x00EF, 0x01AF=>0x01B0, 0x0045=>0x0065,
|
0x0399=>0x03B9, 0x0179=>0x017A, 0x00CF=>0x00EF, 0x01AF=>0x01B0, 0x0045=>0x0065,
|
||||||
0x039B=>0x03BB, 0x0398=>0x03B8, 0x039C=>0x03BC, 0x040C=>0x045C, 0x041F=>0x043F,
|
0x039B=>0x03BB, 0x0398=>0x03B8, 0x039C=>0x03BC, 0x040C=>0x045C, 0x041F=>0x043F,
|
||||||
0x042C=>0x044C, 0x00DE=>0x00FE, 0x00D0=>0x00F0, 0x1EF2=>0x1EF3, 0x0048=>0x0068,
|
0x042C=>0x044C, 0x00DE=>0x00FE, 0x00D0=>0x00F0, 0x1EF2=>0x1EF3, 0x0048=>0x0068,
|
||||||
0x00CB=>0x00EB, 0x0110=>0x0111, 0x0413=>0x0433, 0x012E=>0x012F, 0x00C6=>0x00E6,
|
0x00CB=>0x00EB, 0x0110=>0x0111, 0x0413=>0x0433, 0x012E=>0x012F, 0x00C6=>0x00E6,
|
||||||
0x0058=>0x0078, 0x0160=>0x0161, 0x016E=>0x016F, 0x0391=>0x03B1, 0x0407=>0x0457,
|
0x0058=>0x0078, 0x0160=>0x0161, 0x016E=>0x016F, 0x0391=>0x03B1, 0x0407=>0x0457,
|
||||||
0x0172=>0x0173, 0x0178=>0x00FF, 0x004F=>0x006F, 0x041B=>0x043B, 0x0395=>0x03B5,
|
0x0172=>0x0173, 0x0178=>0x00FF, 0x004F=>0x006F, 0x041B=>0x043B, 0x0395=>0x03B5,
|
||||||
0x0425=>0x0445, 0x0120=>0x0121, 0x017D=>0x017E, 0x017B=>0x017C, 0x0396=>0x03B6,
|
0x0425=>0x0445, 0x0120=>0x0121, 0x017D=>0x017E, 0x017B=>0x017C, 0x0396=>0x03B6,
|
||||||
0x0392=>0x03B2, 0x0388=>0x03AD, 0x1E84=>0x1E85, 0x0174=>0x0175, 0x0051=>0x0071,
|
0x0392=>0x03B2, 0x0388=>0x03AD, 0x1E84=>0x1E85, 0x0174=>0x0175, 0x0051=>0x0071,
|
||||||
0x0417=>0x0437, 0x1E0A=>0x1E0B, 0x0147=>0x0148, 0x0104=>0x0105, 0x0408=>0x0458,
|
0x0417=>0x0437, 0x1E0A=>0x1E0B, 0x0147=>0x0148, 0x0104=>0x0105, 0x0408=>0x0458,
|
||||||
0x014C=>0x014D, 0x00CD=>0x00ED, 0x0059=>0x0079, 0x010A=>0x010B, 0x038F=>0x03CE,
|
0x014C=>0x014D, 0x00CD=>0x00ED, 0x0059=>0x0079, 0x010A=>0x010B, 0x038F=>0x03CE,
|
||||||
0x0052=>0x0072, 0x0410=>0x0430, 0x0405=>0x0455, 0x0402=>0x0452, 0x0126=>0x0127,
|
0x0052=>0x0072, 0x0410=>0x0430, 0x0405=>0x0455, 0x0402=>0x0452, 0x0126=>0x0127,
|
||||||
0x0136=>0x0137, 0x012A=>0x012B, 0x038A=>0x03AF, 0x042B=>0x044B, 0x004C=>0x006C,
|
0x0136=>0x0137, 0x012A=>0x012B, 0x038A=>0x03AF, 0x042B=>0x044B, 0x004C=>0x006C,
|
||||||
0x0397=>0x03B7, 0x0124=>0x0125, 0x0218=>0x0219, 0x00DB=>0x00FB, 0x011E=>0x011F,
|
0x0397=>0x03B7, 0x0124=>0x0125, 0x0218=>0x0219, 0x00DB=>0x00FB, 0x011E=>0x011F,
|
||||||
0x041E=>0x043E, 0x1E40=>0x1E41, 0x039D=>0x03BD, 0x0106=>0x0107, 0x03AB=>0x03CB,
|
0x041E=>0x043E, 0x1E40=>0x1E41, 0x039D=>0x03BD, 0x0106=>0x0107, 0x03AB=>0x03CB,
|
||||||
0x0426=>0x0446, 0x00DE=>0x00FE, 0x00C7=>0x00E7, 0x03AA=>0x03CA, 0x0421=>0x0441,
|
0x0426=>0x0446, 0x00DE=>0x00FE, 0x00C7=>0x00E7, 0x03AA=>0x03CA, 0x0421=>0x0441,
|
||||||
0x0412=>0x0432, 0x010E=>0x010F, 0x00D8=>0x00F8, 0x0057=>0x0077, 0x011A=>0x011B,
|
0x0412=>0x0432, 0x010E=>0x010F, 0x00D8=>0x00F8, 0x0057=>0x0077, 0x011A=>0x011B,
|
||||||
0x0054=>0x0074, 0x004A=>0x006A, 0x040B=>0x045B, 0x0406=>0x0456, 0x0102=>0x0103,
|
0x0054=>0x0074, 0x004A=>0x006A, 0x040B=>0x045B, 0x0406=>0x0456, 0x0102=>0x0103,
|
||||||
0x039B=>0x03BB, 0x00D1=>0x00F1, 0x041D=>0x043D, 0x038C=>0x03CC, 0x00C9=>0x00E9,
|
0x039B=>0x03BB, 0x00D1=>0x00F1, 0x041D=>0x043D, 0x038C=>0x03CC, 0x00C9=>0x00E9,
|
||||||
0x00D0=>0x00F0, 0x0407=>0x0457, 0x0122=>0x0123,
|
0x00D0=>0x00F0, 0x0407=>0x0457, 0x0122=>0x0123,
|
||||||
);
|
);
|
||||||
|
|
||||||
$UTF8_LOWER_TO_UPPER = array(
|
$UTF8_LOWER_TO_UPPER = array(
|
||||||
0x0061=>0x0041, 0x03C6=>0x03A6, 0x0163=>0x0162, 0x00E5=>0x00C5, 0x0062=>0x0042,
|
0x0061=>0x0041, 0x03C6=>0x03A6, 0x0163=>0x0162, 0x00E5=>0x00C5, 0x0062=>0x0042,
|
||||||
0x013A=>0x0139, 0x00E1=>0x00C1, 0x0142=>0x0141, 0x03CD=>0x038E, 0x0101=>0x0100,
|
0x013A=>0x0139, 0x00E1=>0x00C1, 0x0142=>0x0141, 0x03CD=>0x038E, 0x0101=>0x0100,
|
||||||
0x0491=>0x0490, 0x03B4=>0x0394, 0x015B=>0x015A, 0x0064=>0x0044, 0x03B3=>0x0393,
|
0x0491=>0x0490, 0x03B4=>0x0394, 0x015B=>0x015A, 0x0064=>0x0044, 0x03B3=>0x0393,
|
||||||
0x00F4=>0x00D4, 0x044A=>0x042A, 0x0439=>0x0419, 0x0113=>0x0112, 0x043C=>0x041C,
|
0x00F4=>0x00D4, 0x044A=>0x042A, 0x0439=>0x0419, 0x0113=>0x0112, 0x043C=>0x041C,
|
||||||
0x015F=>0x015E, 0x0144=>0x0143, 0x00EE=>0x00CE, 0x045E=>0x040E, 0x044F=>0x042F,
|
0x015F=>0x015E, 0x0144=>0x0143, 0x00EE=>0x00CE, 0x045E=>0x040E, 0x044F=>0x042F,
|
||||||
0x03BA=>0x039A, 0x0155=>0x0154, 0x0069=>0x0049, 0x0073=>0x0053, 0x1E1F=>0x1E1E,
|
0x03BA=>0x039A, 0x0155=>0x0154, 0x0069=>0x0049, 0x0073=>0x0053, 0x1E1F=>0x1E1E,
|
||||||
0x0135=>0x0134, 0x0447=>0x0427, 0x03C0=>0x03A0, 0x0438=>0x0418, 0x00F3=>0x00D3,
|
0x0135=>0x0134, 0x0447=>0x0427, 0x03C0=>0x03A0, 0x0438=>0x0418, 0x00F3=>0x00D3,
|
||||||
0x0440=>0x0420, 0x0454=>0x0404, 0x0435=>0x0415, 0x0449=>0x0429, 0x014B=>0x014A,
|
0x0440=>0x0420, 0x0454=>0x0404, 0x0435=>0x0415, 0x0449=>0x0429, 0x014B=>0x014A,
|
||||||
0x0431=>0x0411, 0x0459=>0x0409, 0x1E03=>0x1E02, 0x00F6=>0x00D6, 0x00F9=>0x00D9,
|
0x0431=>0x0411, 0x0459=>0x0409, 0x1E03=>0x1E02, 0x00F6=>0x00D6, 0x00F9=>0x00D9,
|
||||||
0x006E=>0x004E, 0x0451=>0x0401, 0x03C4=>0x03A4, 0x0443=>0x0423, 0x015D=>0x015C,
|
0x006E=>0x004E, 0x0451=>0x0401, 0x03C4=>0x03A4, 0x0443=>0x0423, 0x015D=>0x015C,
|
||||||
0x0453=>0x0403, 0x03C8=>0x03A8, 0x0159=>0x0158, 0x0067=>0x0047, 0x00E4=>0x00C4,
|
0x0453=>0x0403, 0x03C8=>0x03A8, 0x0159=>0x0158, 0x0067=>0x0047, 0x00E4=>0x00C4,
|
||||||
0x03AC=>0x0386, 0x03AE=>0x0389, 0x0167=>0x0166, 0x03BE=>0x039E, 0x0165=>0x0164,
|
0x03AC=>0x0386, 0x03AE=>0x0389, 0x0167=>0x0166, 0x03BE=>0x039E, 0x0165=>0x0164,
|
||||||
0x0117=>0x0116, 0x0109=>0x0108, 0x0076=>0x0056, 0x00FE=>0x00DE, 0x0157=>0x0156,
|
0x0117=>0x0116, 0x0109=>0x0108, 0x0076=>0x0056, 0x00FE=>0x00DE, 0x0157=>0x0156,
|
||||||
0x00FA=>0x00DA, 0x1E61=>0x1E60, 0x1E83=>0x1E82, 0x00E2=>0x00C2, 0x0119=>0x0118,
|
0x00FA=>0x00DA, 0x1E61=>0x1E60, 0x1E83=>0x1E82, 0x00E2=>0x00C2, 0x0119=>0x0118,
|
||||||
0x0146=>0x0145, 0x0070=>0x0050, 0x0151=>0x0150, 0x044E=>0x042E, 0x0129=>0x0128,
|
0x0146=>0x0145, 0x0070=>0x0050, 0x0151=>0x0150, 0x044E=>0x042E, 0x0129=>0x0128,
|
||||||
0x03C7=>0x03A7, 0x013E=>0x013D, 0x0442=>0x0422, 0x007A=>0x005A, 0x0448=>0x0428,
|
0x03C7=>0x03A7, 0x013E=>0x013D, 0x0442=>0x0422, 0x007A=>0x005A, 0x0448=>0x0428,
|
||||||
0x03C1=>0x03A1, 0x1E81=>0x1E80, 0x016D=>0x016C, 0x00F5=>0x00D5, 0x0075=>0x0055,
|
0x03C1=>0x03A1, 0x1E81=>0x1E80, 0x016D=>0x016C, 0x00F5=>0x00D5, 0x0075=>0x0055,
|
||||||
0x0177=>0x0176, 0x00FC=>0x00DC, 0x1E57=>0x1E56, 0x03C3=>0x03A3, 0x043A=>0x041A,
|
0x0177=>0x0176, 0x00FC=>0x00DC, 0x1E57=>0x1E56, 0x03C3=>0x03A3, 0x043A=>0x041A,
|
||||||
0x006D=>0x004D, 0x016B=>0x016A, 0x0171=>0x0170, 0x0444=>0x0424, 0x00EC=>0x00CC,
|
0x006D=>0x004D, 0x016B=>0x016A, 0x0171=>0x0170, 0x0444=>0x0424, 0x00EC=>0x00CC,
|
||||||
0x0169=>0x0168, 0x03BF=>0x039F, 0x006B=>0x004B, 0x00F2=>0x00D2, 0x00E0=>0x00C0,
|
0x0169=>0x0168, 0x03BF=>0x039F, 0x006B=>0x004B, 0x00F2=>0x00D2, 0x00E0=>0x00C0,
|
||||||
0x0434=>0x0414, 0x03C9=>0x03A9, 0x1E6B=>0x1E6A, 0x00E3=>0x00C3, 0x044D=>0x042D,
|
0x0434=>0x0414, 0x03C9=>0x03A9, 0x1E6B=>0x1E6A, 0x00E3=>0x00C3, 0x044D=>0x042D,
|
||||||
0x0436=>0x0416, 0x01A1=>0x01A0, 0x010D=>0x010C, 0x011D=>0x011C, 0x00F0=>0x00D0,
|
0x0436=>0x0416, 0x01A1=>0x01A0, 0x010D=>0x010C, 0x011D=>0x011C, 0x00F0=>0x00D0,
|
||||||
0x013C=>0x013B, 0x045F=>0x040F, 0x045A=>0x040A, 0x00E8=>0x00C8, 0x03C5=>0x03A5,
|
0x013C=>0x013B, 0x045F=>0x040F, 0x045A=>0x040A, 0x00E8=>0x00C8, 0x03C5=>0x03A5,
|
||||||
0x0066=>0x0046, 0x00FD=>0x00DD, 0x0063=>0x0043, 0x021B=>0x021A, 0x00EA=>0x00CA,
|
0x0066=>0x0046, 0x00FD=>0x00DD, 0x0063=>0x0043, 0x021B=>0x021A, 0x00EA=>0x00CA,
|
||||||
0x03B9=>0x0399, 0x017A=>0x0179, 0x00EF=>0x00CF, 0x01B0=>0x01AF, 0x0065=>0x0045,
|
0x03B9=>0x0399, 0x017A=>0x0179, 0x00EF=>0x00CF, 0x01B0=>0x01AF, 0x0065=>0x0045,
|
||||||
0x03BB=>0x039B, 0x03B8=>0x0398, 0x03BC=>0x039C, 0x045C=>0x040C, 0x043F=>0x041F,
|
0x03BB=>0x039B, 0x03B8=>0x0398, 0x03BC=>0x039C, 0x045C=>0x040C, 0x043F=>0x041F,
|
||||||
0x044C=>0x042C, 0x00FE=>0x00DE, 0x00F0=>0x00D0, 0x1EF3=>0x1EF2, 0x0068=>0x0048,
|
0x044C=>0x042C, 0x00FE=>0x00DE, 0x00F0=>0x00D0, 0x1EF3=>0x1EF2, 0x0068=>0x0048,
|
||||||
0x00EB=>0x00CB, 0x0111=>0x0110, 0x0433=>0x0413, 0x012F=>0x012E, 0x00E6=>0x00C6,
|
0x00EB=>0x00CB, 0x0111=>0x0110, 0x0433=>0x0413, 0x012F=>0x012E, 0x00E6=>0x00C6,
|
||||||
0x0078=>0x0058, 0x0161=>0x0160, 0x016F=>0x016E, 0x03B1=>0x0391, 0x0457=>0x0407,
|
0x0078=>0x0058, 0x0161=>0x0160, 0x016F=>0x016E, 0x03B1=>0x0391, 0x0457=>0x0407,
|
||||||
0x0173=>0x0172, 0x00FF=>0x0178, 0x006F=>0x004F, 0x043B=>0x041B, 0x03B5=>0x0395,
|
0x0173=>0x0172, 0x00FF=>0x0178, 0x006F=>0x004F, 0x043B=>0x041B, 0x03B5=>0x0395,
|
||||||
0x0445=>0x0425, 0x0121=>0x0120, 0x017E=>0x017D, 0x017C=>0x017B, 0x03B6=>0x0396,
|
0x0445=>0x0425, 0x0121=>0x0120, 0x017E=>0x017D, 0x017C=>0x017B, 0x03B6=>0x0396,
|
||||||
0x03B2=>0x0392, 0x03AD=>0x0388, 0x1E85=>0x1E84, 0x0175=>0x0174, 0x0071=>0x0051,
|
0x03B2=>0x0392, 0x03AD=>0x0388, 0x1E85=>0x1E84, 0x0175=>0x0174, 0x0071=>0x0051,
|
||||||
0x0437=>0x0417, 0x1E0B=>0x1E0A, 0x0148=>0x0147, 0x0105=>0x0104, 0x0458=>0x0408,
|
0x0437=>0x0417, 0x1E0B=>0x1E0A, 0x0148=>0x0147, 0x0105=>0x0104, 0x0458=>0x0408,
|
||||||
0x014D=>0x014C, 0x00ED=>0x00CD, 0x0079=>0x0059, 0x010B=>0x010A, 0x03CE=>0x038F,
|
0x014D=>0x014C, 0x00ED=>0x00CD, 0x0079=>0x0059, 0x010B=>0x010A, 0x03CE=>0x038F,
|
||||||
0x0072=>0x0052, 0x0430=>0x0410, 0x0455=>0x0405, 0x0452=>0x0402, 0x0127=>0x0126,
|
0x0072=>0x0052, 0x0430=>0x0410, 0x0455=>0x0405, 0x0452=>0x0402, 0x0127=>0x0126,
|
||||||
0x0137=>0x0136, 0x012B=>0x012A, 0x03AF=>0x038A, 0x044B=>0x042B, 0x006C=>0x004C,
|
0x0137=>0x0136, 0x012B=>0x012A, 0x03AF=>0x038A, 0x044B=>0x042B, 0x006C=>0x004C,
|
||||||
0x03B7=>0x0397, 0x0125=>0x0124, 0x0219=>0x0218, 0x00FB=>0x00DB, 0x011F=>0x011E,
|
0x03B7=>0x0397, 0x0125=>0x0124, 0x0219=>0x0218, 0x00FB=>0x00DB, 0x011F=>0x011E,
|
||||||
0x043E=>0x041E, 0x1E41=>0x1E40, 0x03BD=>0x039D, 0x0107=>0x0106, 0x03CB=>0x03AB,
|
0x043E=>0x041E, 0x1E41=>0x1E40, 0x03BD=>0x039D, 0x0107=>0x0106, 0x03CB=>0x03AB,
|
||||||
0x0446=>0x0426, 0x00FE=>0x00DE, 0x00E7=>0x00C7, 0x03CA=>0x03AA, 0x0441=>0x0421,
|
0x0446=>0x0426, 0x00FE=>0x00DE, 0x00E7=>0x00C7, 0x03CA=>0x03AA, 0x0441=>0x0421,
|
||||||
0x0432=>0x0412, 0x010F=>0x010E, 0x00F8=>0x00D8, 0x0077=>0x0057, 0x011B=>0x011A,
|
0x0432=>0x0412, 0x010F=>0x010E, 0x00F8=>0x00D8, 0x0077=>0x0057, 0x011B=>0x011A,
|
||||||
0x0074=>0x0054, 0x006A=>0x004A, 0x045B=>0x040B, 0x0456=>0x0406, 0x0103=>0x0102,
|
0x0074=>0x0054, 0x006A=>0x004A, 0x045B=>0x040B, 0x0456=>0x0406, 0x0103=>0x0102,
|
||||||
0x03BB=>0x039B, 0x00F1=>0x00D1, 0x043D=>0x041D, 0x03CC=>0x038C, 0x00E9=>0x00C9,
|
0x03BB=>0x039B, 0x00F1=>0x00D1, 0x043D=>0x041D, 0x03CC=>0x038C, 0x00E9=>0x00C9,
|
||||||
0x00F0=>0x00D0, 0x0457=>0x0407, 0x0123=>0x0122,
|
0x00F0=>0x00D0, 0x0457=>0x0407, 0x0123=>0x0122,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UTF-8 aware alternative to strtolower
|
* UTF-8 aware alternative to strtolower
|
||||||
|
@ -438,14 +450,15 @@ $UTF8_LOWER_TO_UPPER = array(
|
||||||
function utf8_strtolower($string)
|
function utf8_strtolower($string)
|
||||||
{
|
{
|
||||||
global $UTF8_UPPER_TO_LOWER;
|
global $UTF8_UPPER_TO_LOWER;
|
||||||
|
|
||||||
$uni = utf8_to_unicode($string);
|
$uni = utf8_to_unicode($string);
|
||||||
|
|
||||||
if (!$uni)
|
if (!$uni)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cnt = count($uni);
|
for ($i = 0, $cnt = sizeof($uni); $i < $cnt; $i++)
|
||||||
for ($i = 0; $i < $cnt; $i++)
|
|
||||||
{
|
{
|
||||||
if (isset($UTF8_UPPER_TO_LOWER[$uni[$i]]))
|
if (isset($UTF8_UPPER_TO_LOWER[$uni[$i]]))
|
||||||
{
|
{
|
||||||
|
@ -471,14 +484,15 @@ $UTF8_LOWER_TO_UPPER = array(
|
||||||
function utf8_strtoupper($str)
|
function utf8_strtoupper($str)
|
||||||
{
|
{
|
||||||
global $UTF8_LOWER_TO_UPPER;
|
global $UTF8_LOWER_TO_UPPER;
|
||||||
|
|
||||||
$uni = utf8_to_unicode($string);
|
$uni = utf8_to_unicode($string);
|
||||||
|
|
||||||
if (!$uni)
|
if (!$uni)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cnt = count($uni);
|
for ($i = 0, $cnt = sizeof($uni); $i < $cnt; $i++)
|
||||||
for ($i = 0; $i < $cnt; $i++)
|
|
||||||
{
|
{
|
||||||
if (isset($UTF8_LOWER_TO_UPPER[$uni[$i]]))
|
if (isset($UTF8_LOWER_TO_UPPER[$uni[$i]]))
|
||||||
{
|
{
|
||||||
|
@ -514,13 +528,13 @@ $UTF8_LOWER_TO_UPPER = array(
|
||||||
trigger_error('utf8_substr expects parameter 3 to be long', E_USER_WARNING);
|
trigger_error('utf8_substr expects parameter 3 to be long', E_USER_WARNING);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$strlen = strlen(utf8_decode($str));
|
$strlen = strlen(utf8_decode($str));
|
||||||
if ($offset > $strlen)
|
if ($offset > $strlen)
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($offset + $length) > $strlen)
|
if (($offset + $length) > $strlen)
|
||||||
{
|
{
|
||||||
$length = '*';
|
$length = '*';
|
||||||
|
@ -530,29 +544,30 @@ $UTF8_LOWER_TO_UPPER = array(
|
||||||
$length = '{' . $length . '}';
|
$length = '{' . $length . '}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/^[0-9]+$/', $offset))
|
if (!preg_match('/^[0-9]+$/', $offset))
|
||||||
{
|
{
|
||||||
trigger_error('utf8_substr expects parameter 2 to be long', E_USER_WARNING);
|
trigger_error('utf8_substr expects parameter 2 to be long', E_USER_WARNING);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pattern = '/^.{' . $offset . '}(.' . $length . ')/us';
|
$pattern = '/^.{' . $offset . '}(.' . $length . ')/us';
|
||||||
|
|
||||||
preg_match($pattern, $str, $matches);
|
preg_match($pattern, $str, $matches);
|
||||||
|
|
||||||
if (isset($matches[1]))
|
if (isset($matches[1]))
|
||||||
{
|
{
|
||||||
return $matches[1];
|
return $matches[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Handle negatives using different, slower technique
|
// Handle negatives using different, slower technique
|
||||||
// From: http://www.php.net/manual/en/function.substr.php#44838
|
// From: http://www.php.net/manual/en/function.substr.php#44838
|
||||||
preg_match_all('/./u', $str, $ar);
|
preg_match_all('/./u', $str, $ar);
|
||||||
|
|
||||||
if ($length !== null)
|
if ($length !== null)
|
||||||
{
|
{
|
||||||
return join('', array_slice($ar[0], $offset, $length));
|
return join('', array_slice($ar[0], $offset, $length));
|
||||||
|
@ -575,7 +590,6 @@ $UTF8_LOWER_TO_UPPER = array(
|
||||||
// Since utf8_decode is replacing multibyte characters to ? strlen works fine
|
// Since utf8_decode is replacing multibyte characters to ? strlen works fine
|
||||||
return strlen(utf8_decode($text));
|
return strlen(utf8_decode($text));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -593,7 +607,7 @@ function utf8_str_split($str, $split_len = 1)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$len = utf8_strlen($str);
|
$len = utf8_strlen($str);
|
||||||
if ($len <= $split_len)
|
if ($len <= $split_len)
|
||||||
{
|
{
|
||||||
|
@ -615,12 +629,12 @@ function utf8_str_split($str, $split_len = 1)
|
||||||
function utf8_strspn($str, $mask, $start = null, $length = null)
|
function utf8_strspn($str, $mask, $start = null, $length = null)
|
||||||
{
|
{
|
||||||
$mask = preg_replace('!([\\\\\\-\\]\\[/^])!', '\\\${1}', $mask);
|
$mask = preg_replace('!([\\\\\\-\\]\\[/^])!', '\\\${1}', $mask);
|
||||||
|
|
||||||
if ($start !== null || $length !== null)
|
if ($start !== null || $length !== null)
|
||||||
{
|
{
|
||||||
$str = utf8_substr($str, $start, $length);
|
$str = utf8_substr($str, $start, $length);
|
||||||
}
|
}
|
||||||
|
|
||||||
preg_match('/^[' . $mask . ']+/u', $str, $matches);
|
preg_match('/^[' . $mask . ']+/u', $str, $matches);
|
||||||
|
|
||||||
if (isset($matches[0]))
|
if (isset($matches[0]))
|
||||||
|
@ -628,7 +642,7 @@ function utf8_strspn($str, $mask, $start = null, $length = null)
|
||||||
return utf8_strlen($matches[0]);
|
return utf8_strlen($matches[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -664,7 +678,7 @@ function utf8_ucfirst($str)
|
||||||
* If the encoding is not supported, the string is returned as-is
|
* If the encoding is not supported, the string is returned as-is
|
||||||
*
|
*
|
||||||
* @param string $string Original string
|
* @param string $string Original string
|
||||||
* @param string $encoding Original encoding
|
* @param string $encoding Original encoding (lowered)
|
||||||
* @return string The string, encoded in UTF-8
|
* @return string The string, encoded in UTF-8
|
||||||
*/
|
*/
|
||||||
function utf8_recode($string, $encoding)
|
function utf8_recode($string, $encoding)
|
||||||
|
@ -676,7 +690,6 @@ function utf8_recode($string, $encoding)
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// start with something simple
|
// start with something simple
|
||||||
if ($encoding == 'iso-8859-1')
|
if ($encoding == 'iso-8859-1')
|
||||||
{
|
{
|
||||||
|
@ -758,11 +771,11 @@ function utf8_encode_ncr_callback($m)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter description here...
|
* Enter description here...
|
||||||
*
|
*
|
||||||
* @param string $chr UTF-8 char
|
* @param string $chr UTF-8 char
|
||||||
* @return integer UNICODE code point
|
* @return integer UNICODE code point
|
||||||
*/
|
*/
|
||||||
function utf8_ord($chr)
|
function utf8_ord($chr)
|
||||||
{
|
{
|
||||||
switch (strlen($chr))
|
switch (strlen($chr))
|
||||||
|
@ -789,22 +802,22 @@ function utf8_ord($chr)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts an NCR to a UTF-8 char
|
* Converts an NCR to a UTF-8 char
|
||||||
*
|
*
|
||||||
* @param integer $cp UNICODE code point
|
* @param integer $cp UNICODE code point
|
||||||
* @return string UTF-8 char
|
* @return string UTF-8 char
|
||||||
*/
|
*/
|
||||||
function utf8_chr($cp)
|
function utf8_chr($cp)
|
||||||
{
|
{
|
||||||
if ($cp > 0xFFFF)
|
if ($cp > 0xFFFF)
|
||||||
{
|
{
|
||||||
return chr(0xF0 | ($cp >> 18)) . chr(0x80 | (($cp >> 12) & 0x3F)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
|
return chr(0xF0 | ($cp >> 18)) . chr(0x80 | (($cp >> 12) & 0x3F)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
|
||||||
}
|
}
|
||||||
elseif ($cp > 0x7FF)
|
else if ($cp > 0x7FF)
|
||||||
{
|
{
|
||||||
return chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
|
return chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
|
||||||
}
|
}
|
||||||
elseif ($cp > 0x7F)
|
else if ($cp > 0x7F)
|
||||||
{
|
{
|
||||||
return chr(0xC0 | ($cp >> 6)) . chr(0x80 | ($cp & 0x3F));
|
return chr(0xC0 | ($cp >> 6)) . chr(0x80 | ($cp & 0x3F));
|
||||||
}
|
}
|
||||||
|
@ -847,17 +860,18 @@ function utf8_decode_ncr_callback($m)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes an UTF-8 string and returns an array of ints representing the
|
* Takes an UTF-8 string and returns an array of ints representing the
|
||||||
* Unicode characters.
|
* Unicode characters.
|
||||||
*
|
*
|
||||||
* @param string UTF-8 encoded string
|
* @param string UTF-8 encoded string
|
||||||
* @return array array of UNICODE code points
|
* @return array array of UNICODE code points
|
||||||
*/
|
*/
|
||||||
function utf8_to_unicode($string)
|
function utf8_to_unicode($string)
|
||||||
{
|
{
|
||||||
$unicode = array();
|
$unicode = array();
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
$stringlength = strlen($string);
|
$stringlength = strlen($string);
|
||||||
|
|
||||||
while ($offset < $stringlength)
|
while ($offset < $stringlength)
|
||||||
{
|
{
|
||||||
$ord = ord($string{$offset});
|
$ord = ord($string{$offset});
|
||||||
|
@ -906,12 +920,12 @@ function utf8_to_unicode($string)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes an array of ints representing the Unicode characters and returns
|
* Takes an array of ints representing the Unicode characters and returns
|
||||||
* a UTF-8 string.
|
* a UTF-8 string.
|
||||||
*
|
*
|
||||||
* @param array $array array of unicode code points representing a string
|
* @param array $array array of unicode code points representing a string
|
||||||
* @return string UTF-8 character string
|
* @return string UTF-8 character string
|
||||||
*/
|
*/
|
||||||
function utf8_from_unicode($array)
|
function utf8_from_unicode($array)
|
||||||
{
|
{
|
||||||
$str = '';
|
$str = '';
|
||||||
|
|
|
@ -344,7 +344,7 @@ class module
|
||||||
$template->display('body');
|
$template->display('body');
|
||||||
|
|
||||||
// Close our DB connection.
|
// Close our DB connection.
|
||||||
if (isset($db))
|
if (!empty($db) && is_object($db))
|
||||||
{
|
{
|
||||||
$db->sql_close();
|
$db->sql_close();
|
||||||
}
|
}
|
||||||
|
@ -533,7 +533,7 @@ class module
|
||||||
echo '</body>';
|
echo '</body>';
|
||||||
echo '</html>';
|
echo '</html>';
|
||||||
|
|
||||||
if (isset($db))
|
if (!empty($db) && is_object($db))
|
||||||
{
|
{
|
||||||
$db->sql_close();
|
$db->sql_close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('browser_check', '1
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_interval', '10');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_interval', '10');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_type', 'd');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_type', 'd');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cache_gc', '7200');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cache_gc', '7200');
|
||||||
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('check_dnsbl', '0');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('chg_passforce', '0');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('chg_passforce', '0');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_domain', '');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_domain', '');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_name', 'phpbb3');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_name', 'phpbb3');
|
||||||
|
@ -73,6 +74,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_style', '1
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_edited', '1');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_edited', '1');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_order', '0');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_order', '0');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0');
|
||||||
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_check_mx', '1');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_function_name', 'mail');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_function_name', 'mail');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '50');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '50');
|
||||||
|
|
|
@ -346,8 +346,12 @@ $lang = array_merge($lang, array(
|
||||||
'AUTOLOGIN_LENGTH_EXPLAIN' => 'Number of days after which persistent login keys are removed or zero to disable.',
|
'AUTOLOGIN_LENGTH_EXPLAIN' => 'Number of days after which persistent login keys are removed or zero to disable.',
|
||||||
'BROWSER_VALID' => 'Validate browser',
|
'BROWSER_VALID' => 'Validate browser',
|
||||||
'BROWSER_VALID_EXPLAIN' => 'Enables browser validation for each session improving security.',
|
'BROWSER_VALID_EXPLAIN' => 'Enables browser validation for each session improving security.',
|
||||||
|
'CHECK_DNSBL' => 'Check IP against DNS Blackhole List',
|
||||||
|
'CHECK_DNSBL_EXPLAIN' => 'If enabled the IP is checked against the following DNSBL services on registration and posting: <a href="http://spamcop.net">spamcop.net</a>, <a href="http://dsbl.org">dsbl.org</a> and <a href="http://spamhaus.org">spamhaus.org</a>. This lookup may take a bit, depending on the servers configuration. If slowdowns are experienced or too much false positives reported it is recommended to disable this check.',
|
||||||
'CLASS_B' => 'A.B',
|
'CLASS_B' => 'A.B',
|
||||||
'CLASS_C' => 'A.B.C',
|
'CLASS_C' => 'A.B.C',
|
||||||
|
'EMAIL_CHECK_MX' => 'Check email domain for valid MX Record',
|
||||||
|
'EMAIL_CHECK_MX_EXPLAIN' => 'If enabled, the email domain provided on registration and profile changes is checked for a valid MX record.',
|
||||||
'FORCE_PASS_CHANGE' => 'Force password change',
|
'FORCE_PASS_CHANGE' => 'Force password change',
|
||||||
'FORCE_PASS_CHANGE_EXPLAIN' => 'Require user to change their password after a set number of days or zero to disable.',
|
'FORCE_PASS_CHANGE_EXPLAIN' => 'Require user to change their password after a set number of days or zero to disable.',
|
||||||
'IP_VALID' => 'Session IP validation',
|
'IP_VALID' => 'Session IP validation',
|
||||||
|
|
|
@ -244,6 +244,7 @@ $lang = array_merge($lang, array(
|
||||||
'INVALID_DIGEST_CHALLENGE' => 'Invalid digest challenge',
|
'INVALID_DIGEST_CHALLENGE' => 'Invalid digest challenge',
|
||||||
'INVALID_EMAIL_LOG' => '<strong>%s</strong> possibly an invalid email address?',
|
'INVALID_EMAIL_LOG' => '<strong>%s</strong> possibly an invalid email address?',
|
||||||
'IP' => 'IP',
|
'IP' => 'IP',
|
||||||
|
'IP_BLACKLISTED' => 'Your IP %1$s has been blocked because it is blacklisted. For details please see <a href="%2$s">%2$s</a>.',
|
||||||
|
|
||||||
'JABBER' => 'Jabber',
|
'JABBER' => 'Jabber',
|
||||||
'JOINED' => 'Joined',
|
'JOINED' => 'Joined',
|
||||||
|
@ -328,6 +329,7 @@ $lang = array_merge($lang, array(
|
||||||
'NO_IPS_DEFINED' => 'No IPs or Hostnames defined',
|
'NO_IPS_DEFINED' => 'No IPs or Hostnames defined',
|
||||||
'NO_MEMBERS' => 'No members found for this search criteria',
|
'NO_MEMBERS' => 'No members found for this search criteria',
|
||||||
'NO_MESSAGES' => 'No messages',
|
'NO_MESSAGES' => 'No messages',
|
||||||
|
'NO_MODE' => 'No mode specified',
|
||||||
'NO_MODERATORS' => 'No moderators assigned at this board.',
|
'NO_MODERATORS' => 'No moderators assigned at this board.',
|
||||||
'NO_NEW_MESSAGES' => 'No new messages',
|
'NO_NEW_MESSAGES' => 'No new messages',
|
||||||
'NO_NEW_PM' => '<strong>0</strong> new messages',
|
'NO_NEW_PM' => '<strong>0</strong> new messages',
|
||||||
|
|
|
@ -164,6 +164,7 @@ $lang = array_merge($lang, array(
|
||||||
'DEMOTE_SELECTED' => 'Demote selected',
|
'DEMOTE_SELECTED' => 'Demote selected',
|
||||||
'DISABLE_CENSORS' => 'Enable word censoring',
|
'DISABLE_CENSORS' => 'Enable word censoring',
|
||||||
'DISPLAY_GALLERY' => 'Display gallery',
|
'DISPLAY_GALLERY' => 'Display gallery',
|
||||||
|
'DOMAIN_NO_MX_RECORD_EMAIL' => 'The entered email domain has no valid MX record.',
|
||||||
'DOWNLOADS' => 'Downloads',
|
'DOWNLOADS' => 'Downloads',
|
||||||
'DRAFTS_DELETED' => 'All selected drafts were successfully deleted.',
|
'DRAFTS_DELETED' => 'All selected drafts were successfully deleted.',
|
||||||
'DRAFTS_EXPLAIN' => 'Here you can view, edit and delete your saved drafts.',
|
'DRAFTS_EXPLAIN' => 'Here you can view, edit and delete your saved drafts.',
|
||||||
|
|
|
@ -640,7 +640,19 @@ if ($submit || $preview || $refresh)
|
||||||
// Parse message
|
// Parse message
|
||||||
if ($update_message)
|
if ($update_message)
|
||||||
{
|
{
|
||||||
|
if (sizeof($message_parser->warn_msg))
|
||||||
|
{
|
||||||
|
$error[] = implode('<br />', $message_parser->warn_msg);
|
||||||
|
$message_parser->warn_msg = array();
|
||||||
|
}
|
||||||
|
|
||||||
$message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $flash_status, $quote_status, $config['allow_post_links']);
|
$message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $flash_status, $quote_status, $config['allow_post_links']);
|
||||||
|
|
||||||
|
// On a refresh we do not care about message parsing errors
|
||||||
|
if (sizeof($message_parser->warn_msg) && $refresh)
|
||||||
|
{
|
||||||
|
$message_parser->warn_msg = array();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -708,7 +720,7 @@ if ($submit || $preview || $refresh)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse subject
|
// Parse subject
|
||||||
if (!$post_data['post_subject'] && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id)))
|
if (!$refresh && !$post_data['post_subject'] && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id)))
|
||||||
{
|
{
|
||||||
$error[] = $user->lang['EMPTY_SUBJECT'];
|
$error[] = $user->lang['EMPTY_SUBJECT'];
|
||||||
}
|
}
|
||||||
|
@ -773,11 +785,20 @@ if ($submit || $preview || $refresh)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sizeof($message_parser->warn_msg) && !$refresh)
|
if (sizeof($message_parser->warn_msg))
|
||||||
{
|
{
|
||||||
$error[] = implode('<br />', $message_parser->warn_msg);
|
$error[] = implode('<br />', $message_parser->warn_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DNSBL check
|
||||||
|
if ($config['check_dnsbl'] && !$refresh)
|
||||||
|
{
|
||||||
|
if (($dnsbl = $user->check_dnsbl()) !== false)
|
||||||
|
{
|
||||||
|
$error[] = sprintf($user->lang['IP_BLACKLISTED'], $user->ip, $dnsbl[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Store message, sync counters
|
// Store message, sync counters
|
||||||
if (!sizeof($error) && $submit)
|
if (!sizeof($error) && $submit)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,11 +4,63 @@
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
var form_name = 'post';
|
var form_name = 'post';
|
||||||
var text_name = 'message';
|
|
||||||
|
/**
|
||||||
|
* Apply clicked smiley to message body
|
||||||
|
*/
|
||||||
|
function smiley(text)
|
||||||
|
{
|
||||||
|
text = ' ' + text + ' ';
|
||||||
|
|
||||||
|
if (opener.document.forms[form_name].message.createTextRange && opener.document.forms[form_name].message.caretPos)
|
||||||
|
{
|
||||||
|
var caretPos = opener.document.forms[form_name].message.caretPos;
|
||||||
|
|
||||||
|
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
|
||||||
|
opener.document.forms[form_name].message.focus();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var selStart = opener.document.forms[form_name].message.selectionStart;
|
||||||
|
var selEnd = opener.document.forms[form_name].message.selectionEnd;
|
||||||
|
|
||||||
|
mozWrap(opener.document.forms[form_name].message, text, '')
|
||||||
|
opener.document.forms[form_name].message.focus();
|
||||||
|
opener.document.forms[form_name].message.selectionStart = selStart + text.length;
|
||||||
|
opener.document.forms[form_name].message.selectionEnd = selEnd + text.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* From http://www.massless.org/mozedit/
|
||||||
|
*/
|
||||||
|
function mozWrap(txtarea, open, close)
|
||||||
|
{
|
||||||
|
var selLength = txtarea.textLength;
|
||||||
|
var selStart = txtarea.selectionStart;
|
||||||
|
var selEnd = txtarea.selectionEnd;
|
||||||
|
var scrollTop = txtarea.scrollTop;
|
||||||
|
|
||||||
|
if (selEnd == 1 || selEnd == 2)
|
||||||
|
{
|
||||||
|
selEnd = selLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
var s1 = (txtarea.value).substring(0,selStart);
|
||||||
|
var s2 = (txtarea.value).substring(selStart, selEnd)
|
||||||
|
var s3 = (txtarea.value).substring(selEnd, selLength);
|
||||||
|
|
||||||
|
txtarea.value = s1 + open + s2 + close + s3;
|
||||||
|
txtarea.selectionStart = selEnd + open.length + close.length;
|
||||||
|
txtarea.selectionEnd = txtarea.selectionStart;
|
||||||
|
txtarea.focus();
|
||||||
|
txtarea.scrollTop = scrollTop;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//-->
|
//-->
|
||||||
</script>
|
</script>
|
||||||
<script language="javascript" type="text/javascript" src="{T_TEMPLATE_PATH}/editor.js"></script>
|
|
||||||
|
|
||||||
<table width="100%" cellspacing="1" cellpadding="4" border="0">
|
<table width="100%" cellspacing="1" cellpadding="4" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -77,7 +77,7 @@ if (isset($_GET['e']) && !$user->data['is_registered'])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Permissions check
|
// Permissions check
|
||||||
if (!$auth->acl_get('f_read', $forum_id))
|
if (!$auth->acl_gets('f_list', 'f_read', $forum_id))
|
||||||
{
|
{
|
||||||
if ($user->data['user_id'] != ANONYMOUS)
|
if ($user->data['user_id'] != ANONYMOUS)
|
||||||
{
|
{
|
||||||
|
@ -114,7 +114,10 @@ if ($forum_data['forum_password'])
|
||||||
generate_forum_nav($forum_data);
|
generate_forum_nav($forum_data);
|
||||||
|
|
||||||
// Forum Rules
|
// Forum Rules
|
||||||
generate_forum_rules($forum_data);
|
if ($auth->acl_get('f_read', $forum_id))
|
||||||
|
{
|
||||||
|
generate_forum_rules($forum_data);
|
||||||
|
}
|
||||||
|
|
||||||
// Do we have subforums?
|
// Do we have subforums?
|
||||||
$active_forum_ary = $moderators = array();
|
$active_forum_ary = $moderators = array();
|
||||||
|
@ -144,6 +147,12 @@ if (!($forum_data['forum_type'] == FORUM_POST || (($forum_data['forum_flags'] &
|
||||||
page_footer();
|
page_footer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ok, if someone has only list-access, we only display the forum list
|
||||||
|
if (!$auth->acl_get('f_read', $forum_id))
|
||||||
|
{
|
||||||
|
page_footer();
|
||||||
|
}
|
||||||
|
|
||||||
// Handle marking posts
|
// Handle marking posts
|
||||||
if ($mark_read == 'topics')
|
if ($mark_read == 'topics')
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue