Merge "Return user ID as userid in watchlist API module"
[lhc/web/wiklou.git] / includes / api / ApiWatch.php
index 2454e33..3e51299 100644 (file)
@@ -40,13 +40,13 @@ class ApiWatch extends ApiBase {
                $params = $this->extractRequestParams();
                $title = Title::newFromText( $params['title'] );
 
-               if ( !$title || $title->getNamespace() < 0 ) {
+               if ( !$title || $title->isExternal() || !$title->canExist() ) {
                        $this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
                }
 
                $res = array( 'title' => $title->getPrefixedText() );
 
-               // Currently unnecessary, code to act as a safeguard against any change in current behaviour of uselang
+               // Currently unnecessary, code to act as a safeguard against any change in current behavior of uselang
                // Copy from ApiParse
                $oldLang = null;
                if ( isset( $params['uselang'] ) && $params['uselang'] != $this->getContext()->getLanguage()->getCode() ) {