X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMetadata.php;h=ea89f524bbfdb93a94b38ed99303dfbf9a365ded;hb=855e3626e3aac639fa754aa17a8e5a6f5b533f25;hp=cd77ef877979b2031e2be82ba35f8103e79d5951;hpb=4fe59cd7c2d24ccee9a227d945f5a0791db2fb42;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Metadata.php b/includes/Metadata.php index cd77ef8779..ea89f524bb 100644 --- a/includes/Metadata.php +++ b/includes/Metadata.php @@ -28,10 +28,10 @@ abstract class RdfMetaData { /** * Constructor - * @param $article Article object + * @param Page $page */ - public function __construct( Page $article ) { - $this->mArticle = $article; + public function __construct( Page $page ) { + $this->mArticle = $page; } abstract public function show(); @@ -40,7 +40,10 @@ abstract class RdfMetaData { global $wgOut, $wgRequest; $httpaccept = isset( $_SERVER['HTTP_ACCEPT'] ) ? $_SERVER['HTTP_ACCEPT'] : null; - $rdftype = wfNegotiateType( wfAcceptToPrefs( $httpaccept ), wfAcceptToPrefs( self::RDF_TYPE_PREFS ) ); + $rdftype = wfNegotiateType( + wfAcceptToPrefs( $httpaccept ), + wfAcceptToPrefs( self::RDF_TYPE_PREFS ) + ); if ( !$rdftype ) { throw new HttpError( 406, wfMessage( 'notacceptable' ) ); @@ -103,8 +106,8 @@ abstract class RdfMetaData { } /** - * @param $name string - * @param $title Title + * @param string $name + * @param Title $title */ protected function page( $name, $title ) { $this->url( $name, $title->getFullURL() ); @@ -116,11 +119,13 @@ abstract class RdfMetaData { } protected function person( $name, User $user ) { + global $wgHiddenPrefs; + if ( $user->isAnon() ) { $this->element( $name, wfMessage( 'anonymous' )->numParams( 1 )->text() ); } else { $real = $user->getRealName(); - if ( $real ) { + if ( $real && !in_array( 'realname', $wgHiddenPrefs ) ) { $this->element( $name, $real ); } else { $userName = $user->getName();