Index: branches/wmf/1.18wmf1/extensions/ShortUrl/ShortUrl.php |
— | — | @@ -18,9 +18,11 @@ |
19 | 19 | /** |
20 | 20 | * Configuration variables |
21 | 21 | * Prefix to use for the shortened URL. mod_rewrite (or equivalent) needs to be setup |
22 | | - * to produce a shorter URL |
| 22 | + * to produce a shorter URL. See example redirect.htaccess file. |
23 | 23 | * Default is false which just uses the (not so short) URL that all Special Pages get |
24 | 24 | * Eg: http://en.wikipedia.org/wiki/Special:ShortUrl/5234 |
| 25 | + * An example value for this variable might be: |
| 26 | + * $wgShortUrlPrefix = '//en.wikipedia.org/r/'; |
25 | 27 | */ |
26 | 28 | $wgShortUrlPrefix = false; |
27 | 29 | |
— | — | @@ -52,5 +54,6 @@ |
53 | 55 | 'scripts' => 'js/ext.shortUrl.js', |
54 | 56 | 'styles' => 'css/ext.shortUrl.css', |
55 | 57 | 'localBasePath' => dirname( __FILE__ ), |
56 | | - 'remoteExtPath' => 'ShortUrl' |
| 58 | + 'remoteExtPath' => 'ShortUrl', |
| 59 | + 'dependencies' => array( 'mediawiki.Uri' ), |
57 | 60 | ); |
Index: branches/wmf/1.18wmf1/extensions/ShortUrl/SpecialShortUrl.php |
— | — | @@ -39,7 +39,8 @@ |
40 | 40 | if ( $title !== false ) { |
41 | 41 | $wgOut->redirect( $title->getFullURL(), '301' ); |
42 | 42 | } else { |
43 | | - $wgOut->showErrorPage( 'shorturl-not-found-title', 'shorturl-not-found-message', array( $par ) ); |
| 43 | + $parEsc = wfEscapeWikiText( $par ); |
| 44 | + $wgOut->showErrorPage( 'shorturl-not-found-title', 'shorturl-not-found-message', array( $parEsc ) ); |
44 | 45 | } |
45 | 46 | } |
46 | 47 | } |
Index: branches/wmf/1.18wmf1/extensions/ShortUrl/js/ext.shortUrl.js |
— | — | @@ -1,6 +1,15 @@ |
2 | 2 | jQuery( function( $ ) { |
3 | 3 | if( $( '#t-shorturl' ).length ) { |
4 | 4 | var url = $( '#t-shorturl a' ).attr( 'href' ); |
5 | | - $( '#firstHeading' ).append( $( '<div class="title-shortlink-container"></div>').append( $( '<a>' ).addClass( 'title-shortlink' ).attr( 'href', url ).text( url ) ) ); |
| 5 | + /* Add protocol for proto-relative urls */ |
| 6 | + var protoNonRelative = ( new mw.Uri( url ) ).toString(); |
| 7 | + $( '#firstHeading' ).append( |
| 8 | + $( '<div class="title-shortlink-container"></div>') |
| 9 | + .append( $( '<a>' ) |
| 10 | + .addClass( 'title-shortlink' ) |
| 11 | + .attr( 'href', url ) |
| 12 | + .text( protoNonRelative ) |
| 13 | + ) |
| 14 | + ); |
6 | 15 | } |
7 | 16 | }); |
Property changes on: branches/wmf/1.18wmf1/extensions/ShortUrl |
___________________________________________________________________ |
Modified: svn:mergeinfo |
8 | 17 | Merged /trunk/extensions/ShortUrl:r110824,110826 |