SECURITY: rate-limit and prevent blocked users from changing email
[lhc/web/wiklou.git] / includes / api / ApiHelp.php
index 886dbcc..cc96f90 100644 (file)
@@ -40,7 +40,8 @@ class ApiHelp extends ApiBase {
 
                // Get the help
                $context = new DerivativeContext( $this->getMain()->getContext() );
-               $context->setSkin( SkinFactory::getDefaultInstance()->makeSkin( 'apioutput' ) );
+               $skinFactory = MediaWikiServices::getInstance()->getSkinFactory();
+               $context->setSkin( $skinFactory->makeSkin( 'apioutput' ) );
                $context->setLanguage( $this->getMain()->getLanguage() );
                $context->setTitle( SpecialPage::getTitleFor( 'ApiHelp' ) );
                $out = new OutputPage( $context );
@@ -559,11 +560,9 @@ class ApiHelp extends ApiBase {
                                                                                $arr = &$submodules;
                                                                                try {
                                                                                        $submod = $module->getModuleFromPath( $m );
-                                                                                       if ( $submod ) {
-                                                                                               if ( $submod->isDeprecated() ) {
-                                                                                                       $arr = &$deprecatedSubmodules;
-                                                                                                       $attrs['class'] = 'apihelp-deprecated-value';
-                                                                                               }
+                                                                                       if ( $submod && $submod->isDeprecated() ) {
+                                                                                               $arr = &$deprecatedSubmodules;
+                                                                                               $attrs['class'] = 'apihelp-deprecated-value';
                                                                                        }
                                                                                } catch ( ApiUsageException $ex ) {
                                                                                        // Ignore
@@ -585,7 +584,8 @@ class ApiHelp extends ApiBase {
                                                                        break;
 
                                                                case 'namespace':
-                                                                       $namespaces = MWNamespace::getValidNamespaces();
+                                                                       $namespaces = MediaWikiServices::getInstance()->
+                                                                               getNamespaceInfo()->getValidNamespaces();
                                                                        if ( isset( $settings[ApiBase::PARAM_EXTRA_NAMESPACES] ) &&
                                                                                is_array( $settings[ApiBase::PARAM_EXTRA_NAMESPACES] )
                                                                        ) {