X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FCategory.php;h=77f1212fcfb2287493e7633fc4dcd823a40f0e7a;hb=79502d48e636a31c05ef5f52753a634767cbc4cb;hp=3352c2c2b039dc0eeec6e6e8c55e37d9ab5b4424;hpb=3e83cc276aa498fbf5786a1f9bdd6285fa03cdc9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Category.php b/includes/Category.php index 3352c2c2b0..77f1212fcf 100644 --- a/includes/Category.php +++ b/includes/Category.php @@ -25,8 +25,6 @@ * Category objects are immutable, strictly speaking. If you call methods that change the database, * like to refresh link counts, the objects will be appropriately reinitialized. * Member variables are lazy-initialized. - * - * @todo Move some stuff from CategoryPage.php to here, and use that. */ class Category { /** Name of the category, normalized to DB-key form */ @@ -299,10 +297,10 @@ class Category { /** * Generic accessor * @param string $key - * @return bool + * @return mixed */ private function getX( $key ) { - if ( !$this->initialize( self::LAZY_INIT_ROW ) ) { + if ( $this->{$key} === null && !$this->initialize( self::LAZY_INIT_ROW ) ) { return false; } return $this->{$key};