Index: branches/wmf/1.17wmf1/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js |
— | — | @@ -167,7 +167,7 @@ |
168 | 168 | $(this).css( 'white-space', 'nowrap' ); |
169 | 169 | if ( wrapper.width() <= $(this).get(0).scrollWidth ) { |
170 | 170 | var thisWidth = $(this).data( 'thisWidth' ) ? $(this).data( 'thisWidth' ) : 0; |
171 | | - thisWidth = Math.max( $(this).get(0).scrollWidth, thisWidth ); |
| 171 | + thisWidth = Math.max( $(this).get(0).width, thisWidth ); |
172 | 172 | $(this).width( thisWidth ); |
173 | 173 | $(this).data( 'thisWidth', thisWidth ); |
174 | 174 | var wrapperWidth = $(this).data( 'wrapperWidth' ) ? $(this).data( 'wrapperWidth' ) : 0; |
Index: branches/wmf/1.17wmf1/includes/Article.php |
— | — | @@ -1385,7 +1385,7 @@ |
1386 | 1386 | if ( !$this->hasViewableContent() ) { |
1387 | 1387 | // If there's no backing content, send a 404 Not Found |
1388 | 1388 | // for better machine handling of broken links. |
1389 | | - $wgRequest->response()->header( "HTTP/1.x 404 Not Found" ); |
| 1389 | + $wgRequest->response()->header( "HTTP/1.1 404 Not Found" ); |
1390 | 1390 | } |
1391 | 1391 | |
1392 | 1392 | $wgOut->addWikiText( $text ); |
Property changes on: branches/wmf/1.17wmf1/includes/Article.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1393 | 1393 | Merged /trunk/phase3/includes/Article.php:r80813,80815,83798,84459,84729,84820,84985,85140,85152,85194 |
Index: branches/wmf/1.17wmf1/includes/parser/CoreParserFunctions.php |
— | — | @@ -616,11 +616,41 @@ |
617 | 617 | '</span>' ); |
618 | 618 | } |
619 | 619 | |
620 | | - public static function filepath( $parser, $name='', $option='' ) { |
| 620 | + // Usage {{filepath|300}}, {{filepath|nowiki}}, {{filepath|nowiki|300}} or {{filepath|300|nowiki}} |
| 621 | + public static function filepath( $parser, $name='', $argA='', $argB='' ) { |
621 | 622 | $file = wfFindFile( $name ); |
622 | | - if( $file ) { |
623 | | - $url = $file->getFullUrl(); |
624 | | - if( $option == 'nowiki' ) { |
| 623 | + $size = ''; |
| 624 | + $argA_int = intval( $argA ); |
| 625 | + $argB_int = intval( $argB ); |
| 626 | + |
| 627 | + if ( $argB_int > 0 ) { |
| 628 | + // {{filepath: | option | size }} |
| 629 | + $size = $argB_int; |
| 630 | + $option = $argA; |
| 631 | + |
| 632 | + } elseif ( $argA_int > 0 ) { |
| 633 | + // {{filepath: | size [|option] }} |
| 634 | + $size = $argA_int; |
| 635 | + $option = $argB; |
| 636 | + |
| 637 | + } else { |
| 638 | + // {{filepath: [|option] }} |
| 639 | + $option = $argA; |
| 640 | + } |
| 641 | + |
| 642 | + if ( $file ) { |
| 643 | + $url = $file->getUrl(); |
| 644 | + |
| 645 | + // If a size is requested... |
| 646 | + if ( is_integer( $size ) ) { |
| 647 | + $mto = $file->transform( array( 'width' => $size ) ); |
| 648 | + // ... and we can |
| 649 | + if ( $mto && !$mto->isError() ) { |
| 650 | + // ... change the URL to point to a thumbnail. |
| 651 | + $url = wfExpandUrl( $mto->getUrl() ); |
| 652 | + } |
| 653 | + } |
| 654 | + if ( $option == 'nowiki' ) { |
625 | 655 | return array( $url, 'nowiki' => true ); |
626 | 656 | } |
627 | 657 | return $url; |
Index: branches/wmf/1.17wmf1/includes/api/ApiQueryImageInfo.php |
— | — | @@ -298,9 +298,11 @@ |
299 | 299 | $vals['thumbheight'] = intval( $file->getHeight() ); |
300 | 300 | } |
301 | 301 | |
302 | | - if ( isset( $prop['thumbmime'] ) ) { |
303 | | - $thumbFile = UnregisteredLocalFile::newFromPath( $mto->getPath(), false ); |
304 | | - $vals['thumbmime'] = $thumbFile->getMimeType(); |
| 302 | + if ( isset( $prop['thumbmime'] ) && $file->getHandler() ) { |
| 303 | + list( $ext, $mime ) = $file->getHandler()->getThumbType( |
| 304 | + substr( $mto->getPath(), strrpos( $mto->getPath(), '.' ) + 1 ), |
| 305 | + $file->getMimeType(), $thumbParams ); |
| 306 | + $vals['thumbmime'] = $mime; |
305 | 307 | } |
306 | 308 | } else if ( $mto && $mto->isError() ) { |
307 | 309 | $vals['thumberror'] = $mto->toText(); |
Property changes on: branches/wmf/1.17wmf1/includes/api/ApiQueryImageInfo.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
308 | 310 | Merged /trunk/phase3/includes/api/ApiQueryImageInfo.php:r80813,80815,83798,84459,84729,84820,84985,85140,85152,85194 |
Index: branches/wmf/1.17wmf1/includes/resourceloader/ResourceLoader.php |
— | — | @@ -359,9 +359,9 @@ |
360 | 360 | wfProfileOut( __METHOD__.'-getModifiedTime' ); |
361 | 361 | |
362 | 362 | if ( $context->getOnly() === 'styles' ) { |
363 | | - header( 'Content-Type: text/css' ); |
| 363 | + header( 'Content-Type: text/css; charset=utf-8' ); |
364 | 364 | } else { |
365 | | - header( 'Content-Type: text/javascript' ); |
| 365 | + header( 'Content-Type: text/javascript; charset=utf-8' ); |
366 | 366 | } |
367 | 367 | header( 'Last-Modified: ' . wfTimestamp( TS_RFC2822, $mtime ) ); |
368 | 368 | if ( $context->getDebug() ) { |
Property changes on: branches/wmf/1.17wmf1/includes/resourceloader/ResourceLoader.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
369 | 369 | Merged /trunk/phase3/includes/resourceloader/ResourceLoader.php:r80813,80815,83798,84459,84729,84820,84985,85140,85152,85194 |
Index: branches/wmf/1.17wmf1/includes/WebStart.php |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | ); |
36 | 36 | foreach ( $_REQUEST as $name => $value ) { |
37 | 37 | if( in_array( $name, $verboten ) ) { |
38 | | - header( "HTTP/1.x 500 Internal Server Error" ); |
| 38 | + header( "HTTP/1.1 500 Internal Server Error" ); |
39 | 39 | echo "register_globals security paranoia: trying to overwrite superglobals, aborting."; |
40 | 40 | die( -1 ); |
41 | 41 | } |
Index: branches/wmf/1.17wmf1/includes/Wiki.php |
— | — | @@ -197,7 +197,8 @@ |
198 | 198 | } |
199 | 199 | /* Check for a redirect loop */ |
200 | 200 | if( !preg_match( '/^' . preg_quote( $this->getVal('Server'), '/' ) . '/', $url ) && $title->isLocal() ) { |
201 | | - $output->redirect( $url ); |
| 201 | + // 301 so google et al report the target as the actual url. |
| 202 | + $output->redirect( $url, 301 ); |
202 | 203 | } else { |
203 | 204 | $title = SpecialPage::getTitleFor( 'Badtitle' ); |
204 | 205 | $output->setTitle( $title ); // bug 21456 |
Property changes on: branches/wmf/1.17wmf1/includes/Wiki.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
205 | 206 | Merged /trunk/phase3/includes/Wiki.php:r80813,80815,83798,84459,84729,84820,84985,85140,85152,85194 |
Index: branches/wmf/1.17wmf1/includes/Title.php |
— | — | @@ -3081,7 +3081,8 @@ |
3082 | 3082 | } |
3083 | 3083 | } |
3084 | 3084 | |
3085 | | - $pageid = $this->getArticleID(); |
| 3085 | + $dbw->begin(); # If $file was a LocalFile, its transaction would have closed our own. |
| 3086 | + $pageid = $this->getArticleID( GAID_FOR_UPDATE ); |
3086 | 3087 | $protected = $this->isProtected(); |
3087 | 3088 | if ( $nt->exists() ) { |
3088 | 3089 | $err = $this->moveOverExistingRedirect( $nt, $reason, $createRedirect ); |
— | — | @@ -3092,6 +3093,8 @@ |
3093 | 3094 | } |
3094 | 3095 | |
3095 | 3096 | if ( is_array( $err ) ) { |
| 3097 | + # FIXME: What about the File we have already moved? |
| 3098 | + $dbw->rollback(); |
3096 | 3099 | return $err; |
3097 | 3100 | } |
3098 | 3101 | $redirid = $this->getArticleID(); |
— | — | @@ -3159,6 +3162,8 @@ |
3160 | 3163 | $u = new SearchUpdate( $redirid, $this->getPrefixedDBkey(), '' ); |
3161 | 3164 | $u->doUpdate(); |
3162 | 3165 | |
| 3166 | + $dbw->commit(); |
| 3167 | + |
3163 | 3168 | # Update site_stats |
3164 | 3169 | if ( $this->isContentPage() && !$nt->isContentPage() ) { |
3165 | 3170 | # No longer a content page |
Property changes on: branches/wmf/1.17wmf1/includes/Title.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
3166 | 3171 | Merged /trunk/phase3/includes/Title.php:r80813,80815,83798,84459,84729,84820,84985,85140,85152,85194 |
Index: branches/wmf/1.17wmf1/includes/DefaultSettings.php |
— | — | @@ -5256,7 +5256,9 @@ |
5257 | 5257 | |
5258 | 5258 | /** |
5259 | 5259 | * Disable redirects to special pages and interwiki redirects, which use a 302 |
5260 | | - * and have no "redirected from" link. |
| 5260 | + * and have no "redirected from" link. Note this is only for articles with #Redirect |
| 5261 | + * in them. URL's containing a local interwiki prefix (or a non-canonical special |
| 5262 | + * page name) are still hard redirected regardless of this setting. |
5261 | 5263 | */ |
5262 | 5264 | $wgDisableHardRedirects = false; |
5263 | 5265 | |
Property changes on: branches/wmf/1.17wmf1/includes/DefaultSettings.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
5264 | 5266 | Merged /trunk/phase3/includes/DefaultSettings.php:r80813,80815,83798,84459,84729,84820,84985,85140,85152,85194 |
Index: branches/wmf/1.17wmf1/includes/specials/SpecialIpblocklist.php |
— | — | @@ -210,6 +210,9 @@ |
211 | 211 | } |
212 | 212 | $ip = $block->getRedactedName(); |
213 | 213 | } else { |
| 214 | + # FIXME: do proper sanitisation/cleanup here |
| 215 | + $ip = str_replace( '_', ' ', $ip ); |
| 216 | + |
214 | 217 | $block = Block::newFromDB( $ip ); |
215 | 218 | if ( !$block ) { |
216 | 219 | return array( 'ipb_cant_unblock', htmlspecialchars( $id ) ); |
Index: branches/wmf/1.17wmf1/includes/specials/SpecialFilepath.php |
— | — | @@ -50,9 +50,13 @@ |
51 | 51 | $url = $file->getURL(); |
52 | 52 | $width = $wgRequest->getInt( 'width', -1 ); |
53 | 53 | $height = $wgRequest->getInt( 'height', -1 ); |
| 54 | + |
| 55 | + // If a width is requested... |
54 | 56 | if ( $width != -1 ) { |
55 | 57 | $mto = $file->transform( array( 'width' => $width, 'height' => $height ) ); |
| 58 | + // ... and we can |
56 | 59 | if ( $mto && !$mto->isError() ) { |
| 60 | + // ... change the URL to point to a thumbnail. |
57 | 61 | $url = $mto->getURL(); |
58 | 62 | } |
59 | 63 | } |
Index: branches/wmf/1.17wmf1/RELEASE-NOTES |
— | — | @@ -495,12 +495,26 @@ |
496 | 496 | exist. |
497 | 497 | * (bug 28034) uploading file to local wiki when file exists on shared repository |
498 | 498 | (commons) gives spurious info in the warning message |
499 | | - |
500 | | -=== API changes in 1.17 === |
501 | | -* BREAKING CHANGE: action=patrol now requires POST |
502 | | -* BREAKING CHANGE: patrol token is no longer the same as edit token |
503 | | -* BREAKING CHANGE: Session keys returned by ApiUpload are now strings instead of integers |
504 | | -* (bug 24650) Fix API to work with categorylinks changes |
| 499 | +* Usernames get lost when selecting different sorts on Special:listfiles |
| 500 | +* (bug 14005) editing section 0 of an existing but empty page gives no such |
| 501 | + section error |
| 502 | +* (bug 26939) Installer does not set $wgMetaNamespace |
| 503 | +* (bug 28166) UploadBase assumes that 'edit' and 'upload' rights are not per |
| 504 | + page restrictions |
| 505 | +* Make truncate function automatically consider length of '...' string, |
| 506 | + since length can vary by localization. |
| 507 | +* (bug 28242) Make redirects generated by urls containing a local interwiki |
| 508 | + prefix be a 301 instead of a 302. |
| 509 | + |
| 510 | +=== API changes in 1.18 === |
| 511 | +* (bug 26339) Throw warning when truncating an overlarge API result |
| 512 | +* (bug 14869) Add API module for accessing QueryPage-based special pages |
| 513 | +* (bug 14020) API for Special:Unwatchedpages |
| 514 | +* (bug 24287) Wrap API Help output at 100 characters |
| 515 | +* Add a realname uiprop option to query=userinfo so a user's realname can be |
| 516 | + extracted |
| 517 | +* Add a &watchuser option to ApiBlock |
| 518 | +* (bug 26541) Generator-ise ApiQueryRecentChanges |
505 | 519 | * action=parse now correctly returns an error for nonexistent pages |
506 | 520 | * (bug 27201) Special:WhatLinksHere output no longer contains duplicate IDs |
507 | 521 | * (bug 27479) API error when using both prop=pageprops and |
Property changes on: branches/wmf/1.17wmf1/RELEASE-NOTES |
___________________________________________________________________ |
Modified: svn:mergeinfo |
508 | 522 | Merged /trunk/phase3/RELEASE-NOTES:r80813,80815,83798,84459,84729,84820,84985,85140,85152,85194 |
Index: branches/wmf/1.17wmf1/resources/mediawiki/mediawiki.js |
— | — | @@ -622,8 +622,12 @@ |
623 | 623 | } |
624 | 624 | } |
625 | 625 | } catch ( e ) { |
626 | | - mediaWiki.log( 'Exception thrown by ' + module + ': ' + e.message ); |
627 | | - mediaWiki.log( e ); |
| 626 | + // This needs to NOT use mw.log because these errors are common in production mode |
| 627 | + // and not in debug mode, such as when a symbol that should be global isn't exported |
| 628 | + if ( window.console && typeof window.console.log === 'function' ) { |
| 629 | + console.log( _fn + 'Exception thrown by ' + module + ': ' + e.message ); |
| 630 | + console.log( e ); |
| 631 | + } |
628 | 632 | registry[module].state = 'error'; |
629 | 633 | // Run error callbacks of jobs affected by this condition |
630 | 634 | for ( var j = 0; j < jobs.length; j++ ) { |
Property changes on: branches/wmf/1.17wmf1/resources/mediawiki/mediawiki.js |
___________________________________________________________________ |
Modified: svn:mergeinfo |
631 | 635 | Merged /trunk/phase3/resources/mediawiki/mediawiki.js:r80813,80815,83798,84459,84729,84820,84985,85140,85152,85194 |