View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0003363 | mantisbt | bugtracker | public | 2003-09-17 03:27 | 2003-12-13 04:35 |
| Reporter | aarjona | Assigned To | aarjona | ||
| Priority | normal | Severity | feature | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Summary | 0003363: Fatal error when the wrong database is specified. | ||||
| Description | The $g_dbconnected variable is not set to false before triggering the error handler, so the html* functions attempt to display db-related content. | ||||
| Tags | No tags attached. | ||||
| Attached Files | mantis_issue_3363.patch (787 bytes)
Index: core/database_api.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/database_api.php,v
retrieving revision 1.17
diff -u -r1.17 database_api.php
--- core/database_api.php 19 Feb 2003 18:06:07 -0000 1.17
+++ core/database_api.php 17 Sep 2003 01:28:16 -0000
@@ -92,10 +92,16 @@
# --------------------
function db_select_db( $p_db_name ) {
+ global $g_db_connected;
$t_result = @mysql_select_db( $p_db_name );
if ( !$t_result ) {
db_error();
+ db_close();
+ # we got the wrong database so we're basically not connected.
+ # this prevents the html functions from trying to display db stuff
+ $g_db_connected = false;
+
trigger_error( ERROR_DB_SELECT_FAILED, ERROR );
return false;
}
| ||||
|
MantisBT: master 1df1ce17 2003-09-16 21:32 beerfrick Details Diff |
Issue 0003363: Fatal error when the wrong database is specified. Modified Files: core/database_api.php ---------------------------------------------------------------------- git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2265 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9 |
Affected Issues 0003363 |
|
| mod - core/database_api.php | Diff File | ||