dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Make wgDisableAnonTalk disable anon links in automatic edit summaries"
[lhc/web/wiklou.git]
/
maintenance
/
cleanupImages.php
diff --git
a/maintenance/cleanupImages.php
b/maintenance/cleanupImages.php
index
fbdc7c2
..
305a41d
100644
(file)
--- a/
maintenance/cleanupImages.php
+++ b/
maintenance/cleanupImages.php
@@
-25,6
+25,8
@@
* @ingroup Maintenance
*/
* @ingroup Maintenance
*/
+use MediaWiki\MediaWikiServices;
+
require_once __DIR__ . '/cleanupTable.inc';
/**
require_once __DIR__ . '/cleanupTable.inc';
/**
@@
-32,7
+34,7
@@
require_once __DIR__ . '/cleanupTable.inc';
*
* @ingroup Maintenance
*/
*
* @ingroup Maintenance
*/
-class
ImageCleanup
extends TableCleanup {
+class
CleanupImages
extends TableCleanup {
protected $defaultParams = [
'table' => 'image',
'conds' => [],
protected $defaultParams = [
'table' => 'image',
'conds' => [],
@@
-46,8
+48,6
@@
class ImageCleanup extends TableCleanup {
}
protected function processRow( $row ) {
}
protected function processRow( $row ) {
- global $wgContLang;
-
$source = $row->img_name;
if ( $source == '' ) {
// Ye olde empty rows. Just kill them.
$source = $row->img_name;
if ( $source == '' ) {
// Ye olde empty rows. Just kill them.
@@
-64,11
+64,13
@@
class ImageCleanup extends TableCleanup {
// We also have some HTML entities there
$cleaned = Sanitizer::decodeCharReferences( $cleaned );
// We also have some HTML entities there
$cleaned = Sanitizer::decodeCharReferences( $cleaned );
+ $contLang = MediaWikiServices::getInstance()->getContentLanguage();
+
// Some are old latin-1
// Some are old latin-1
- $cleaned = $
wgC
ontLang->checkTitleEncoding( $cleaned );
+ $cleaned = $
c
ontLang->checkTitleEncoding( $cleaned );
// Many of remainder look like non-normalized unicode
// Many of remainder look like non-normalized unicode
- $cleaned = $
wgC
ontLang->normalize( $cleaned );
+ $cleaned = $
c
ontLang->normalize( $cleaned );
$title = Title::makeTitleSafe( NS_FILE, $cleaned );
$title = Title::makeTitleSafe( NS_FILE, $cleaned );
@@
-220,5
+222,5
@@
class ImageCleanup extends TableCleanup {
}
}
}
}
-$maintClass =
ImageCleanup
::class;
+$maintClass =
CleanupImages
::class;
require_once RUN_MAINTENANCE_IF_MAIN;
require_once RUN_MAINTENANCE_IF_MAIN;