Index: branches/wmf/1.19wmf1/extensions/AbuseFilter/AbuseFilter.class.php |
— | — | @@ -1293,13 +1293,20 @@ |
1294 | 1294 | return $user; |
1295 | 1295 | } |
1296 | 1296 | |
| 1297 | + /** |
| 1298 | + * @param $rules String |
| 1299 | + * @param $textName String |
| 1300 | + * @param $addResultDiv Boolean |
| 1301 | + * @param $canEdit Boolean |
| 1302 | + */ |
1297 | 1303 | static function buildEditBox( $rules, $textName = 'wpFilterRules', $addResultDiv = true, |
1298 | 1304 | $canEdit = true ) { |
1299 | 1305 | global $wgOut; |
1300 | 1306 | |
1301 | | - $readOnlyAttrib = array(); |
1302 | | - if ( !$canEdit ) |
1303 | | - $readOnlyAttrib['readonly'] = 'readonly'; |
| 1307 | + $textareaAttrib = array( 'dir' => 'ltr' ); # Rules are in English |
| 1308 | + if ( !$canEdit ) { |
| 1309 | + $textareaAttrib['readonly'] = 'readonly'; |
| 1310 | + } |
1304 | 1311 | |
1305 | 1312 | global $wgUser; |
1306 | 1313 | $noTestAttrib = array(); |
— | — | @@ -1309,7 +1316,7 @@ |
1310 | 1317 | } |
1311 | 1318 | |
1312 | 1319 | $rules = rtrim( $rules ) . "\n"; |
1313 | | - $rules = Xml::textarea( $textName, $rules, 40, 5, $readOnlyAttrib ); |
| 1320 | + $rules = Xml::textarea( $textName, $rules, 40, 5, $textareaAttrib ); |
1314 | 1321 | |
1315 | 1322 | $dropDown = self::getBuilderValues(); |
1316 | 1323 | // Generate builder drop-down |
Index: branches/wmf/1.19wmf1/extensions/AbuseFilter/modules/ext.abuseFilter.css |
— | — | @@ -115,9 +115,6 @@ |
116 | 116 | width: 50%; |
117 | 117 | } |
118 | 118 | |
119 | | -/* Rules are in English */ |
120 | | -/* @noflip */textarea#wpFilterRules { direction: ltr; } |
121 | | - |
122 | 119 | /* Name is in site content language */ |
123 | 120 | /* @noflip */.sitedir-ltr .TablePager_col_af_public_comments { |
124 | 121 | direction: ltr; |
Index: branches/wmf/1.19wmf1/extensions/wikihiero/SpecialHieroglyphs.php |
— | — | @@ -47,6 +47,7 @@ |
48 | 48 | $this->setHeaders(); |
49 | 49 | $out = $this->getContext()->getOutput(); |
50 | 50 | $out->addModules( 'ext.wikihiero.Special' ); |
| 51 | + $out->addModuleStyles( 'ext.wikihiero.Special' ); // apply CSS during slow load |
51 | 52 | $out->addWikiMsg( 'wikihiero-special-page-text' ); |
52 | 53 | |
53 | 54 | $out->addHTML( '<div id="hiero-result">' ); |
Index: branches/wmf/1.19wmf1/extensions/ContributionReporting/ContributionReporting.i18n.magic.php |
— | — | @@ -1,11 +0,0 @@ |
2 | | -<?php |
3 | | -/** |
4 | | - * Magic words for extension. |
5 | | - */ |
6 | | - |
7 | | -$magicWords = array(); |
8 | | - |
9 | | -/** English (English) */ |
10 | | -$magicWords['en'] = array( |
11 | | - 'contributiontotal' => array( 0, 'contributiontotal' ), |
12 | | -); |
Index: branches/wmf/1.19wmf1/extensions/ContributionReporting/ContributionReporting.magic.php |
— | — | @@ -0,0 +1,11 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Magic words for extension. |
| 5 | + */ |
| 6 | + |
| 7 | +$magicWords = array(); |
| 8 | + |
| 9 | +/** English (English) */ |
| 10 | +$magicWords['en'] = array( |
| 11 | + 'contributiontotal' => array( 0, 'contributiontotal' ), |
| 12 | +); |
Property changes on: branches/wmf/1.19wmf1/extensions/ContributionReporting/ContributionReporting.magic.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 13 | + native |
Added: svn:keywords |
2 | 14 | + Id |
Property changes on: branches/wmf/1.19wmf1/extensions |
___________________________________________________________________ |
Modified: svn:mergeinfo |
3 | 15 | Merged /trunk/extensions:r111043,111484,111575 |
Index: branches/wmf/1.19wmf1/includes/Cdb_PHP.php |
— | — | @@ -82,6 +82,9 @@ |
83 | 83 | * CDB reader class |
84 | 84 | */ |
85 | 85 | class CdbReader_PHP extends CdbReader { |
| 86 | + /** The filename */ |
| 87 | + var $fileName; |
| 88 | + |
86 | 89 | /** The file handle */ |
87 | 90 | var $handle; |
88 | 91 | |
— | — | @@ -110,9 +113,10 @@ |
111 | 114 | * @param $fileName string |
112 | 115 | */ |
113 | 116 | function __construct( $fileName ) { |
| 117 | + $this->fileName = $fileName; |
114 | 118 | $this->handle = fopen( $fileName, 'rb' ); |
115 | 119 | if ( !$this->handle ) { |
116 | | - throw new MWException( 'Unable to open CDB file "' . $fileName . '"' ); |
| 120 | + throw new MWException( 'Unable to open CDB file "' . $this->fileName . '".' ); |
117 | 121 | } |
118 | 122 | $this->findStart(); |
119 | 123 | } |
— | — | @@ -160,7 +164,8 @@ |
161 | 165 | protected function read( $length, $pos ) { |
162 | 166 | if ( fseek( $this->handle, $pos ) == -1 ) { |
163 | 167 | // This can easily happen if the internal pointers are incorrect |
164 | | - throw new MWException( __METHOD__.': seek failed, file may be corrupted.' ); |
| 168 | + throw new MWException( |
| 169 | + 'Seek failed, file "' . $this->fileName . '" may be corrupted.' ); |
165 | 170 | } |
166 | 171 | |
167 | 172 | if ( $length == 0 ) { |
— | — | @@ -169,7 +174,8 @@ |
170 | 175 | |
171 | 176 | $buf = fread( $this->handle, $length ); |
172 | 177 | if ( $buf === false || strlen( $buf ) !== $length ) { |
173 | | - throw new MWException( __METHOD__.': read from CDB file failed, file may be corrupted' ); |
| 178 | + throw new MWException( |
| 179 | + 'Read from CDB file failed, file "' . $this->fileName . '" may be corrupted.' ); |
174 | 180 | } |
175 | 181 | return $buf; |
176 | 182 | } |
— | — | @@ -182,7 +188,8 @@ |
183 | 189 | protected function unpack31( $s ) { |
184 | 190 | $data = unpack( 'V', $s ); |
185 | 191 | if ( $data[1] > 0x7fffffff ) { |
186 | | - throw new MWException( __METHOD__.': error in CDB file, integer too big' ); |
| 192 | + throw new MWException( |
| 193 | + 'Error in CDB file "' . $this->fileName . '", integer too big.' ); |
187 | 194 | } |
188 | 195 | return $data[1]; |
189 | 196 | } |
— | — | @@ -270,13 +277,14 @@ |
271 | 278 | $this->tmpFileName = $fileName . '.tmp.' . mt_rand( 0, 0x7fffffff ); |
272 | 279 | $this->handle = fopen( $this->tmpFileName, 'wb' ); |
273 | 280 | if ( !$this->handle ) { |
274 | | - throw new MWException( 'Unable to open CDB file for write "' . $fileName . '"' ); |
| 281 | + $this->throwException( |
| 282 | + 'Unable to open CDB file "' . $this->tmpFileName . '" for write.' ); |
275 | 283 | } |
276 | 284 | $this->hplist = array(); |
277 | 285 | $this->numentries = 0; |
278 | 286 | $this->pos = 2048; // leaving space for the pointer array, 256 * 8 |
279 | 287 | if ( fseek( $this->handle, $this->pos ) == -1 ) { |
280 | | - throw new MWException( __METHOD__.': fseek failed' ); |
| 288 | + $this->throwException( 'fseek failed in file "' . $this->tmpFileName . '".' ); |
281 | 289 | } |
282 | 290 | } |
283 | 291 | |
— | — | @@ -314,7 +322,7 @@ |
315 | 323 | unlink( $this->realFileName ); |
316 | 324 | } |
317 | 325 | if ( !rename( $this->tmpFileName, $this->realFileName ) ) { |
318 | | - throw new MWException( 'Unable to move the new CDB file into place.' ); |
| 326 | + $this->throwException( 'Unable to move the new CDB file into place.' ); |
319 | 327 | } |
320 | 328 | unset( $this->handle ); |
321 | 329 | } |
— | — | @@ -326,7 +334,7 @@ |
327 | 335 | protected function write( $buf ) { |
328 | 336 | $len = fwrite( $this->handle, $buf ); |
329 | 337 | if ( $len !== strlen( $buf ) ) { |
330 | | - throw new MWException( 'Error writing to CDB file.' ); |
| 338 | + $this->throwException( 'Error writing to CDB file "'.$this->tmpFileName.'".' ); |
331 | 339 | } |
332 | 340 | } |
333 | 341 | |
— | — | @@ -337,7 +345,8 @@ |
338 | 346 | protected function posplus( $len ) { |
339 | 347 | $newpos = $this->pos + $len; |
340 | 348 | if ( $newpos > 0x7fffffff ) { |
341 | | - throw new MWException( 'A value in the CDB file is too large' ); |
| 349 | + $this->throwException( |
| 350 | + 'A value in the CDB file "'.$this->tmpFileName.'" is too large.' ); |
342 | 351 | } |
343 | 352 | $this->pos = $newpos; |
344 | 353 | } |
— | — | @@ -366,10 +375,10 @@ |
367 | 376 | */ |
368 | 377 | protected function addbegin( $keylen, $datalen ) { |
369 | 378 | if ( $keylen > 0x7fffffff ) { |
370 | | - throw new MWException( __METHOD__.': key length too long' ); |
| 379 | + $this->throwException( 'Key length too long in file "'.$this->tmpFileName.'".' ); |
371 | 380 | } |
372 | 381 | if ( $datalen > 0x7fffffff ) { |
373 | | - throw new MWException( __METHOD__.': data length too long' ); |
| 382 | + $this->throwException( 'Data length too long in file "'.$this->tmpFileName.'".' ); |
374 | 383 | } |
375 | 384 | $buf = pack( 'VV', $keylen, $datalen ); |
376 | 385 | $this->write( $buf ); |
— | — | @@ -444,8 +453,22 @@ |
445 | 454 | // Write the pointer array at the start of the file |
446 | 455 | rewind( $this->handle ); |
447 | 456 | if ( ftell( $this->handle ) != 0 ) { |
448 | | - throw new MWException( __METHOD__.': Error rewinding to start of file' ); |
| 457 | + $this->throwException( 'Error rewinding to start of file "'.$this->tmpFileName.'".' ); |
449 | 458 | } |
450 | 459 | $this->write( $final ); |
451 | 460 | } |
| 461 | + |
| 462 | + /** |
| 463 | + * Clean up the temp file and throw an exception |
| 464 | + * |
| 465 | + * @param $msg string |
| 466 | + * @throws MWException |
| 467 | + */ |
| 468 | + protected function throwException( $msg ) { |
| 469 | + if ( $this->handle ) { |
| 470 | + fclose( $this->handle ); |
| 471 | + unlink( $this->tmpFileName ); |
| 472 | + } |
| 473 | + throw new MWException( $msg ); |
| 474 | + } |
452 | 475 | } |
Property changes on: branches/wmf/1.19wmf1/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
453 | 476 | Merged /trunk/phase3/includes:r111571,111574 |
Property changes on: branches/wmf/1.19wmf1 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
454 | 477 | Merged /trunk/phase3:r111571,111574 |