mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
HTML stuff
git-svn-id: file:///svn/phpbb/trunk@3013 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
7366bd9e41
commit
97de599ae8
1 changed files with 17 additions and 37 deletions
|
@ -74,9 +74,6 @@ class parse_message
|
|||
unset($matches);
|
||||
}
|
||||
|
||||
// Specialchars message here ... ?
|
||||
// $message = htmlspecialchars($message, ENT_COMPAT, $user->lang['ENCODING']);
|
||||
|
||||
if ($warn_msg)
|
||||
{
|
||||
return $warn_msg;
|
||||
|
@ -93,24 +90,20 @@ class parse_message
|
|||
|
||||
function html(&$message, $html)
|
||||
{
|
||||
global $config, $user;
|
||||
global $config;
|
||||
|
||||
$message = str_replace(array('<', '>'), array('<', '>'), $message);
|
||||
|
||||
if ($html)
|
||||
{
|
||||
// If $html is true then "allowed_tags" are converted back from entity
|
||||
// form, others remain
|
||||
$allowed_tags = split(',', str_replace(' ', '', $config['allow_html_tags']));
|
||||
$allowed_tags = split(',', $config['allow_html_tags']);
|
||||
|
||||
$match = array();
|
||||
$replace = array();
|
||||
|
||||
foreach ($allowed_tags as $tag)
|
||||
if (sizeof($allowed_tags))
|
||||
{
|
||||
$match[] = '#<(\/?' . str_replace('*', '.*?', $tag) . ')>#i';
|
||||
$replace[] = '<\1>';
|
||||
$message = preg_replace('#<(\/?)(' . str_replace('*', '.*?', implode('|', $allowed_tags)) . ')>#is', '<\1\2>', $message);
|
||||
}
|
||||
|
||||
$message = preg_replace($match, $replace, $message);
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -188,15 +181,6 @@ class parse_message
|
|||
$allowed_ext = explode(',', $config['attach_ext']);
|
||||
}
|
||||
|
||||
function smiley_sort($a, $b)
|
||||
{
|
||||
if ( strlen($a['code']) == strlen($b['code']) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ( strlen($a['code']) > strlen($b['code']) ) ? -1 : 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Parses a given message and updates/maintains the fulltext tables
|
||||
|
@ -395,10 +379,8 @@ class fulltext_search
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Tidy up indexes, tag 'common words', remove
|
||||
// words no longer referenced in the match table, etc.
|
||||
//
|
||||
function search_tidy()
|
||||
{
|
||||
global $db;
|
||||
|
@ -452,19 +434,17 @@ class fulltext_search
|
|||
$in_sql .= ', ' . $row['word_id'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'DELETE FROM ' . SEARCH_WORD_TABLE . '
|
||||
WHERE word_id IN (' . substr($in_sql, 1) . ')';
|
||||
WHERE word_id IN (' . substr($in_sql, 2) . ')';
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Fill smiley templates (or just the variables) with smileys
|
||||
// Either in a window or inline
|
||||
//
|
||||
function generate_smilies($mode)
|
||||
{
|
||||
global $SID, $auth, $db, $user, $config, $template;
|
||||
|
|
Loading…
Add table
Reference in a new issue