From e86112a487b28a8d75555aa39fcad6bd1b5259c0 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 18 Jun 2015 15:50:33 +0530 Subject: [PATCH] Remove more instances of GLOBALS['db'] usages Signed-off-by: Madhura Jayaratne --- .../plugins/schema/pdf/Pdf_Relation_Schema.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libraries/plugins/schema/pdf/Pdf_Relation_Schema.class.php b/libraries/plugins/schema/pdf/Pdf_Relation_Schema.class.php index 018ca18c10..c7bbb0d6be 100644 --- a/libraries/plugins/schema/pdf/Pdf_Relation_Schema.class.php +++ b/libraries/plugins/schema/pdf/Pdf_Relation_Schema.class.php @@ -56,6 +56,7 @@ class PMA_Schema_PDF extends PMA_PDF private $_offline; private $_pageNumber; private $_withDoc; + private $_db; /** * Constructs PDF for schema export. @@ -65,15 +66,17 @@ class PMA_Schema_PDF extends PMA_PDF * @param string $paper the format used for pages * @param int $pageNumber schema page number that is being exported * @param boolean $withDoc with document dictionary + * @param string $db the database name * * @access public */ public function __construct( - $orientation, $unit, $paper, $pageNumber, $withDoc + $orientation, $unit, $paper, $pageNumber, $withDoc, $db ) { parent::__construct($orientation, $unit, $paper); $this->_pageNumber = $pageNumber; $this->_withDoc = $withDoc; + $this->_db = $db; } /** @@ -254,7 +257,7 @@ class PMA_Schema_PDF extends PMA_PDF $test_query = 'SELECT * FROM ' . PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_Util::backquote($GLOBALS['cfgRelation']['pdf_pages']) - . ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($GLOBALS['db']) + . ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($this->_db) . '\' AND page_nr = \'' . $this->_pageNumber . '\''; $test_rs = PMA_queryAsControlUser($test_query); $pages = @$GLOBALS['dbi']->fetchAssoc($test_rs); @@ -474,7 +477,7 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema $db, new PMA_Schema_PDF( $this->orientation, 'mm', $this->paper, - $this->pageNumber, $this->_withDoc + $this->pageNumber, $this->_withDoc, $db ) ); $this->diagram->SetTitle(