Index: trunk/phase3/includes/SpecialUnwatchedpages.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | |
24 | 24 | function getSQL() { |
25 | 25 | $dbr =& wfGetDB( DB_SLAVE ); |
26 | | - extract( $dbr->tableNames( 'page', 'watchlist' ) ); |
| 26 | + list( $page, $watchlist ) = $dbr->tableNamesN( 'page', 'watchlist' ); |
27 | 27 | $mwns = NS_MEDIAWIKI; |
28 | 28 | return |
29 | 29 | " |
Index: trunk/phase3/includes/Block.php |
— | — | @@ -308,7 +308,7 @@ |
309 | 309 | |
310 | 310 | $now = wfTimestampNow(); |
311 | 311 | |
312 | | - extract( $db->tableNames( 'ipblocks', 'user' ) ); |
| 312 | + list( $ipblocks, $user ) = $db->tableNamesN( 'ipblocks', 'user' ); |
313 | 313 | |
314 | 314 | $sql = "SELECT $ipblocks.*,user_name FROM $ipblocks,$user " . |
315 | 315 | "WHERE user_id=ipb_by $cond ORDER BY ipb_timestamp DESC $options"; |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -1034,7 +1034,7 @@ |
1035 | 1035 | |
1036 | 1036 | if ($wgPageShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' )) { |
1037 | 1037 | $dbr =& wfGetDB( DB_SLAVE ); |
1038 | | - extract( $dbr->tableNames( 'watchlist' ) ); |
| 1038 | + $watchlist = $dbr->tableName( 'watchlist' ); |
1039 | 1039 | $sql = "SELECT COUNT(*) AS n FROM $watchlist |
1040 | 1040 | WHERE wl_title='" . $dbr->strencode($wgTitle->getDBKey()) . |
1041 | 1041 | "' AND wl_namespace=" . $wgTitle->getNamespace() ; |
Index: trunk/phase3/includes/SpecialUnusedtemplates.php |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | |
25 | 25 | function getSQL() { |
26 | 26 | $dbr =& wfGetDB( DB_SLAVE ); |
27 | | - extract( $dbr->tableNames( 'page', 'templatelinks' ) ); |
| 27 | + list( $page, $templatelinks) = $dbr->tableNamesN( 'page', 'templatelinks' ); |
28 | 28 | $sql = "SELECT 'Unusedtemplates' AS type, page_title AS title, |
29 | 29 | page_namespace AS namespace, 0 AS value |
30 | 30 | FROM $page |
Index: trunk/phase3/includes/SpecialWantedcategories.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | |
24 | 24 | function getSQL() { |
25 | 25 | $dbr =& wfGetDB( DB_SLAVE ); |
26 | | - extract( $dbr->tableNames( 'categorylinks', 'page' ) ); |
| 26 | + list( $categorylinks, $page ) = $dbr->tableNamesN( 'categorylinks', 'page' ); |
27 | 27 | $name = $dbr->addQuotes( $this->getName() ); |
28 | 28 | return |
29 | 29 | " |
Index: trunk/phase3/includes/SpecialUnusedimages.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | $dbr =& wfGetDB( DB_SLAVE ); |
27 | 27 | |
28 | 28 | if ( $wgCountCategorizedImagesAsUsed ) { |
29 | | - extract( $dbr->tableNames( 'page', 'image', 'imagelinks', 'categorylinks' ) ); |
| 29 | + list( $page, $image, $imagelinks, $categorylinks ) = $dbr->tableNamesN( 'page', 'image', 'imagelinks', 'categorylinks' ); |
30 | 30 | |
31 | 31 | return 'SELECT img_name as title, img_user, img_user_text, img_timestamp as value, img_description |
32 | 32 | FROM ((('.$page.' AS I LEFT JOIN '.$categorylinks.' AS L ON I.page_id = L.cl_from) |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | INNER JOIN '.$image.' AS G ON I.page_title = G.img_name) |
35 | 35 | WHERE I.page_namespace = '.NS_IMAGE.' AND L.cl_from IS NULL AND P.il_to IS NULL'; |
36 | 36 | } else { |
37 | | - extract( $dbr->tableNames( 'image','imagelinks' ) ); |
| 37 | + list( $image, $imagelinks ) = $dbr->tableNamesN( 'image','imagelinks' ); |
38 | 38 | |
39 | 39 | return 'SELECT img_name as title, img_user, img_user_text, img_timestamp as value, img_description' . |
40 | 40 | ' FROM '.$image.' LEFT JOIN '.$imagelinks.' ON img_name=il_to WHERE il_to IS NULL '; |
Index: trunk/phase3/includes/Database.php |
— | — | @@ -1383,7 +1383,7 @@ |
1384 | 1384 | * $sql = "SELECT wl_namespace,wl_title FROM $watchlist,$user |
1385 | 1385 | * WHERE wl_user=user_id AND wl_user=$nameWithQuotes"; |
1386 | 1386 | */ |
1387 | | - function tableNames() { |
| 1387 | + public function tableNames() { |
1388 | 1388 | $inArray = func_get_args(); |
1389 | 1389 | $retVal = array(); |
1390 | 1390 | foreach ( $inArray as $name ) { |
— | — | @@ -1391,6 +1391,24 @@ |
1392 | 1392 | } |
1393 | 1393 | return $retVal; |
1394 | 1394 | } |
| 1395 | + |
| 1396 | + /** |
| 1397 | + * @desc: Fetch a number of table names into an zero-indexed numerical array |
| 1398 | + * This is handy when you need to construct SQL for joins |
| 1399 | + * |
| 1400 | + * Example: |
| 1401 | + * list( $user, $watchlist ) = $dbr->tableNames('user','watchlist'); |
| 1402 | + * $sql = "SELECT wl_namespace,wl_title FROM $watchlist,$user |
| 1403 | + * WHERE wl_user=user_id AND wl_user=$nameWithQuotes"; |
| 1404 | + */ |
| 1405 | + public function tableNamesN() { |
| 1406 | + $inArray = func_get_args(); |
| 1407 | + $retVal = array(); |
| 1408 | + foreach ( $inArray as $name ) { |
| 1409 | + $retVal[] = $this->tableName( $name ); |
| 1410 | + } |
| 1411 | + return $retVal; |
| 1412 | + } |
1395 | 1413 | |
1396 | 1414 | /** |
1397 | 1415 | * @private |
Index: trunk/phase3/includes/SpecialDeadendpages.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | */ |
45 | 45 | function getSQL() { |
46 | 46 | $dbr =& wfGetDB( DB_SLAVE ); |
47 | | - extract( $dbr->tableNames( 'page', 'pagelinks' ) ); |
| 47 | + list( $page, $pagelinks ) = $dbr->tableNamesN( 'page', 'pagelinks' ); |
48 | 48 | return "SELECT 'Deadendpages' as type, page_namespace AS namespace, page_title as title, page_title AS value " . |
49 | 49 | "FROM $page LEFT JOIN $pagelinks ON page_id = pl_from " . |
50 | 50 | "WHERE pl_from IS NULL " . |
Index: trunk/phase3/includes/SpecialRecentchangeslinked.php |
— | — | @@ -67,7 +67,8 @@ |
68 | 68 | $cmq = 'AND rc_minor=0'; |
69 | 69 | } else { $cmq = ''; } |
70 | 70 | |
71 | | - extract( $dbr->tableNames( 'recentchanges', 'categorylinks', 'pagelinks', 'revision', 'page' , "watchlist" ) ); |
| 71 | + list($recentchanges, $categorylinks, $pagelinks, $watchlist) = |
| 72 | + $dbr->tableNamesN( 'recentchanges', 'categorylinks', 'pagelinks', "watchlist" ); |
72 | 73 | |
73 | 74 | $uid = $wgUser->getID(); |
74 | 75 | |
Index: trunk/phase3/includes/SiteStats.php |
— | — | @@ -127,7 +127,7 @@ |
128 | 128 | # Update schema if required |
129 | 129 | if ( $row->ss_total_pages == -1 && !$this->mViews ) { |
130 | 130 | $dbr =& wfGetDB( DB_SLAVE, array( 'SpecialStatistics', 'vslow') ); |
131 | | - extract( $dbr->tableNames( 'page', 'user' ) ); |
| 131 | + list( $page, $user ) = $dbr->tableNamesN( 'page', 'user' ); |
132 | 132 | |
133 | 133 | $sql = "SELECT COUNT(page_namespace) AS total FROM $page"; |
134 | 134 | $res = $dbr->query( $sql, $fname ); |
Index: trunk/phase3/includes/SpecialMostrevisions.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | |
24 | 24 | function getSQL() { |
25 | 25 | $dbr =& wfGetDB( DB_SLAVE ); |
26 | | - extract( $dbr->tableNames( 'revision', 'page' ) ); |
| 26 | + list( $revision, $page ) = $dbr->tableNamesN( 'revision', 'page' ); |
27 | 27 | return |
28 | 28 | " |
29 | 29 | SELECT |
Index: trunk/phase3/includes/SpecialMostcategories.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | |
22 | 22 | function getSQL() { |
23 | 23 | $dbr =& wfGetDB( DB_SLAVE ); |
24 | | - extract( $dbr->tableNames( 'categorylinks', 'page' ) ); |
| 24 | + list( $categorylinks, $page) = $dbr->tableNamesN( 'categorylinks', 'page' ); |
25 | 25 | return |
26 | 26 | " |
27 | 27 | SELECT |
Index: trunk/phase3/includes/SpecialMostimages.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | |
22 | 22 | function getSQL() { |
23 | 23 | $dbr =& wfGetDB( DB_SLAVE ); |
24 | | - extract( $dbr->tableNames( 'imagelinks' ) ); |
| 24 | + $imagelinks = $dbr->tableName( 'imagelinks' ); |
25 | 25 | return |
26 | 26 | " |
27 | 27 | SELECT |
Index: trunk/phase3/includes/SpecialWhatlinkshere.php |
— | — | @@ -76,8 +76,6 @@ |
77 | 77 | |
78 | 78 | $dbr =& wfGetDB( DB_READ ); |
79 | 79 | |
80 | | - extract( $dbr->tableNames( 'pagelinks', 'templatelinks', 'page' ) ); |
81 | | - |
82 | 80 | // Some extra validation |
83 | 81 | $from = intval( $from ); |
84 | 82 | if ( !$from && $dir == 'prev' ) { |
Index: trunk/phase3/includes/SpecialRecentchanges.php |
— | — | @@ -108,7 +108,7 @@ |
109 | 109 | |
110 | 110 | # Database connection and caching |
111 | 111 | $dbr =& wfGetDB( DB_SLAVE ); |
112 | | - extract( $dbr->tableNames( 'recentchanges', 'watchlist' ) ); |
| 112 | + list( $recentchanges, $watchlist ) = $dbr->tableNamesN( 'recentchanges', 'watchlist' ); |
113 | 113 | |
114 | 114 | |
115 | 115 | $cutoff_unixtime = time() - ( $days * 86400 ); |
Index: trunk/phase3/includes/SpecialLonelypages.php |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | |
32 | 32 | function getSQL() { |
33 | 33 | $dbr =& wfGetDB( DB_SLAVE ); |
34 | | - extract( $dbr->tableNames( 'page', 'pagelinks' ) ); |
| 34 | + list( $page, $pagelinks ) = $dbr->tableNamesN( 'page', 'pagelinks' ); |
35 | 35 | |
36 | 36 | return |
37 | 37 | "SELECT 'Lonelypages' AS type, |
Index: trunk/phase3/includes/SpecialUncategorizedpages.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | |
30 | 30 | function getSQL() { |
31 | 31 | $dbr =& wfGetDB( DB_SLAVE ); |
32 | | - extract( $dbr->tableNames( 'page', 'categorylinks' ) ); |
| 32 | + list( $page, $categorylinks ) = $dbr->tableNamesN( 'page', 'categorylinks' ); |
33 | 33 | $name = $dbr->addQuotes( $this->getName() ); |
34 | 34 | |
35 | 35 | return |
Index: trunk/phase3/includes/SpecialContributions.php |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | list( $index, $usercond ) = $this->getUserCond(); |
33 | 33 | $nscond = $this->getNamespaceCond(); |
34 | 34 | $use_index = $this->dbr->useIndexClause( $index ); |
35 | | - extract( $this->dbr->tableNames( 'revision', 'page' ) ); |
| 35 | + list( $revision, $page) = $this->dbr->tableNamesN( 'revision', 'page' ); |
36 | 36 | $sql = "SELECT rev_timestamp " . |
37 | 37 | " FROM $page,$revision $use_index " . |
38 | 38 | " WHERE rev_page=page_id AND $usercond $nscond" . |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | $nscond = $this->getNamespaceCond(); |
84 | 84 | |
85 | 85 | $use_index = $this->dbr->useIndexClause( $index ); |
86 | | - extract( $this->dbr->tableNames( 'page', 'revision' ) ); |
| 86 | + list( $page, $revision ) = $this->dbr->tableNamesN( 'page', 'revision' ); |
87 | 87 | |
88 | 88 | $sql = "SELECT rev_timestamp FROM $page, $revision $use_index " . |
89 | 89 | "WHERE page_id = rev_page AND rev_timestamp > '" . $this->offset . "' AND " . |
— | — | @@ -106,7 +106,7 @@ |
107 | 107 | function getFirstOffsetForPaging() { |
108 | 108 | list( $index, $usercond ) = $this->getUserCond(); |
109 | 109 | $use_index = $this->dbr->useIndexClause( $index ); |
110 | | - extract( $this->dbr->tableNames( 'page', 'revision' ) ); |
| 110 | + list( $page, $revision ) = $this->dbr->tableNamesN( 'page', 'revision' ); |
111 | 111 | $nscond = $this->getNamespaceCond(); |
112 | 112 | $sql = "SELECT rev_timestamp FROM $page, $revision $use_index " . |
113 | 113 | "WHERE page_id = rev_page AND " . |
— | — | @@ -128,9 +128,9 @@ |
129 | 129 | } |
130 | 130 | |
131 | 131 | /* private */ function makeSql() { |
132 | | - $userCond = $condition = $index = $offsetQuery = ''; |
| 132 | + $offsetQuery = ''; |
133 | 133 | |
134 | | - extract( $this->dbr->tableNames( 'page', 'revision' ) ); |
| 134 | + list( $page, $revision ) = $this->dbr->tableNamesN( 'page', 'revision' ); |
135 | 135 | list( $index, $userCond ) = $this->getUserCond(); |
136 | 136 | |
137 | 137 | if ( $this->offset ) |
Index: trunk/phase3/includes/UserMailer.php |
— | — | @@ -248,7 +248,6 @@ |
249 | 249 | } |
250 | 250 | if( $userCondition ) { |
251 | 251 | $dbr =& wfGetDB( DB_MASTER ); |
252 | | - extract( $dbr->tableNames( 'watchlist' ) ); |
253 | 252 | |
254 | 253 | $res = $dbr->select( 'watchlist', array( 'wl_user' ), |
255 | 254 | array( |
Index: trunk/phase3/includes/SpecialUnusedcategories.php |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | function getSQL() { |
25 | 25 | $NScat = NS_CATEGORY; |
26 | 26 | $dbr =& wfGetDB( DB_SLAVE ); |
27 | | - extract( $dbr->tableNames( 'categorylinks','page' )); |
| 27 | + list( $categorylinks, $page ) = $dbr->tableNamesN( 'categorylinks', 'page' ); |
28 | 28 | return "SELECT 'Unusedcategories' as type, |
29 | 29 | {$NScat} as namespace, page_title as title, 1 as value |
30 | 30 | FROM $page |
Index: trunk/phase3/includes/SpecialUncategorizedimages.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | |
30 | 30 | function getSQL() { |
31 | 31 | $dbr =& wfGetDB( DB_SLAVE ); |
32 | | - extract( $dbr->tableNames( 'page', 'categorylinks' ) ); |
| 32 | + list( $page, $categorylinks ) = $dbr->tableNamesN( 'page', 'categorylinks' ); |
33 | 33 | $ns = NS_IMAGE; |
34 | 34 | |
35 | 35 | return "SELECT 'Uncategorizedimages' AS type, page_namespace AS namespace, |
Index: trunk/phase3/includes/SpecialWatchlist.php |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | } |
115 | 115 | |
116 | 116 | $dbr =& wfGetDB( DB_SLAVE ); |
117 | | - extract( $dbr->tableNames( 'page', 'revision', 'watchlist', 'recentchanges' ) ); |
| 117 | + list( $page, $watchlist, $recentchanges ) = $dbr->tableNamesN( 'page', 'watchlist', 'recentchanges' ); |
118 | 118 | |
119 | 119 | $sql = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_user=$uid"; |
120 | 120 | $res = $dbr->query( $sql, $fname ); |
Index: trunk/phase3/includes/SpecialMostlinked.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | */ |
30 | 30 | function getSQL() { |
31 | 31 | $dbr =& wfGetDB( DB_SLAVE ); |
32 | | - extract( $dbr->tableNames( 'pagelinks', 'page' ) ); |
| 32 | + list( $pagelinks, $page ) = $dbr->tableNamesN( 'pagelinks', 'page' ); |
33 | 33 | return |
34 | 34 | "SELECT 'Mostlinked' AS type, |
35 | 35 | pl_namespace AS namespace, |
Index: trunk/phase3/includes/SpecialDoubleRedirects.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | |
28 | 28 | function getSQLText( &$dbr, $namespace = null, $title = null ) { |
29 | 29 | |
30 | | - extract( $dbr->tableNames( 'page', 'pagelinks' ) ); |
| 30 | + list( $page, $pagelinks ) = $dbr->tableNamesN( 'page', 'pagelinks' ); |
31 | 31 | |
32 | 32 | $limitToTitle = !( $namespace === null && $title === null ); |
33 | 33 | $sql = $limitToTitle ? "SELECT" : "SELECT 'DoubleRedirects' as type," ; |
Index: trunk/phase3/includes/SpecialMostlinkedcategories.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | |
24 | 24 | function getSQL() { |
25 | 25 | $dbr =& wfGetDB( DB_SLAVE ); |
26 | | - extract( $dbr->tableNames( 'categorylinks', 'page' ) ); |
| 26 | + $categorylinks = $dbr->tableName( 'categorylinks' ); |
27 | 27 | $name = $dbr->addQuotes( $this->getName() ); |
28 | 28 | return |
29 | 29 | " |
Index: trunk/phase3/includes/api/ApiQueryLogEvents.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | |
43 | 43 | $db = & $this->getDB(); |
44 | 44 | |
45 | | - extract($db->tableNames('logging', 'page', 'user'), EXTR_PREFIX_ALL, 'tbl'); |
| 45 | + list($tbl_logging, $tbl_page, $tbl_user) = $db->tableNamesN('logging', 'page', 'user'); |
46 | 46 | |
47 | 47 | $this->addOption('STRAIGHT_JOIN'); |
48 | 48 | $this->addTables("$tbl_logging LEFT OUTER JOIN $tbl_page ON " . |
Index: trunk/phase3/includes/api/ApiQueryUserContributions.php |
— | — | @@ -54,8 +54,8 @@ |
55 | 55 | if (!$userid) |
56 | 56 | $this->dieUsage("User name $user not found", 'param_user'); |
57 | 57 | |
58 | | - //Extract the table names, in case we have a prefix |
59 | | - extract($db->tableNames( 'page', 'revision'), EXTR_PREFIX_ALL, 'tbl'); |
| 58 | + //Get the table names |
| 59 | + list ($tbl_page, $tbl_revision) = $db->tableNamesN('page', 'revision'); |
60 | 60 | |
61 | 61 | //We're after the revision table, and the corresponding page row for |
62 | 62 | //anything we retrieve. |
Index: trunk/phase3/includes/SpecialUndelete.php |
— | — | @@ -278,12 +278,12 @@ |
279 | 279 | * @return int number of revisions restored |
280 | 280 | */ |
281 | 281 | private function undeleteRevisions( $timestamps ) { |
282 | | - global $wgParser, $wgDBtype; |
| 282 | + global $wgDBtype; |
283 | 283 | |
284 | 284 | $restoreAll = empty( $timestamps ); |
285 | 285 | |
286 | 286 | $dbw =& wfGetDB( DB_MASTER ); |
287 | | - extract( $dbw->tableNames( 'page', 'archive' ) ); |
| 287 | + $page = $dbw->tableName( 'archive' ); |
288 | 288 | |
289 | 289 | # Does this page already exist? We'll have to update it... |
290 | 290 | $article = new Article( $this->title ); |
— | — | @@ -453,6 +453,7 @@ |
454 | 454 | $timestamps = array(); |
455 | 455 | $this->mFileVersions = array(); |
456 | 456 | foreach( $_REQUEST as $key => $val ) { |
| 457 | + $matches = array(); |
457 | 458 | if( preg_match( '/^ts(\d{14})$/', $key, $matches ) ) { |
458 | 459 | array_push( $timestamps, $matches[1] ); |
459 | 460 | } |
Index: trunk/phase3/includes/SpecialNewpages.php |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | global $wgUser, $wgUseRCPatrol; |
44 | 44 | $usepatrol = ( $wgUseRCPatrol && $wgUser->isAllowed( 'patrol' ) ) ? 1 : 0; |
45 | 45 | $dbr =& wfGetDB( DB_SLAVE ); |
46 | | - extract( $dbr->tableNames( 'recentchanges', 'page', 'text' ) ); |
| 46 | + list( $recentchanges, $page ) = $dbr->tableNamesN( 'recentchanges', 'page' ); |
47 | 47 | |
48 | 48 | $uwhere = $this->makeUserWhere( $dbr ); |
49 | 49 | |
— | — | @@ -172,6 +172,7 @@ |
173 | 173 | if ( is_numeric( $bit ) ) |
174 | 174 | $limit = $bit; |
175 | 175 | |
| 176 | + $m = array(); |
176 | 177 | if ( preg_match( '/^limit=(\d+)$/', $bit, $m ) ) |
177 | 178 | $limit = intval($m[1]); |
178 | 179 | if ( preg_match( '/^offset=(\d+)$/', $bit, $m ) ) |
Index: trunk/phase3/includes/Image.php |
— | — | @@ -1702,7 +1702,7 @@ |
1703 | 1703 | } |
1704 | 1704 | $linkCache =& LinkCache::singleton(); |
1705 | 1705 | |
1706 | | - extract( $db->tableNames( 'page', 'imagelinks' ) ); |
| 1706 | + list( $page, $imagelinks ) = $db->tableNamesN( 'page', 'imagelinks' ); |
1707 | 1707 | $encName = $db->addQuotes( $this->name ); |
1708 | 1708 | $sql = "SELECT page_namespace,page_title,page_id FROM $page,$imagelinks WHERE page_id=il_from AND il_to=$encName $options"; |
1709 | 1709 | $res = $db->query( $sql, __METHOD__ ); |
Index: trunk/phase3/includes/SpecialBrokenRedirects.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | |
29 | 29 | function getSQL() { |
30 | 30 | $dbr =& wfGetDB( DB_SLAVE ); |
31 | | - extract( $dbr->tableNames( 'page', 'pagelinks' ) ); |
| 31 | + list( $page, $pagelinks ) = $dbr->tableNamesN( 'page', 'pagelinks' ); |
32 | 32 | |
33 | 33 | $sql = "SELECT 'BrokenRedirects' AS type, |
34 | 34 | p1.page_namespace AS namespace, |
Index: trunk/phase3/includes/SpecialStatistics.php |
— | — | @@ -15,7 +15,6 @@ |
16 | 16 | $action = $wgRequest->getVal( 'action' ); |
17 | 17 | |
18 | 18 | $dbr =& wfGetDB( DB_SLAVE ); |
19 | | - extract( $dbr->tableNames( 'site_stats', 'user', 'user_groups' ) ); |
20 | 19 | |
21 | 20 | $views = SiteStats::views(); |
22 | 21 | $edits = SiteStats::edits(); |
— | — | @@ -59,6 +58,7 @@ |
60 | 59 | |
61 | 60 | global $wgDisableCounters, $wgMiserMode, $wgUser, $wgLang, $wgContLang; |
62 | 61 | if( !$wgDisableCounters && !$wgMiserMode ) { |
| 62 | + $page = $dbr->tableName( 'page' ); |
63 | 63 | $sql = "SELECT page_namespace, page_title, page_counter FROM {$page} WHERE page_is_redirect = 0 AND page_counter > 0 ORDER BY page_counter DESC"; |
64 | 64 | $sql = $dbr->limitResult($sql, 10, 0); |
65 | 65 | $res = $dbr->query( $sql, $fname ); |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -54,6 +54,7 @@ |
55 | 55 | |
56 | 56 | $value = wfMsg( $value ); |
57 | 57 | // interpolate variables |
| 58 | + $m = array(); |
58 | 59 | while (preg_match('/\$([0-9]*?)/sm', $value, $m)) { |
59 | 60 | list($src, $var) = $m; |
60 | 61 | wfSuppressWarnings(); |
— | — | @@ -344,7 +345,7 @@ |
345 | 346 | |
346 | 347 | if ($wgPageShowWatchingUsers) { |
347 | 348 | $dbr =& wfGetDB( DB_SLAVE ); |
348 | | - extract( $dbr->tableNames( 'watchlist' ) ); |
| 349 | + $watchlist = $dbr->tableName( 'watchlist' ); |
349 | 350 | $sql = "SELECT COUNT(*) AS n FROM $watchlist |
350 | 351 | WHERE wl_title='" . $dbr->strencode($this->mTitle->getDBKey()) . |
351 | 352 | "' AND wl_namespace=" . $this->mTitle->getNamespace() ; |