Index: branches/REL1_18/phase3/maintenance/purgeParserCache.php |
— | — | @@ -0,0 +1,43 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +require( dirname( __FILE__ ) . '/Maintenance.php' ); |
| 5 | + |
| 6 | +class PurgeParserCache extends Maintenance { |
| 7 | + function __construct() { |
| 8 | + parent::__construct(); |
| 9 | + $this->addDescription( "Remove old objects from the parser cache. " . |
| 10 | + "This only works when the parser cache is in an SQL database." ); |
| 11 | + $this->addOption( 'expiredate', 'Delete objects expiring before this date.', false, true ); |
| 12 | + $this->addOption( 'age', |
| 13 | + 'Delete objects created more than this many seconds ago, assuming $wgParserCacheExpireTime '. |
| 14 | + 'has been consistent.', |
| 15 | + false, true ); |
| 16 | + } |
| 17 | + |
| 18 | + function execute() { |
| 19 | + $inputDate = $this->getOption( 'expiredate' ); |
| 20 | + $inputAge = $this->getOption( 'age' ); |
| 21 | + if ( $inputDate !== null ) { |
| 22 | + $date = wfTimestamp( TS_MW, strtotime( $inputDate ) ); |
| 23 | + } elseif ( $inputAge !== null ) { |
| 24 | + global $wgParserCacheExpireTime; |
| 25 | + $date = wfTimestamp( TS_MW, time() + $wgParserCacheExpireTime - intval( $inputAge ) ); |
| 26 | + } else { |
| 27 | + echo "Must specify either --expiredate or --age\n"; |
| 28 | + exit( 1 ); |
| 29 | + } |
| 30 | + |
| 31 | + $english = Language::factory( 'en' ); |
| 32 | + echo "Deleting objects expiring before " . $english->timeanddate( $date ) . "\n"; |
| 33 | + |
| 34 | + $pc = wfGetParserCacheStorage(); |
| 35 | + $success = $pc->deleteObjectsExpiringBefore( $date ); |
| 36 | + if ( !$success ) { |
| 37 | + echo "Cannot purge this kind of parser cache.\n"; |
| 38 | + exit( 1 ); |
| 39 | + } |
| 40 | + echo "Done\n"; |
| 41 | + } |
| 42 | +} |
| 43 | +$maintClass = 'PurgeParserCache'; |
| 44 | +require_once( RUN_MAINTENANCE_IF_MAIN ); |
Property changes on: branches/REL1_18/phase3/maintenance/purgeParserCache.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 45 | + native |
Index: branches/REL1_18/phase3/skins/chick/main.css |
— | — | @@ -245,7 +245,7 @@ |
246 | 246 | padding:5px; |
247 | 247 | font-size: 95%; |
248 | 248 | } |
249 | | -#toc ul { margin-left: 2em; } |
| 249 | +#toc ul { margin: 0 2em; } |
250 | 250 | #toc .toctoggle { font-size: 94%; } |
251 | 251 | #toc .editsection { |
252 | 252 | margin-top: 0.7em; |
Index: branches/REL1_18/phase3/skins/monobook/main.css |
— | — | @@ -349,7 +349,7 @@ |
350 | 350 | list-style-type: none; |
351 | 351 | list-style-image: none; |
352 | 352 | margin-left: 0; |
353 | | - padding-left: 0; |
| 353 | + padding: 0; |
354 | 354 | text-align: left; |
355 | 355 | } |
356 | 356 | #toc ul ul, |
Index: branches/REL1_18/phase3/skins/modern/main.css |
— | — | @@ -587,7 +587,7 @@ |
588 | 588 | list-style-type: none; |
589 | 589 | list-style-image: none; |
590 | 590 | margin: 0 1em 0 1em; |
591 | | - padding-left: 0; |
| 591 | + padding: 0; |
592 | 592 | text-align: left; |
593 | 593 | } |
594 | 594 | |
Index: branches/REL1_18/phase3/skins/common/oldshared.css |
— | — | @@ -147,8 +147,7 @@ |
148 | 148 | .toc ul { |
149 | 149 | list-style-type: none; |
150 | 150 | list-style-image: none; |
151 | | - margin-left: 0; |
152 | | - padding-left: 0; |
| 151 | + padding: 0; |
153 | 152 | text-align: left; |
154 | 153 | } |
155 | 154 | #toc ul ul, |
Index: branches/REL1_18/phase3/skins/common/shared.css |
— | — | @@ -577,6 +577,32 @@ |
578 | 578 | margin: 0; |
579 | 579 | } |
580 | 580 | |
| 581 | +/* Correct directionality when page dir is different from site/user dir */ |
| 582 | +.mw-content-ltr ul, |
| 583 | +.mw-content-rtl .mw-content-ltr ul { |
| 584 | + /* @noflip */ |
| 585 | + margin: 0.3em 0 0 1.5em; |
| 586 | + padding: 0; |
| 587 | +} |
| 588 | +.mw-content-rtl ul, |
| 589 | +.mw-content-ltr .mw-content-rtl ul { |
| 590 | + /* @noflip */ |
| 591 | + margin: 0.3em 1.5em 0 0; |
| 592 | + padding: 0; |
| 593 | +} |
| 594 | +.mw-content-ltr ol, |
| 595 | +.mw-content-rtl .mw-content-ltr ol { |
| 596 | + /* @noflip */ |
| 597 | + margin: 0.3em 0 0 3.2em; |
| 598 | + padding: 0; |
| 599 | +} |
| 600 | +.mw-content-rtl ol, |
| 601 | +.mw-content-ltr .mw-content-rtl ol { |
| 602 | + /* @noflip */ |
| 603 | + margin: 0.3em 3.2em 0 0; |
| 604 | + padding: 0; |
| 605 | +} |
| 606 | + |
581 | 607 | /* Galleries */ |
582 | 608 | /* These display attributes look nonsensical, but are needed to support IE and FF2 */ |
583 | 609 | /* Don't forget to update commonPrint.css */ |
— | — | @@ -673,6 +699,7 @@ |
674 | 700 | list-style-type: arabic-indic; |
675 | 701 | } |
676 | 702 | |
| 703 | +ol:lang(as) li, |
677 | 704 | ol:lang(bn) li { |
678 | 705 | list-style-type: -moz-bengali; |
679 | 706 | list-style-type: bengali; |
— | — | @@ -683,16 +710,18 @@ |
684 | 711 | list-style-type: oriya; |
685 | 712 | } |
686 | 713 | |
| 714 | +#toc ul, .toc ul { |
| 715 | + margin: .3em 0; |
| 716 | +} |
| 717 | + |
687 | 718 | /* Correct directionality when page dir is different from site/user dir */ |
688 | 719 | /* @noflip */.mw-content-ltr .toc ul, .mw-content-ltr #toc ul, |
689 | 720 | .mw-content-rtl .mw-content-ltr .toc ul, .mw-content-rtl .mw-content-ltr #toc ul { |
690 | 721 | text-align: left; |
691 | | - margin-left: 0; |
692 | 722 | } |
693 | 723 | /* @noflip */.mw-content-rtl .toc ul, .mw-content-rtl #toc ul, |
694 | 724 | .mw-content-ltr .mw-content-rtl .toc ul, .mw-content-ltr .mw-content-rtl #toc ul { |
695 | 725 | text-align: right; |
696 | | - margin-right: 0; |
697 | 726 | } |
698 | 727 | /* @noflip */.mw-content-ltr .toc ul ul, .mw-content-ltr #toc ul ul, |
699 | 728 | .mw-content-rtl .mw-content-ltr .toc ul ul, .mw-content-rtl .mw-content-ltr #toc ul ul { |
Index: branches/REL1_18/phase3/skins/vector/screen.css |
— | — | @@ -885,7 +885,7 @@ |
886 | 886 | list-style-type: none; |
887 | 887 | list-style-image: none; |
888 | 888 | margin-left: 0; |
889 | | - padding-left: 0; |
| 889 | + padding: 0; |
890 | 890 | text-align: left; |
891 | 891 | } |
892 | 892 | #toc ul ul, |
Index: branches/REL1_18/phase3/RELEASE-NOTES-1.18 |
— | — | @@ -441,6 +441,8 @@ |
442 | 442 | * Tracking categories are no longer shown in footer for special pages |
443 | 443 | * (bug 30684) Fix bad escaping in mw.message for inexistent messages (i.e. <key>) |
444 | 444 | * $wgOverrideSiteFeed no longer double escapes urls. |
| 445 | +* The preprocessor no longer fails with a PHP warning about XML_PARSE_HUGE when |
| 446 | + processing complex pages using newer versions of libxml2. |
445 | 447 | * (bug 30192) Thumbnails of archived files are now deleted |
446 | 448 | |
447 | 449 | === API changes in 1.18 === |
Property changes on: branches/REL1_18/phase3/RELEASE-NOTES-1.18 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
448 | 450 | Merged /trunk/phase3/RELEASE-NOTES-1.18:r96509,96522,96606,96643,96645,96655,96659,96687,96762,96764,96829 |
Index: branches/REL1_18/phase3/tests/phpunit/includes/media/ExifRotationTest.php |
— | — | @@ -7,6 +7,7 @@ |
8 | 8 | |
9 | 9 | function setUp() { |
10 | 10 | parent::setUp(); |
| 11 | + $this->handler = new BitmapHandler(); |
11 | 12 | } |
12 | 13 | |
13 | 14 | /** |
— | — | @@ -14,17 +15,16 @@ |
15 | 16 | * @dataProvider providerFiles |
16 | 17 | */ |
17 | 18 | function testMetadata( $name, $type, $info ) { |
18 | | - $handler = new BitmapHandler(); |
19 | 19 | # Force client side resizing |
20 | 20 | $params = array( 'width' => 10000, 'height' => 10000 ); |
21 | 21 | $file = UnregisteredLocalFile::newFromPath( dirname( __FILE__ ) . '/' . $name, $type ); |
22 | 22 | |
23 | 23 | # Normalize parameters |
24 | | - $this->assertTrue( $handler->normaliseParams( $file, $params ) ); |
25 | | - $rotation = $handler->getRotation( $file ); |
| 24 | + $this->assertTrue( $this->handler->normaliseParams( $file, $params ) ); |
| 25 | + $rotation = $this->handler->getRotation( $file ); |
26 | 26 | |
27 | 27 | # Check if pre-rotation dimensions are still good |
28 | | - list( $width, $height ) = $handler->extractPreRotationDimensions( $params, $rotation ); |
| 28 | + list( $width, $height ) = $this->handler->extractPreRotationDimensions( $params, $rotation ); |
29 | 29 | $this->assertEquals( $file->getWidth(), $width, |
30 | 30 | "$name: pre-rotation width check, $rotation:$width" ); |
31 | 31 | $this->assertEquals( $file->getHeight(), $height, |
— | — | @@ -72,8 +72,7 @@ |
73 | 73 | * @dataProvider provideBitmapExtractPreRotationDimensions |
74 | 74 | */ |
75 | 75 | function testBitmapExtractPreRotationDimensions( $rotation, $expected ) { |
76 | | - $handler = new BitmapHandler; |
77 | | - $result = $handler->extractPreRotationDimensions( array( |
| 76 | + $result = $this->handler->extractPreRotationDimensions( array( |
78 | 77 | 'physicalWidth' => self::TEST_WIDTH, |
79 | 78 | 'physicalHeight' => self::TEST_HEIGHT, |
80 | 79 | ), $rotation ); |
— | — | @@ -100,5 +99,22 @@ |
101 | 100 | ), |
102 | 101 | ); |
103 | 102 | } |
| 103 | + |
| 104 | + function testWidthFlipping() { |
| 105 | + $file = UnregisteredLocalFile::newFromPath( $this->filePath . 'portrait-rotated.jpg', 'image/jpeg' ); |
| 106 | + $params = array( 'width' => '50' ); |
| 107 | + $this->assertTrue( $this->handler->normaliseParams( $file, $params ) ); |
| 108 | + |
| 109 | + $this->assertEquals( 50, $params['height'] ); |
| 110 | + $this->assertEquals( round( (768/1024)*50 ), $params['width'], '', 0.1 ); |
| 111 | + } |
| 112 | + function testWidthNotFlipping() { |
| 113 | + $file = UnregisteredLocalFile::newFromPath( $this->filePath . 'landscape-plain.jpg', 'image/jpeg' ); |
| 114 | + $params = array( 'width' => '50' ); |
| 115 | + $this->assertTrue( $this->handler->normaliseParams( $file, $params ) ); |
| 116 | + |
| 117 | + $this->assertEquals( 50, $params['width'] ); |
| 118 | + $this->assertEquals( round( (768/1024)*50 ), $params['height'], '', 0.1 ); |
| 119 | + } |
104 | 120 | } |
105 | 121 | |
Index: branches/REL1_18/phase3/tests/phpunit/includes/media/BitmapScalingTest.php |
— | — | @@ -1,13 +1,24 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class BitmapScalingTest extends MediaWikiTestCase { |
| 5 | + |
| 6 | + function setUp() { |
| 7 | + global $wgMaxImageArea; |
| 8 | + $this->oldMaxImageArea = $wgMaxImageArea; |
| 9 | + $wgMaxImageArea = 1.25e7; // 3500x3500 |
| 10 | + } |
| 11 | + function tearDown() { |
| 12 | + global $wgMaxImageArea; |
| 13 | + $wgMaxImageArea = $this->oldMaxImageArea; |
| 14 | + } |
5 | 15 | /** |
6 | 16 | * @dataProvider provideNormaliseParams |
7 | 17 | */ |
8 | 18 | function testNormaliseParams( $fileDimensions, $expectedParams, $params, $msg ) { |
9 | 19 | $file = new FakeDimensionFile( $fileDimensions ); |
10 | 20 | $handler = new BitmapHandler; |
11 | | - $handler->normaliseParams( $file, $params ); |
| 21 | + $valid = $handler->normaliseParams( $file, $params ); |
| 22 | + $this->assertTrue( $valid ); |
12 | 23 | $this->assertEquals( $expectedParams, $params, $msg ); |
13 | 24 | } |
14 | 25 | |
— | — | @@ -77,11 +88,37 @@ |
78 | 89 | array( 'width' => 10, 'height' => 5 ), |
79 | 90 | 'Very high image with height set', |
80 | 91 | ), |
| 92 | + /* Max image area */ |
| 93 | + array( |
| 94 | + array( 4000, 4000 ), |
| 95 | + array( |
| 96 | + 'width' => 5000, 'height' => 5000, |
| 97 | + 'physicalWidth' => 4000, 'physicalHeight' => 4000, |
| 98 | + 'page' => 1, |
| 99 | + ), |
| 100 | + array( 'width' => 5000 ), |
| 101 | + 'Bigger than max image size but doesn\'t need scaling', |
| 102 | + ), |
81 | 103 | ); |
82 | 104 | } |
| 105 | + function testTooBigImage() { |
| 106 | + $file = new FakeDimensionFile( array( 4000, 4000 ) ); |
| 107 | + $handler = new BitmapHandler; |
| 108 | + $params = array( 'width' => '3700' ); // Still bigger than max size. |
| 109 | + $this->assertFalse( $handler->normaliseParams( $file, $params ) ); |
| 110 | + } |
| 111 | + function testTooBigMustRenderImage() { |
| 112 | + $file = new FakeDimensionFile( array( 4000, 4000 ) ); |
| 113 | + $file->mustRender = true; |
| 114 | + $handler = new BitmapHandler; |
| 115 | + $params = array( 'width' => '5000' ); // Still bigger than max size. |
| 116 | + $this->assertFalse( $handler->normaliseParams( $file, $params ) ); |
| 117 | + } |
83 | 118 | } |
84 | 119 | |
85 | 120 | class FakeDimensionFile extends File { |
| 121 | + public $mustRender = false; |
| 122 | + |
86 | 123 | public function __construct( $dimensions ) { |
87 | 124 | parent::__construct( Title::makeTitle( NS_FILE, 'Test' ), null ); |
88 | 125 | |
— | — | @@ -93,4 +130,7 @@ |
94 | 131 | public function getHeight( $page = 1 ) { |
95 | 132 | return $this->dimensions[1]; |
96 | 133 | } |
97 | | -} |
\ No newline at end of file |
| 134 | + public function mustRender() { |
| 135 | + return $this->mustRender; |
| 136 | + } |
| 137 | +} |
Index: branches/REL1_18/phase3/includes/objectcache/BagOStuff.php |
— | — | @@ -91,6 +91,16 @@ |
92 | 92 | return array(); |
93 | 93 | } |
94 | 94 | |
| 95 | + /** |
| 96 | + * Delete all objects expiring before a certain date. |
| 97 | + * |
| 98 | + * @return true on success, false if unimplemented |
| 99 | + */ |
| 100 | + public function deleteObjectsExpiringBefore( $date ) { |
| 101 | + // stub |
| 102 | + return false; |
| 103 | + } |
| 104 | + |
95 | 105 | /* *** Emulated functions *** */ |
96 | 106 | |
97 | 107 | public function add( $key, $value, $exptime = 0 ) { |
Index: branches/REL1_18/phase3/includes/objectcache/SqlBagOStuff.php |
— | — | @@ -305,21 +305,29 @@ |
306 | 306 | } |
307 | 307 | |
308 | 308 | public function expireAll() { |
| 309 | + $this->deleteObjectsExpiringBefore( wfTimestampNow() ); |
| 310 | + } |
| 311 | + |
| 312 | + /** |
| 313 | + * Delete objects from the database which expire before a certain date. |
| 314 | + */ |
| 315 | + public function deleteObjectsExpiringBefore( $timestamp ) { |
309 | 316 | $db = $this->getDB(); |
310 | | - $now = $db->timestamp(); |
| 317 | + $dbTimestamp = $db->timestamp( $timestamp ); |
311 | 318 | |
312 | 319 | try { |
313 | 320 | for ( $i = 0; $i < $this->shards; $i++ ) { |
314 | 321 | $db->begin(); |
315 | 322 | $db->delete( |
316 | 323 | $this->getTableByShard( $i ), |
317 | | - array( 'exptime < ' . $db->addQuotes( $now ) ), |
| 324 | + array( 'exptime < ' . $db->addQuotes( $dbTimestamp ) ), |
318 | 325 | __METHOD__ ); |
319 | 326 | $db->commit(); |
320 | 327 | } |
321 | 328 | } catch ( DBQueryError $e ) { |
322 | 329 | $this->handleWriteError( $e ); |
323 | 330 | } |
| 331 | + return true; |
324 | 332 | } |
325 | 333 | |
326 | 334 | public function deleteAll() { |
Index: branches/REL1_18/phase3/includes/objectcache/MultiWriteBagOStuff.php |
— | — | @@ -89,9 +89,25 @@ |
90 | 90 | array_shift( $args ); |
91 | 91 | |
92 | 92 | foreach ( $this->caches as $cache ) { |
93 | | - $ret = $ret && call_user_func_array( array( $cache, $method ), $args ); |
| 93 | + if ( !call_user_func_array( array( $cache, $method ), $args ) ) { |
| 94 | + $ret = false; |
| 95 | + } |
94 | 96 | } |
95 | 97 | return $ret; |
96 | 98 | } |
97 | 99 | |
| 100 | + /** |
| 101 | + * Delete objects expiring before a certain date. |
| 102 | + * |
| 103 | + * Succeed if any of the child caches succeed. |
| 104 | + */ |
| 105 | + public function deleteObjectsExpiringBefore( $date ) { |
| 106 | + $ret = false; |
| 107 | + foreach ( $this->caches as $cache ) { |
| 108 | + if ( $cache->deleteObjectsExpiringBefore( $date ) ) { |
| 109 | + $ret = true; |
| 110 | + } |
| 111 | + } |
| 112 | + return $ret; |
| 113 | + } |
98 | 114 | } |
Index: branches/REL1_18/phase3/includes/LocalisationCache.php |
— | — | @@ -609,6 +609,11 @@ |
610 | 610 | # Run hooks |
611 | 611 | wfRunHooks( 'LocalisationCacheRecache', array( $this, $code, &$allData ) ); |
612 | 612 | |
| 613 | + if ( is_null( $allData['namespaceNames'] ) ) { |
| 614 | + throw new MWException( __METHOD__.': Localisation data failed sanity check! ' . |
| 615 | + 'Check that your languages/messages/MessagesEn.php file is intact.' ); |
| 616 | + } |
| 617 | + |
613 | 618 | # Set the preload key |
614 | 619 | $allData['preload'] = $this->buildPreload( $allData ); |
615 | 620 | |
Index: branches/REL1_18/phase3/includes/parser/Preprocessor_DOM.php |
— | — | @@ -155,7 +155,8 @@ |
156 | 156 | if ( !$result ) { |
157 | 157 | // Try running the XML through UtfNormal to get rid of invalid characters |
158 | 158 | $xml = UtfNormal::cleanUp( $xml ); |
159 | | - $result = $dom->loadXML( $xml ); |
| 159 | + // 1 << 19 == XML_PARSE_HUGE, needed so newer versions of libxml2 don't barf when the XML is >256 levels deep |
| 160 | + $result = $dom->loadXML( $xml, 1 << 19 ); |
160 | 161 | if ( !$result ) { |
161 | 162 | throw new MWException( __METHOD__.' generated invalid XML' ); |
162 | 163 | } |
Index: branches/REL1_18/phase3/includes/media/Bitmap.php |
— | — | @@ -15,7 +15,9 @@ |
16 | 16 | |
17 | 17 | /** |
18 | 18 | * @param $image File |
19 | | - * @param $params |
| 19 | + * @param $params array Transform parameters. Entries with the keys 'width' |
| 20 | + * and 'height' are the respective screen width and height, while the keys |
| 21 | + * 'physicalWidth' and 'physicalHeight' indicate the thumbnail dimensions. |
20 | 22 | * @return bool |
21 | 23 | */ |
22 | 24 | function normaliseParams( $image, &$params ) { |
— | — | @@ -25,38 +27,36 @@ |
26 | 28 | } |
27 | 29 | |
28 | 30 | $mimeType = $image->getMimeType(); |
| 31 | + # Obtain the source, pre-rotation dimensions |
29 | 32 | $srcWidth = $image->getWidth( $params['page'] ); |
30 | 33 | $srcHeight = $image->getHeight( $params['page'] ); |
31 | 34 | |
32 | | - $swapDimensions = false; |
| 35 | + # Don't make an image bigger than the source |
| 36 | + if ( $params['physicalWidth'] >= $srcWidth ) { |
| 37 | + $params['physicalWidth'] = $srcWidth; |
| 38 | + $params['physicalHeight'] = $srcHeight; |
| 39 | + |
| 40 | + # Skip scaling limit checks if no scaling is required |
| 41 | + # due to requested size being bigger than source. |
| 42 | + if ( !$image->mustRender() ) { |
| 43 | + return true; |
| 44 | + } |
| 45 | + } |
| 46 | + |
| 47 | + |
33 | 48 | if ( self::canRotate() ) { |
34 | 49 | $rotation = $this->getRotation( $image ); |
35 | 50 | if ( $rotation == 90 || $rotation == 270 ) { |
36 | 51 | wfDebug( __METHOD__ . ": Swapping width and height because the file will be rotated $rotation degrees\n" ); |
37 | 52 | |
38 | | - $swapDimensions = true; |
39 | 53 | list( $params['width'], $params['height'] ) = |
40 | | - array( $params['width'], $params['height'] ); |
| 54 | + array( $params['height'], $params['width'] ); |
41 | 55 | list( $params['physicalWidth'], $params['physicalHeight'] ) = |
42 | | - array( $params['physicalWidth'], $params['physicalHeight'] ); |
| 56 | + array( $params['physicalHeight'], $params['physicalWidth'] ); |
43 | 57 | } |
44 | 58 | } |
45 | 59 | |
46 | | - # Don't make an image bigger than the source |
47 | | - if ( $params['physicalWidth'] >= $srcWidth ) { |
48 | | - if ( $swapDimensions ) { |
49 | | - $params['physicalWidth'] = $srcHeight; |
50 | | - $params['physicalHeight'] = $srcWidth; |
51 | | - } else { |
52 | | - $params['physicalWidth'] = $srcWidth; |
53 | | - $params['physicalHeight'] = $srcHeight; |
54 | | - } |
55 | | - } |
56 | 60 | |
57 | | - # Skip scaling limit checks if no scaling is required |
58 | | - if ( !$image->mustRender() ) |
59 | | - return true; |
60 | | - |
61 | 61 | # Don't thumbnail an image so big that it will fill hard drives and send servers into swap |
62 | 62 | # JPEG has the handy property of allowing thumbnailing without full decompression, so we make |
63 | 63 | # an exception for it. |
Index: branches/REL1_18/phase3/includes/AuthPlugin.php |
— | — | @@ -262,6 +262,15 @@ |
263 | 263 | public function getUserInstance( User &$user ) { |
264 | 264 | return new AuthPluginUser( $user ); |
265 | 265 | } |
| 266 | + |
| 267 | + /** |
| 268 | + * Get a list of domains (in HTMLForm options format) used. |
| 269 | + * |
| 270 | + * @return array |
| 271 | + */ |
| 272 | + public function domainList() { |
| 273 | + return array(); |
| 274 | + } |
266 | 275 | } |
267 | 276 | |
268 | 277 | class AuthPluginUser { |
Index: branches/REL1_18/phase3/includes/specials/SpecialPasswordReset.php |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | } |
46 | 46 | |
47 | 47 | protected function getFormFields() { |
48 | | - global $wgPasswordResetRoutes; |
| 48 | + global $wgPasswordResetRoutes, $wgAuth; |
49 | 49 | $a = array(); |
50 | 50 | if ( isset( $wgPasswordResetRoutes['username'] ) && $wgPasswordResetRoutes['username'] ) { |
51 | 51 | $a['Username'] = array( |
— | — | @@ -60,6 +60,15 @@ |
61 | 61 | ); |
62 | 62 | } |
63 | 63 | |
| 64 | + if ( isset( $wgPasswordResetRoutes['domain'] ) && $wgPasswordResetRoutes['domain'] ) { |
| 65 | + $domains = $wgAuth->domainList(); |
| 66 | + $a['Domain'] = array( |
| 67 | + 'type' => 'select', |
| 68 | + 'options' => $domains, |
| 69 | + 'label-message' => 'passwordreset-domain', |
| 70 | + ); |
| 71 | + } |
| 72 | + |
64 | 73 | return $a; |
65 | 74 | } |
66 | 75 | |
— | — | @@ -76,6 +85,9 @@ |
77 | 86 | if ( isset( $wgPasswordResetRoutes['email'] ) && $wgPasswordResetRoutes['email'] ) { |
78 | 87 | $i++; |
79 | 88 | } |
| 89 | + if ( isset( $wgPasswordResetRoutes['domain'] ) && $wgPasswordResetRoutes['domain'] ) { |
| 90 | + $i++; |
| 91 | + } |
80 | 92 | return wfMessage( 'passwordreset-pretext', $i )->parseAsBlock(); |
81 | 93 | } |
82 | 94 | |
— | — | @@ -87,7 +99,16 @@ |
88 | 100 | * @return Bool|Array |
89 | 101 | */ |
90 | 102 | public function onSubmit( array $data ) { |
| 103 | + global $wgAuth; |
91 | 104 | |
| 105 | + if ( isset( $data['Domain'] ) ) { |
| 106 | + if ( $wgAuth->validDomain( $data['Domain'] ) ) { |
| 107 | + $wgAuth->setDomain( $data['Domain'] ); |
| 108 | + } else { |
| 109 | + $wgAuth->setDomain( 'invaliddomain' ); |
| 110 | + } |
| 111 | + } |
| 112 | + |
92 | 113 | if ( isset( $data['Username'] ) && $data['Username'] !== '' ) { |
93 | 114 | $method = 'username'; |
94 | 115 | $users = array( User::newFromName( $data['Username'] ) ); |
Index: branches/REL1_18/phase3/includes/specials/SpecialDeletedContributions.php |
— | — | @@ -63,7 +63,7 @@ |
64 | 64 | 'tables' => array( 'archive' ), |
65 | 65 | 'fields' => array( |
66 | 66 | 'ar_rev_id', 'ar_namespace', 'ar_title', 'ar_timestamp', 'ar_comment', 'ar_minor_edit', |
67 | | - 'ar_user', 'ar_user_text', 'ar_deleted', 'ar_len' |
| 67 | + 'ar_user', 'ar_user_text', 'ar_deleted' |
68 | 68 | ), |
69 | 69 | 'conds' => $conds, |
70 | 70 | 'options' => array( 'USE INDEX' => $index ) |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | $condition = array(); |
76 | 76 | |
77 | 77 | $condition['ar_user_text'] = $this->target; |
78 | | - $index = array( 'archive' => 'ar_usertext_timestamp' ); |
| 78 | + $index = 'usertext_timestamp'; |
79 | 79 | |
80 | 80 | return array( $index, $condition ); |
81 | 81 | } |
— | — | @@ -235,8 +235,7 @@ |
236 | 236 | wfMsg( 'parentheses', $wgLang->pipeList( array( $last, $dellog, $reviewlink ) ) ) |
237 | 237 | ); |
238 | 238 | |
239 | | - $diffOut = Linker::formatRevisionSize( $row->ar_len ); |
240 | | - $ret = "{$del}{$link} {$tools} . . {$mflag} {$diffOut} {$pagelink} {$comment}"; |
| 239 | + $ret = "{$del}{$link} {$tools} . . {$mflag} {$pagelink} {$comment}"; |
241 | 240 | |
242 | 241 | # Denote if username is redacted for this edit |
243 | 242 | if( $rev->isDeleted( Revision::DELETED_USER ) ) { |
Index: branches/REL1_18/phase3/languages/messages/MessagesQqq.php |
— | — | @@ -3300,7 +3300,9 @@ |
3301 | 3301 | |
3302 | 3302 | This field labels what the compression of the image is. It is commonly seen in Tiff images. It uses messages like {{msg-mw|exif-compression-1}} for the value. http://en.wikipedia.org/wiki/TIFF#TIFF_Compression_Tag has information about this field.', |
3303 | 3303 | 'exif-photometricinterpretation' => 'Exif is a format for storing metadata in image files. See this [http://en.wikipedia.org/wiki/Exchangeable_image_file_format Wikipedia article] and the example at the bottom of [http://commons.wikimedia.org/wiki/File:Phalacrocorax-auritus-020.jpg this page on Commons]. The tags are explained [http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif.html briefly] and [http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf in further detail].', |
3304 | | -'exif-orientation' => 'Exif is a format for storing metadata in image files. See this [http://en.wikipedia.org/wiki/Exchangeable_image_file_format Wikipedia article] and the example at the bottom of [http://commons.wikimedia.org/wiki/File:Phalacrocorax-auritus-020.jpg this page on Commons]. The tags are explained [http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif.html briefly] and [http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf in further detail].', |
| 3304 | +'exif-orientation' => 'Exif is a format for storing metadata in image files. See this [http://en.wikipedia.org/wiki/Exchangeable_image_file_format Wikipedia article] and the example at the bottom of [http://commons.wikimedia.org/wiki/File:Phalacrocorax-auritus-020.jpg this page on Commons]. The tags are explained [http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif.html briefly] and [http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf in further detail]. |
| 3305 | + |
| 3306 | +For specific information on the orientation tag, see http://sylvana.net/jpegcrop/exif_orientation.html', |
3305 | 3307 | 'exif-samplesperpixel' => 'Exif is a format for storing metadata in image files. See this [http://en.wikipedia.org/wiki/Exchangeable_image_file_format Wikipedia article] and the example at the bottom of [http://commons.wikimedia.org/wiki/File:Phalacrocorax-auritus-020.jpg this page on Commons]. The tags are explained [http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif.html briefly] and [http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf in further detail].', |
3306 | 3308 | 'exif-planarconfiguration' => 'Exif is a format for storing metadata in image files. See this [http://en.wikipedia.org/wiki/Exchangeable_image_file_format Wikipedia article] and the example at the bottom of [http://commons.wikimedia.org/wiki/File:Phalacrocorax-auritus-020.jpg this page on Commons]. The tags are explained [http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif.html briefly] and [http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf in further detail].', |
3307 | 3309 | 'exif-ycbcrsubsampling' => 'Exif is a format for storing metadata in image files. See this [http://en.wikipedia.org/wiki/Exchangeable_image_file_format Wikipedia article] and the example at the bottom of [http://commons.wikimedia.org/wiki/File:Phalacrocorax-auritus-020.jpg this page on Commons]. The tags are explained [http://www.awaresystems.be/imaging/tiff/tifftags/privateifd/exif.html briefly] and [http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf in further detail].', |
Index: branches/REL1_18/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1176,6 +1176,7 @@ |
1177 | 1177 | 'passwordreset-disabled' => 'Password resets have been disabled on this wiki.', |
1178 | 1178 | 'passwordreset-pretext' => '{{PLURAL:$1||Enter one of the pieces of data below}}', |
1179 | 1179 | 'passwordreset-username' => 'Username:', |
| 1180 | +'passwordreset-domain' => 'Domain:', |
1180 | 1181 | 'passwordreset-email' => 'E-mail address:', |
1181 | 1182 | 'passwordreset-emailtitle' => 'Account details on {{SITENAME}}', |
1182 | 1183 | 'passwordreset-emailtext-ip' => 'Someone (probably you, from IP address $1) requested a reminder of your |
— | — | @@ -3957,9 +3958,9 @@ |
3958 | 3959 | 'exif-orientation-3' => 'Rotated 180°', |
3959 | 3960 | 'exif-orientation-4' => 'Flipped vertically', |
3960 | 3961 | 'exif-orientation-5' => 'Rotated 90° CCW and flipped vertically', |
3961 | | -'exif-orientation-6' => 'Rotated 90° CW', |
| 3962 | +'exif-orientation-6' => 'Rotated 90° CCW', |
3962 | 3963 | 'exif-orientation-7' => 'Rotated 90° CW and flipped vertically', |
3963 | | -'exif-orientation-8' => 'Rotated 90° CCW', |
| 3964 | +'exif-orientation-8' => 'Rotated 90° CW', |
3964 | 3965 | |
3965 | 3966 | 'exif-planarconfiguration-1' => 'chunky format', |
3966 | 3967 | 'exif-planarconfiguration-2' => 'planar format', |
Index: branches/REL1_18/phase3/resources/jquery/jquery.tablesorter.js |
— | — | @@ -75,10 +75,12 @@ |
76 | 76 | } |
77 | 77 | |
78 | 78 | function getElementText( node ) { |
79 | | - if ( node.hasAttribute && node.hasAttribute( 'data-sort-value' ) ) { |
80 | | - return node.getAttribute( 'data-sort-value' ); |
| 79 | + var $node = $( node ), |
| 80 | + data = $node.attr( 'data-sort-value' ); |
| 81 | + if ( data !== undefined ) { |
| 82 | + return data; |
81 | 83 | } else { |
82 | | - return $( node ).text(); |
| 84 | + return $node.text(); |
83 | 85 | } |
84 | 86 | } |
85 | 87 | |