mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
- Optimize acl_getf_global a bit
- a little performance improvement of the IP regular expressions - convert post_text/subject collation to utf8_unicode_ci if a user wants to use mysql_fulltext to allow case insensitivity [Bug #6272] - mysql_fulltext should alter all necessary columns at once to speed up the process - validate URLs against RFC3986 - fixed some weirdness in make_clickable I hope I didn't break any URLs with this commit, if I did then report it to the bugtracker please! git-svn-id: file:///svn/phpbb/trunk@6774 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -639,14 +639,29 @@ class fulltext_mysql extends search_backend
|
||||
$this->get_stats();
|
||||
}
|
||||
|
||||
$alter = array();
|
||||
|
||||
if (!isset($this->stats['post_subject']))
|
||||
{
|
||||
$db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ADD FULLTEXT (post_subject)');
|
||||
if (version_compare($db->mysql_version, '4.1.3', '>='))
|
||||
{
|
||||
$alter[] = 'MODIFY post_subject varchar(100) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL';
|
||||
}
|
||||
$alter[] = 'ADD FULLTEXT (post_subject)';
|
||||
}
|
||||
|
||||
if (!isset($this->stats['post_text']))
|
||||
{
|
||||
$db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ADD FULLTEXT (post_text)');
|
||||
if (version_compare($db->mysql_version, '4.1.3', '>='))
|
||||
{
|
||||
$alter[] = 'MODIFY post_text mediumtext COLLATE utf8_unicode_ci NOT NULL';
|
||||
}
|
||||
$alter[] = 'ADD FULLTEXT (post_text)';
|
||||
}
|
||||
|
||||
if (sizeof($alter))
|
||||
{
|
||||
$db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter));
|
||||
}
|
||||
|
||||
$db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
|
||||
@@ -672,14 +687,21 @@ class fulltext_mysql extends search_backend
|
||||
$this->get_stats();
|
||||
}
|
||||
|
||||
$alter = array();
|
||||
|
||||
if (isset($this->stats['post_subject']))
|
||||
{
|
||||
$db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' DROP INDEX post_subject');
|
||||
$alter[] = 'DROP INDEX post_subject';
|
||||
}
|
||||
|
||||
if (isset($this->stats['post_text']))
|
||||
{
|
||||
$db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' DROP INDEX post_text');
|
||||
$alter[] = 'DROP INDEX post_text';
|
||||
}
|
||||
|
||||
if (sizeof($alter))
|
||||
{
|
||||
$db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter));
|
||||
}
|
||||
|
||||
$db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
|
||||
|
Reference in New Issue
Block a user