(bug 7098) Add an option to disable/enable sending of HTTP ETag headers,
[lhc/web/wiklou.git] / includes / SpecialUncategorizedpages.php
old mode 100755 (executable)
new mode 100644 (file)
index b8d2cd9..0ecc5d0
@@ -5,19 +5,14 @@
  * @subpackage SpecialPage
  */
 
-/**
- *
- */
-require_once( "QueryPage.php" );
-
 /**
  *
  * @package MediaWiki
  * @subpackage SpecialPage
  */
 class UncategorizedPagesPage extends PageQueryPage {
-       var $requestedNamespace = 0;
-       
+       var $requestedNamespace = NS_MAIN;
+
        function getName() {
                return "Uncategorizedpages";
        }
@@ -30,14 +25,23 @@ class UncategorizedPagesPage extends PageQueryPage {
                return true;
        }
        function isSyndicated() { return false; }
-       
+
        function getSQL() {
                $dbr =& wfGetDB( DB_SLAVE );
-               extract( $dbr->tableNames( 'cur', 'categorylinks' ) );
-
-               return "SELECT 'Uncategorizedpages' as type, cur_namespace AS namespace, cur_title AS title, cur_title AS value " .
-                       "FROM $cur LEFT JOIN $categorylinks ON cur_id=cl_from ".
-                       "WHERE cl_from IS NULL AND cur_namespace=$this->requestedNamespace AND cur_is_redirect=0";
+               extract( $dbr->tableNames( 'page', 'categorylinks' ) );
+               $name = $dbr->addQuotes( $this->getName() );
+
+               return
+                       "
+                       SELECT
+                               $name as type,
+                               page_namespace AS namespace,
+                               page_title AS title,
+                               page_title AS value
+                       FROM $page
+                       LEFT JOIN $categorylinks ON page_id=cl_from
+                       WHERE cl_from IS NULL AND page_namespace={$this->requestedNamespace} AND page_is_redirect=0
+                       ";
        }
 }