MediaWiki REL1_30
|
Go to the source code of this file.
Functions | |
cleanupArticle (Revision $rev, $regexes, $match) | |
An aggressive spam cleanup script. | |
Variables | |
if(! $regexes) | $dbr = wfGetDB( DB_SLAVE ) |
$maxID = $dbr->selectField( 'page', 'MAX(page_id)' ) | |
if( $wgSpamBlacklistFiles) | $regexes = $sb->getBlacklists() |
$reportingInterval = 100 | |
$sb = new SpamBlacklist( $wgSpamBlacklistSettings ) | |
$username = 'Spam cleanup script' | |
if(method_exists( 'User', 'newSystemUser')) | else |
cleanupArticle | ( | Revision | $rev, |
$regexes, | |||
$match ) |
An aggressive spam cleanup script.
Searches the database for matching pages, and reverts them to the last non-spammed revision. If all revisions contain spam, deletes the page Find the latest revision of the article that does not contain spam and revert to it
Definition at line 15 of file cleanup.php.
References $matches, $regexes, $rev, ContentHandler\getContentText(), ContentHandler\makeContent(), Revision\newFromTitle(), and print.
Definition at line 94 of file cleanup.php.
Referenced by ChangesListSpecialPage\__construct(), SpecialRecentChanges\__construct(), SpecialRandomrootpage\__construct(), ImageListPager\__construct(), MergeHistoryPager\__construct(), OutputPage\addCategoryLinksToLBAndGetResult(), LinkCache\addLinkObj(), ExternalStoreDB\batchFetchBlobs(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider\beginPrimaryAuthentication(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\beginPrimaryAuthentication(), ChangesListSpecialPage\buildQuery(), SpecialRecentChanges\buildQuery(), SpecialWatchlist\buildQuery(), ImageListPager\buildQueryConds(), SiteStatsUpdate\cacheUpdate(), UserOptions\CHANGER(), CheckStorage\check(), FindOrphanedFiles\checkFiles(), Pingback\checkIfSent(), TrackBlobs\checkIntegrity(), SpecialRecentChanges\checkLastModified(), User\checkNewtalk(), LocalRepo\checkRedirect(), RenameUserCleanup\checkRenameLog(), RevisionDeleter\checkRevisionExistence(), RecompressTracked\checkTrackingTable(), CleanupInvalidDbKeys\cleanupTable(), CompressOld\compressWithConcat(), Title\countRevisionsBetween(), WatchedItemStore\countUnreadNotifications(), WatchedItemStore\countVisitingWatchers(), WatchedItemStore\countVisitingWatchersMultiple(), WatchedItemStore\countWatchedItems(), WatchedItemStore\countWatchers(), WatchedItemStore\countWatchersMultiple(), SearchEngineFactory\create(), Block\defaultRetroactiveAutoblock(), PrefixSearch\defaultSearchBackend(), Article\delete(), DifferenceEngine\deletedLink(), RefreshLinks\deleteLinksFromNonexistent(), RefreshLinks\dfnCheckInterval(), RecompressTracked\doAllOrphans(), RecompressTracked\doAllPages(), ActiveUsersPager\doBatchLookups(), UsersPager\doBatchLookups(), CategoryViewer\doCategoryQuery(), FixDefaultJsonContentPages\doDBUpdates(), PopulateIpChanges\doDBUpdates(), JobQueueDB\doGetAbandonedCount(), JobQueueDB\doGetAcquiredCount(), JobQueueDB\doGetSiblingQueueSizes(), JobQueueDB\doGetSiblingQueuesWithJobs(), JobQueueDB\doGetSize(), JobQueueDB\doIsEmpty(), PopulateRevisionLength\doLenUpdates(), ChangesListSpecialPage\doMainQuery(), SpecialRecentChanges\doMainQuery(), SpecialWatchlist\doMainQuery(), SpecialRecentChangesLinked\doMainQuery(), RecompressTracked\doPage(), GenderCache\doQuery(), LinkBatch\doQuery(), UserCache\doQuery(), RefreshLinks\doRefreshLinks(), MovePageForm\doSubmit(), LinkHolderArray\doVariants(), RecountCategories\doWork(), Title\estimateRevisionCount(), SpecialRenameuser\execute(), QueryPage\execute(), ApiQueryContributions\execute(), CheckBadRedirects\execute(), CheckImages\execute(), CheckUsernames\execute(), CleanupSpam\execute(), UploadStashCleanup\execute(), ClearInterwikiCache\execute(), CompareParserCache\execute(), DeleteDefaultMessages\execute(), DumpCategoriesAsRdf\execute(), DumpLinks\execute(), FindMissingFiles\execute(), FixDoubleRedirects\execute(), InitEditCount\execute(), InitUserPreference\execute(), PurgeChangedFiles\execute(), PurgeChangedPages\execute(), RebuildFileCache\execute(), RefreshFileHeaders\execute(), RemoveInvalidEmails\execute(), RemoveUnusedAccounts\execute(), ResetUserTokens\execute(), ShowSiteStats\execute(), DumpRev\execute(), FixT22757\execute(), OrphanStats\execute(), StorageTypeStats\execute(), UpdateArticleCount\execute(), UpdateCollation\execute(), ExternalStoreDB\fetchBlob(), UploadStash\fetchFileMetadata(), QueryPage\fetchFromCache(), UploadDumper\fetchLocal(), HistoryAction\fetchRevisions(), Parser\fetchScaryTemplateMaybeFromCache(), UploadDumper\fetchUsed(), TitleCleanup\fileExists(), ChangesListSpecialPage\filterOnUserExperienceLevel(), LocalRepo\findBySha1(), LocalRepo\findBySha1s(), LocalRepo\findFiles(), LocalRepo\findFilesByPrefix(), User\findUsersByGroup(), RecompressTracked\finishIncompleteMoves(), DoubleRedirectsPage\formatResult(), PageProps\getAllProperties(), Title\getAuthorsBetween(), ContentHandler\getAutoDeleteReason(), Title\getBrokenLinksFrom(), QueryPage\getCachedTimestamp(), BacklinkCache\getCascadeProtectedLinks(), Title\getCascadeProtectionSources(), WikiPage\getCategories(), DumpCategoriesAsRdf\getCategoryIterator(), DumpCategoriesAsRdf\getCategoryLinksIterator(), WikiPage\getContributors(), SpamBlacklist\getCurrentLinks(), AllMessagesTablePager\getCustomisedStatuses(), ForeignDBFile\getDescriptionShortUrl(), User\getEditCount(), ResourceLoaderModule\getFileDependencies(), User\getFirstEditTimestamp(), WikiFilePage\getForeignCategories(), SpecialBotPasswords\getFormFields(), GadgetDefinitionNamespaceRepo\getGadgetIds(), WikiPage\getHiddenCategories(), LocalFile\getHistory(), SpecialActiveUsers\getIntroText(), JobQueueDB\getJobIterator(), EditPage\getLastDelete(), PageArchive\getLastRevisionText(), SpecialExport\getLinks(), SimpleCaptcha\getLinksFromTracker(), Category\getMembers(), SpecialRandomInCategory\getMinAndMaxForCat(), MessageCache\getMsgFromNamespace(), User\getNewMessageLinks(), SpecialNuke\getNewPages(), WatchedItemStore\getNotificationTimestampsBatch(), SpecialExport\getPagesFromCategory(), SpecialExport\getPagesFromNamespace(), Title\getParentCategories(), PageArchive\getPreviousRevision(), PageProps\getProperties(), SpecialRandomInCategory\getQueryInfo(), SpecialGadgetUsage\getQueryInfo(), ActiveUsersPager\getQueryInfo(), NewFilesPager\getQueryInfo(), UsersPager\getQueryInfo(), BrokenRedirectsPage\getQueryInfo(), LinkSearchPage\getQueryInfo(), MediaStatisticsPage\getQueryInfo(), UncategorizedCategoriesPage\getQueryInfo(), UnwatchedpagesPage\getQueryInfo(), WantedPagesPage\getQueryInfo(), WithoutInterwikiPage\getQueryInfo(), Block\getRangeCond(), Revision\getRecentChange(), Title\getRedirectsHere(), WikiPage\getRedirectTarget(), BenchmarkParse\getRevIdForTime(), PageArchive\getRevision(), FixT22757\getRevTextMap(), OutputPage\getRlClient(), Linker\getRollbackEditCount(), RollbackEdits\getRollbackTitles(), Cite\getStoredReferences(), Title\getSubpages(), MIMEsearchPage\getSuggestionsForTypes(), HistoryBlobStub\getText(), HistoryBlobCurStub\getText(), TrackBlobs\getTextClause(), PageArchive\getTextFromRow(), Revision\getTitle(), ResourceLoaderWikiModule\getTitleInfo(), Title\getTitleProtectionInternal(), BlockListPager\getTotalAutoblocks(), SpecialUpload\getUploadForm(), CheckStorage\importRevision(), User\incEditCountImmediate(), User\initEditCount(), Category\initialize(), BackupDumper\initProgress(), Title\isBigDeletion(), PageArchive\isDeleted(), Title\isDeleted(), Title\isDeletedQuick(), Title\isNewPage(), PageArchive\listAllPages(), ChangeTags\listExplicitlyDefinedTags(), PageArchive\listFiles(), UploadStash\listFiles(), PageArchive\listPages(), PageArchive\listPagesByPrefix(), PageArchive\listPagesBySearch(), PageArchive\listRevisions(), MediaWiki\Interwiki\ClassicInterwikiLookup\load(), ArchivedFile\load(), OldLocalFile\loadExtraFromDB(), LocalFile\loadFieldsWithTimestamp(), MessageCache\loadFromDB(), LocalFile\loadFromDB(), OldLocalFile\loadFromDB(), WikiPage\loadLastEdit(), Revision\loadMutableFields(), User\loadOptions(), Title\loadRestrictions(), Title\loadRestrictionsFromRows(), DifferenceEngine\loadRevisionData(), DBSiteStore\loadSites(), WatchedItemStore\loadWatchedItem(), SearchMySQL\minSearchLength(), ChangesListBooleanFilter\modifyQuery(), ChangesListStringOptionsFilterGroup\modifyQuery(), ChangesListStringOptionsFilterGroupTest\modifyQueryHelper(), moveToExternal(), LinkSearchPage\mungeQuery(), Title\nameOf(), Block\newFromID(), Title\newFromIDs(), UserArray\newFromIDs(), LocalFile\newFromKey(), OldLocalFile\newFromKey(), UserArray\newFromNames(), User\newSystemUser(), LocalFile\nextHistoryLine(), SiteStats\numberingroup(), InterwikiHooks\onInterwikiLoadPrefix(), HistoryAction\onView(), ImagePage\openShowImage(), SpecialWatchlist\outputChangesList(), InfoAction\pageCounts(), WikiPage\pageData(), Article\pageDataFromId(), WikiPage\pageDataFromId(), Article\pageDataFromTitle(), WikiPage\pageDataFromTitle(), SiteStats\pagesInNs(), ResourceLoader\preloadModuleInfo(), PurgeChangedFiles\purgeFromArchiveTable(), PurgeChangedFiles\purgeFromLogType(), PurgeList\purgeNamespace(), ImagePage\queryImageLinks(), QueryPage\reallyDoQuery(), ShortPagesPage\reallyDoQuery(), DoubleRedirectsPage\reallyGetQueryInfo(), Cite\recursiveFetchRefsFromDB(), RefreshLinks\refreshCategory(), SpecialWatchlist\registerFilters(), LinkHolderArray\replaceInternal(), WikiPage\replaceSectionContent(), resolveStub(), resolveStubs(), CheckStorage\restoreText(), CategoryMembershipChangeJob\run(), TableCleanup\runTable(), UserNamePrefixSearch\search(), SpecialRandomInCategory\selectRandomPageFromDB(), RandomPage\selectRandomPageFromDB(), SpecialAllPages\showChunk(), SpecialInterwiki\showForm(), MovePageForm\showForm(), SpecialWhatLinksHere\showIndirectLinks(), EditPage\showIntro(), Article\showMissingArticle(), Article\showPatrolFooter(), SpecialPrefixindex\showPrefixChunk(), SpecialVersion\softwareInformation(), RecompressTracked\syncDBs(), ChangeTags\tagUsageStatistics(), RevisionStorageTest\testConstructFromRow(), WikiPageTest\testDoDeleteArticle(), WikiPageTest\testDoDeleteUpdates(), WikiPageTest\testDoEditContent(), RevisionStorageTest\testInsertOn(), LBFactoryTest\testLBFactoryMulti(), LBFactoryTest\testLBFactorySimpleServer(), LBFactoryTest\testLBFactorySimpleServers(), LoadBalancerTest\testLBSimpleServer(), LoadBalancerTest\testLBSimpleServers(), ChangesListStringOptionsFilterGroupTest\testModifyQuery(), RevisionStorageTest\testNewFromArchiveRow(), RevisionStorageTest\testNewFromRow(), ChangesListStringOptionsFilterGroupTest\testNoOpModifyQuery(), PageArchiveTest\testUndeleteRevisions(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider\testUserCanAuthenticate(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\testUserCanAuthenticate(), TrackBlobs\trackOrphanText(), TrackBlobs\trackRevisions(), UserOptions\USAGER(), and ApiTag\validateLogId().
$maxID = $dbr->selectField( 'page', 'MAX(page_id)' ) |
Definition at line 95 of file cleanup.php.
Referenced by moveToExternal(), and resolveStubs().
if ($wgSpamBlacklistFiles) $regexes = $sb->getBlacklists() |
Definition at line 88 of file cleanup.php.
Referenced by SimpleCaptcha\buildRegexes(), SpamRegexBatch\buildRegexes(), SpamRegexBatch\buildSafeRegexes(), cleanupArticle(), SimpleCaptcha\filterLink(), SpamRegexBatch\getBadLines(), MagicWordArray\matchAndRemove(), EditPage\matchSpamRegex(), EditPage\matchSpamRegexInternal(), MagicWordArray\matchStartAndRemove(), EditPage\matchSummarySpamRegex(), MagicWordArray\matchVariableStartToEnd(), and SpamRegexBatch\validateRegexes().
$reportingInterval = 100 |
Definition at line 96 of file cleanup.php.
$sb = new SpamBlacklist( $wgSpamBlacklistSettings ) |
Definition at line 84 of file cleanup.php.
$username = 'Spam cleanup script' |
Definition at line 62 of file cleanup.php.
if( $wgUser->idForName()==0) if (isset($options[ 'n'])) else |
Definition at line 65 of file cleanup.php.
Definition at line 99 of file cleanup.php.
Referenced by CleanupEmptyCategories\__construct(), PopulateCategory\__construct(), CheckExtensionsCLI\__construct(), BenchmarkTidy\benchmark(), cdbShowHelp(), UserOptions\CHANGER(), GenerateCollationData\charCallback(), CheckStorage\check(), RenameUserCleanup\checkRenameLog(), cleanupArticle(), Maintenance\cleanupChanneled(), MonoBookTemplate\customBox(), Makefile\download(), BlockTest\dumpBlocks(), ParserEditTests\editTest(), ParserTestPrinter\endSuite(), Maintenance\error(), CheckStorage\error(), SpecialRunJobs\execute(), HHVMMakeRepo\execute(), CLIParser\execute(), PPFuzzTester\execute(), FixT22757\execute(), SyncFileBackend\execute(), ParserEditTests\execute(), ParserEditTests\findTest(), GetConfiguration\formatVarDump(), GenerateCollationData\generateFirstChars(), ParserEditTests\getOutputFileName(), ParserEditTests\handleFailure(), ZipDirectoryReader\hexDump(), ProfilerOutputText\log(), MediaWiki\main(), mccShowUsage(), moveToExternal(), RSSFeed\outHeader(), AtomFeed\outHeader(), RSSFeed\outItem(), AtomFeed\outItem(), Maintenance\output(), OutputPage\output(), Maintenance\outputChanneled(), SpecialUploadStash\outputContents(), AjaxDispatcher\performAction(), ApiQueryContinueTestBase\printResult(), AjaxResponse\printText(), ApiQueryContinueTestBase\query(), Maintenance\readlineEmulation(), ParserEditTests\reload(), HttpError\report(), DbTestPreviewer\report(), ParserTestPrinter\report(), ParserTestPrinter\reportPercentage(), resolveStub(), resolveStubs(), CheckStorage\restoreText(), MediaWiki\run(), captcha-old\run_in_thread(), captcha\run_in_thread(), ParserEditTests\runTests(), ParserTestPrinter\showFailure(), ParserEditTests\showResults(), ParserTestPrinter\showSuccess(), ParserTestPrinter\showTesting(), showUsage(), UserOptions\showUsageAndExit(), ParserTestPrinter\skipped(), DbTestPreviewer\start(), DbTestRecorder\start(), ParserTestPrinter\startSuite(), HTTPFileStreamer\stream(), FileBackendStore\streamFile(), ParserEditTests\switchTidy(), captcha-old\try_pick_word(), captcha\try_pick_word(), Makefile\uncompress(), UserOptions\USAGER(), UserOptions\warn(), wfHttpError(), wfVarDump(), DumpOutput\write(), and RandomImageGenerator\writeImageWithApi().