Version 2.2.2

This commit is contained in:
Neo committed 2025-12-19 00:24:35 -08:00
1 parent 22f1b963ee
commit a3bb603c96
858 files changed
+479463 -188140

No files matched your search

+47 -9
View File
@@ -3,15 +3,22 @@
/*
+--------------------------------------------------------------------------
| Invision Power Services Kernel [DB Abstraction]
| Invision Power Board
| Invision Power Board 2.2.2
| =============================================
| by Matthew Mecham
| (c) 2001 - 2006 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Monday 05th of March 2007 10:10:55 PM
| Release: e3790216629e5a2aaf37070b32237f06
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| THIS IS NOT FREE / OPEN SOURCE SOFTWARE
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
|
| > MySQLi Driver Module
@@ -145,10 +152,31 @@ class db_driver_mysql extends db_main
$this->fatal_error();
return FALSE;
}
$this->sql_set_collation_and_cp();
return TRUE;
}
function sql_set_collation_and_cp()
{
$this->sql_get_version();
if ( $this->mysql_version >= 40101 )
{
$res = mysql_query( "SHOW CHARSET LIKE '" . $this->obj['mysql_codepage'] . "'", $this->connection_id );
$charset = mysql_fetch_row($res);
mysql_query( "SET NAMES " . $this->obj['mysql_codepage'], $this->connection_id );
mysql_query( "SET CHARACTER SET " . $this->obj['mysql_codepage'], $this->connection_id );
mysql_query( "SET character_set_connection = " . $this->obj['mysql_codepage'], $this->connection_id );
mysql_query( "SET collation_connection = " . $charset[2], $this->connection_id );
}
return TRUE;
}
function sql_can_subquery()
{
$this->sql_get_version();
@@ -260,7 +288,7 @@ class db_driver_mysql extends db_main
// SIMPLE: UPDATE
/*-------------------------------------------------------------------------*/
function simple_update( $tbl, $set, $where, $low_pro='' )
function simple_update( $tbl, $set, $where='', $low_pro='' )
{
if ( $low_pro )
{
@@ -279,7 +307,7 @@ class db_driver_mysql extends db_main
// SIMPLE: DELETE
/*-------------------------------------------------------------------------*/
function simple_delete( $tbl, $where )
function simple_delete( $tbl, $where='' )
{
if( !$where )
{
@@ -526,16 +554,22 @@ class db_driver_mysql extends db_main
{
$_tmp = strtolower( $this->remove_all_quotes($the_query) );
if ( preg_match( "#(?:/\*|\*/)#i", $_tmp ) )
{
$this->fatal_error( "Íàñòðîéêè äðàéâåðà íå äîïóñêàþò èñïîëüçîâàíèå êîììåíòàðèåâ â SQL çàïðîñå.\nÈçìåíèòå àòðèáóò allow_sub_select íà 1 ó îáúåêòà äðàéâåðà äëÿ âûêëþ÷åíèÿ ýòîé ïðîâåðêè." );
return false;
}
if ( preg_match( "#[^_a-zA-Z]union[^_a-zA-Z]#s", $_tmp ) )
{
$this->fatal_error( "UNION query joins are not allowed.\nAdd \$DB->allow_sub_select=1; before any query construct to allow them" );
$this->fatal_error( "Íàñòðîéêè äðàéâåðà íå ïîçâîëÿþò èñïîëüçîâàòü UNION-çàïðîñû.\nÈçìåíèòå àòðèáóò allow_sub_select íà 1 ó îáúåêòà äðàéâåðà äëÿ âûêëþ÷åíèÿ ýòîé ïðîâåðêè." );
return false;
}
else if ( preg_match_all( "#[^_a-zA-Z](select)[^_a-zA-Z]#s", $_tmp, $matches ) )
{
if ( count( $matches ) > 1 )
{
$this->fatal_error( "SUB SELECT query joins are not allowed.\nAdd \$DB->allow_sub_select=1; before any query construct to allow them" );
$this->fatal_error( "Íàñòðîéêè äðàéâåðà íå ïîçâîëÿþò èñïîëüçîâàòü âëîæåííûå SELECT â çàïðîñàõ.\nÈçìåíèòå àòðèáóò allow_sub_select íà 1 ó îáúåêòà äðàéâåðà äëÿ âûêëþ÷åíèÿ ýòîé ïðîâåðêè." );
return false;
}
}
@@ -557,7 +591,7 @@ class db_driver_mysql extends db_main
if (! $this->query_id )
{
$this->fatal_error("mySQL query error: $the_query");
$this->fatal_error($the_query);
}
//-----------------------------------------
@@ -588,6 +622,10 @@ class db_driver_mysql extends db_main
$this->write_debug_log( $query, $_data, $endtime );
}
else
{
$this->write_debug_log( $the_query, $_data, $endtime );
}
}
else if ( $this->obj['debug'] )
{
@@ -926,7 +964,7 @@ class db_driver_mysql extends db_main
$return = 0;
if( in_array( SQL_PREFIX.$table, $table_names ) )
if ( in_array( SQL_PREFIX.$table, $table_names ) )
{
$return = 1;
}