r86370 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86369‎ | r86370 | r86371 >
Date:00:48, 19 April 2011
Author:aaron
Status:ok
Tags:
Comment:
* Sanity check NS in loadPageData()
* Moved two functions up
Modified paths:
  • /trunk/extensions/FlaggedRevs/dataclasses/FlaggedPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedPage.php
@@ -303,6 +303,28 @@
304304 }
305305
306306 /**
 307+ * Get visiblity restrictions on page
 308+ * @return array (select,override)
 309+ */
 310+ public function getStabilitySettings() {
 311+ if ( !$this->mDataLoaded ) {
 312+ $this->loadPageData();
 313+ }
 314+ return $this->pageConfig;
 315+ }
 316+
 317+ /*
 318+ * Get the fp_reviewed value for this page
 319+ * @return bool
 320+ */
 321+ public function syncedInTracking() {
 322+ if ( !$this->mDataLoaded ) {
 323+ $this->loadPageData();
 324+ }
 325+ return $this->syncedInTracking;
 326+ }
 327+
 328+ /**
307329 * Get the newest of the highest rated flagged revisions of this page
308330 * Note: will not return deleted revisions
309331 * @return int
@@ -328,28 +350,6 @@
329351 }
330352
331353 /**
332 - * Get visiblity restrictions on page
333 - * @return array (select,override)
334 - */
335 - public function getStabilitySettings() {
336 - if ( !$this->mDataLoaded ) {
337 - $this->loadPageData();
338 - }
339 - return $this->pageConfig;
340 - }
341 -
342 - /*
343 - * Get the fp_reviewed value for this page
344 - * @return bool
345 - */
346 - public function syncedInTracking() {
347 - if ( !$this->mDataLoaded ) {
348 - $this->loadPageData();
349 - }
350 - return $this->syncedInTracking;
351 - }
352 -
353 - /**
354354 * Updates the fp_reviewed field for this article
355355 * @param bool $synced
356356 */
@@ -409,8 +409,8 @@
410410 $this->pendingRevCount = null; // defer this one...
411411 $this->pageConfig = FlaggedPageConfig::getDefaultVisibilitySettings(); // default
412412 $this->syncedInTracking = true; // false => "unreviewed" or "synced"
413 - # Load in Row data if the page exists...
414 - if ( $data ) {
 413+ # Load in flaggedrevs Row data if the page exists...(sanity check NS)
 414+ if ( $data && FlaggedRevs::inReviewNamespace( $this->mTitle ) ) {
415415 if ( $data->fpc_override !== null ) { // page config row found
416416 $this->pageConfig = FlaggedPageConfig::getVisibilitySettingsFromRow( $data );
417417 }

Status & tagging log