From 889896bf92a82755d0a35e6da790cfadc96a7377 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 8 Jun 2012 09:45:07 +0200 Subject: [PATCH] comments and reminders for stuff not yet covered by ContentHandler --- includes/Title.php | 1 + includes/job/DoubleRedirectJob.php | 2 +- includes/specials/SpecialBooksources.php | 2 +- maintenance/cleanupSpam.php | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 4a28dca91b..28dd886c24 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -397,6 +397,7 @@ class Title { * * @param $text String Text with possible redirect * @return Array of Titles, with the destination last + * @todo: migrate this logic into WikitextContent! */ public static function newFromRedirectArray( $text ) { global $wgMaxRedirects; diff --git a/includes/job/DoubleRedirectJob.php b/includes/job/DoubleRedirectJob.php index 4e022586c9..a9399b507d 100644 --- a/includes/job/DoubleRedirectJob.php +++ b/includes/job/DoubleRedirectJob.php @@ -129,7 +129,7 @@ class DoubleRedirectJob extends Job { # so the regex has to be fairly general $newText = preg_replace( '/ \[ \[ [^\]]* \] \] /x', '[[' . $newTitle->getFullText() . ']]', - $text, 1 ); + $text, 1 ); #FIXME: need a way to do this via ContentHandler! if ( $newText === $text ) { $this->setLastError( 'Text unchanged???' ); diff --git a/includes/specials/SpecialBooksources.php b/includes/specials/SpecialBooksources.php index bc07d586d4..6182f7d146 100644 --- a/includes/specials/SpecialBooksources.php +++ b/includes/specials/SpecialBooksources.php @@ -144,7 +144,7 @@ class SpecialBookSources extends SpecialPage { $title = Title::makeTitleSafe( NS_PROJECT, $page ); # Show list in content language if( is_object( $title ) && $title->exists() ) { $rev = Revision::newFromTitle( $title ); - $this->getOutput()->addWikiText( str_replace( 'MAGICNUMBER', $this->isbn, $rev->getText() ) ); + $this->getOutput()->addWikiText( str_replace( 'MAGICNUMBER', $this->isbn, $rev->getText() ) ); #FIXME: need a way to do this via ContentHandler (or enforce flat text-based content) return true; } diff --git a/maintenance/cleanupSpam.php b/maintenance/cleanupSpam.php index 8a760cdc04..cdbba55e08 100644 --- a/maintenance/cleanupSpam.php +++ b/maintenance/cleanupSpam.php @@ -96,6 +96,7 @@ class CleanupSpam extends Maintenance { $rev = Revision::newFromTitle( $title ); $currentRevId = $rev->getId(); + //FIXME: LinkFilter needs to handle Content objects! Or rather, ContentHandler needs to provide the appropriate LinkFilter. while ( $rev && ( $rev->isDeleted( Revision::DELETED_TEXT ) || LinkFilter::matchEntry( $rev->getText() , $domain ) ) ) { $rev = $rev->getPrevious(); } -- 2.20.1