comments and reminders for stuff not yet covered by ContentHandler
authordaniel <daniel.kinzler@wikimedia.de>
Fri, 8 Jun 2012 07:45:07 +0000 (09:45 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Fri, 8 Jun 2012 07:45:07 +0000 (09:45 +0200)
includes/Title.php
includes/job/DoubleRedirectJob.php
includes/specials/SpecialBooksources.php
maintenance/cleanupSpam.php

index 4a28dca..28dd886 100644 (file)
@@ -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;
index 4e02258..a9399b5 100644 (file)
@@ -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???' );
index bc07d58..6182f7d 100644 (file)
@@ -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;
                }
 
index 8a760cd..cdbba55 100644 (file)
@@ -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();
                }