Give thumbor swift user r/w access to containers
[lhc/web/wiklou.git] / includes / api / ApiMain.php
index b7d4529..1415640 100644 (file)
@@ -370,7 +370,7 @@ class ApiMain extends ApiBase {
 
        /**
         * Set the continuation manager
-        * @param ApiContinuationManager|null
+        * @param ApiContinuationManager|null $manager
         */
        public function setContinuationManager( $manager ) {
                if ( $manager !== null ) {
@@ -1870,7 +1870,7 @@ class ApiMain extends ApiBase {
                ];
        }
 
-       /** @see ApiBase::getExamplesMessages() */
+       /** @inheritDoc */
        protected function getExamplesMessages() {
                return [
                        'action=help'
@@ -1931,15 +1931,20 @@ class ApiMain extends ApiBase {
 
                        $header = $this->msg( 'api-help-datatypes-header' )->parse();
 
-                       // Add an additional span with sanitized ID
-                       if ( !$this->getConfig()->get( 'ExperimentalHtmlIds' ) ) {
-                               $header = Html::element( 'span', [ 'id' => Sanitizer::escapeId( 'main/datatypes' ) ] ) .
-                                       $header;
-                       }
-                       $help['datatypes'] .= Html::rawElement( 'h' . min( 6, $level ),
-                               [ 'id' => 'main/datatypes', 'class' => 'apihelp-header' ],
-                               $header
+                       $id = Sanitizer::escapeIdForAttribute( 'main/datatypes', Sanitizer::ID_PRIMARY );
+                       $idFallback = Sanitizer::escapeIdForAttribute( 'main/datatypes', Sanitizer::ID_FALLBACK );
+                       $headline = Linker::makeHeadline( min( 6, $level ),
+                               ' class="apihelp-header"',
+                               $id,
+                               $header,
+                               '',
+                               $idFallback
                        );
+                       // Ensure we have a sane anchor
+                       if ( $id !== 'main/datatypes' && $idFallback !== 'main/datatypes' ) {
+                               $headline = '<div id="main/datatypes"></div>' . $headline;
+                       }
+                       $help['datatypes'] .= $headline;
                        $help['datatypes'] .= $this->msg( 'api-help-datatypes' )->parseAsBlock();
                        if ( !isset( $tocData['main/datatypes'] ) ) {
                                $tocnumber[$level]++;
@@ -1953,16 +1958,21 @@ class ApiMain extends ApiBase {
                                ];
                        }
 
-                       // Add an additional span with sanitized ID
-                       if ( !$this->getConfig()->get( 'ExperimentalHtmlIds' ) ) {
-                               $header = Html::element( 'span', [ 'id' => Sanitizer::escapeId( 'main/credits' ) ] ) .
-                                       $header;
-                       }
                        $header = $this->msg( 'api-credits-header' )->parse();
-                       $help['credits'] .= Html::rawElement( 'h' . min( 6, $level ),
-                               [ 'id' => 'main/credits', 'class' => 'apihelp-header' ],
-                               $header
+                       $id = Sanitizer::escapeIdForAttribute( 'main/credits', Sanitizer::ID_PRIMARY );
+                       $idFallback = Sanitizer::escapeIdForAttribute( 'main/credits', Sanitizer::ID_FALLBACK );
+                       $headline = Linker::makeHeadline( min( 6, $level ),
+                               ' class="apihelp-header"',
+                               $id,
+                               $header,
+                               '',
+                               $idFallback
                        );
+                       // Ensure we have a sane anchor
+                       if ( $id !== 'main/credits' && $idFallback !== 'main/credits' ) {
+                               $headline = '<div id="main/credits"></div>' . $headline;
+                       }
+                       $help['credits'] .= $headline;
                        $help['credits'] .= $this->msg( 'api-credits' )->useDatabase( false )->parseAsBlock();
                        if ( !isset( $tocData['main/credits'] ) ) {
                                $tocnumber[$level]++;