API: Remove explicit profiling
[lhc/web/wiklou.git] / includes / api / ApiQueryBase.php
index b1581f3..1d4cff9 100644 (file)
@@ -70,6 +70,10 @@ abstract class ApiQueryBase extends ApiBase {
        /**
         * Override this method to request extra fields from the pageSet
         * using $pageSet->requestField('fieldName')
+        *
+        * Note this only makes sense for 'prop' modules, as 'list' and 'meta'
+        * modules should not be using the pageset.
+        *
         * @param ApiPageSet $pageSet
         */
        public function requestExtraData( $pageSet ) {
@@ -368,12 +372,7 @@ abstract class ApiQueryBase extends ApiBase {
                        isset( $extraQuery['join_conds'] ) ? (array)$extraQuery['join_conds'] : array()
                );
 
-               // getDB has its own profileDBIn/Out calls
-               $db = $this->getDB();
-
-               $this->profileDBIn();
-               $res = $db->select( $tables, $fields, $where, $method, $options, $join_conds );
-               $this->profileDBOut();
+               $res = $this->getDB()->select( $tables, $fields, $where, $method, $options, $join_conds );
 
                return $res;
        }
@@ -509,7 +508,8 @@ abstract class ApiQueryBase extends ApiBase {
         */
        public function titlePartToKey( $titlePart, $namespace = NS_MAIN ) {
                $t = Title::makeTitleSafe( $namespace, $titlePart . 'x' );
-               if ( !$t ) {
+               if ( !$t || $t->hasFragment() ) {
+                       // Invalid title (e.g. bad chars) or contained a '#'.
                        $this->dieUsageMsg( array( 'invalidtitle', $titlePart ) );
                }
                if ( $namespace != $t->getNamespace() || $t->isExternal() ) {
@@ -585,7 +585,6 @@ abstract class ApiQueryBase extends ApiBase {
        protected function checkRowCount() {
                wfDeprecated( __METHOD__, '1.24' );
                $db = $this->getDB();
-               $this->profileDBIn();
                $rowcount = $db->estimateRowCount(
                        $this->tables,
                        $this->fields,
@@ -593,7 +592,6 @@ abstract class ApiQueryBase extends ApiBase {
                        __METHOD__,
                        $this->options
                );
-               $this->profileDBOut();
 
                if ( $rowcount > $this->getConfig()->get( 'APIMaxDBRows' ) ) {
                        return false;