Index: trunk/extensions/FCKeditor/FCKeditorSajax.body.php |
— | — | @@ -198,15 +198,13 @@ |
199 | 199 | $limit = 50; |
200 | 200 | $ns = NS_CATEGORY; |
201 | 201 | $dbr = wfGetDB( DB_SLAVE ); |
202 | | - $res = $dbr->select( |
203 | | - array( 'categorylinks', 'page' ), |
204 | | - array( 'page_title AS title' ), |
205 | | - array( 'cl_to LIKE ' . $dbr->escapeLike( $m_root ), "page_namespace = $ns" ), |
206 | | - __METHOD__, |
207 | | - array(), |
208 | | - array( 'page' => array( 'LEFT JOIN', 'cl_from = page_id' ) ) |
209 | | - ); |
| 202 | + /// @todo FIXME: should use Database class |
| 203 | + $m_root = str_replace( "'", "\'", $m_root ); |
| 204 | + $sql = "SELECT tmpSelectCatPage.page_title AS title FROM ".$dbr->tableName('categorylinks')." AS tmpSelectCat ". |
| 205 | + "LEFT JOIN ".$dbr->tableName('page')." AS tmpSelectCatPage ON tmpSelectCat.cl_from = tmpSelectCatPage.page_id ". |
| 206 | + "WHERE tmpSelectCat.cl_to LIKE '$m_root' AND tmpSelectCatPage.page_namespace = $ns"; |
210 | 207 | |
| 208 | + $res = $dbr->query( $sql, __METHOD__ ); |
211 | 209 | $ret = ''; |
212 | 210 | $i = 0; |
213 | 211 | while ( ( $row = $dbr->fetchObject( $res ) ) ) { |