Remove isset() check in Sanitizer::setupAttributeWhitelist()
authorAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Sun, 6 Apr 2014 16:28:17 +0000 (18:28 +0200)
committerIAlex <codereview@emsenhuber.ch>
Tue, 10 Jun 2014 19:55:53 +0000 (19:55 +0000)
Declared variables have a default value of null, so there is
no point to use isset() to check only if it has the value null.

Also changed the location of the line break to group variable
declarations.

Change-Id: Ic36fc95db86909d8b5075954a72afa479fa20d0d

includes/Sanitizer.php

index 1ea6523..6a568c2 100644 (file)
@@ -1507,11 +1507,11 @@ class Sanitizer {
         */
        static function setupAttributeWhitelist() {
                global $wgAllowRdfaAttributes, $wgAllowMicrodataAttributes;
-
                static $whitelist, $staticInitialised;
+
                $globalContext = implode( '-', compact( 'wgAllowRdfaAttributes', 'wgAllowMicrodataAttributes' ) );
 
-               if ( isset( $whitelist ) && $staticInitialised == $globalContext ) {
+               if ( $whitelist !== null && $staticInitialised == $globalContext ) {
                        return $whitelist;
                }