Index: trunk/phase3/includes/api/ApiQueryExtLinksUsage.php |
— | — | @@ -177,7 +177,9 @@ |
178 | 178 | global $wgUrlProtocols; |
179 | 179 | $protocols = array( '' ); |
180 | 180 | foreach ( $wgUrlProtocols as $p ) { |
181 | | - $protocols[] = substr( $p, 0, strpos( $p, ':' ) ); |
| 181 | + if ( $p !== '//' ) { |
| 182 | + $protocols[] = substr( $p, 0, strpos( $p, ':' ) ); |
| 183 | + } |
182 | 184 | } |
183 | 185 | return $protocols; |
184 | 186 | } |
Index: trunk/phase3/includes/specials/SpecialLinkSearch.php |
— | — | @@ -55,9 +55,10 @@ |
56 | 56 | $target = $request->getVal( 'target', $par ); |
57 | 57 | $namespace = $request->getIntorNull( 'namespace', null ); |
58 | 58 | |
59 | | - $protocols_list[] = ''; |
60 | 59 | foreach( $wgUrlProtocols as $prot ) { |
61 | | - $protocols_list[] = $prot; |
| 60 | + if ( $prot !== '//' ) { |
| 61 | + $protocols_list[] = $prot; |
| 62 | + } |
62 | 63 | } |
63 | 64 | |
64 | 65 | $target2 = $target; |
— | — | @@ -76,13 +77,13 @@ |
77 | 78 | // default |
78 | 79 | $protocol = 'http://'; |
79 | 80 | } |
80 | | - if ( !in_array( $protocol, $protocols_list ) ) { |
| 81 | + if ( $protocol != '' && !in_array( $protocol, $protocols_list ) ) { |
81 | 82 | // unsupported protocol, show original search request |
82 | 83 | $target2 = $target; |
83 | 84 | $protocol = ''; |
84 | 85 | } |
85 | 86 | |
86 | | - $out->addWikiMsg( 'linksearch-text', '<nowiki>' . $this->getLanguage()->commaList( $wgUrlProtocols ) . '</nowiki>' ); |
| 87 | + $out->addWikiMsg( 'linksearch-text', '<nowiki>' . $this->getLanguage()->commaList( $protocols_list ) . '</nowiki>' ); |
87 | 88 | $s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) . |
88 | 89 | Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) . |
89 | 90 | '<fieldset>' . |