Index: trunk/phase3/maintenance/parserTests.txt |
— | — | @@ -1045,7 +1045,7 @@ |
1046 | 1046 | !! result |
1047 | 1047 | <table> |
1048 | 1048 | <tr> |
1049 | | -<td><a href="ftp://|x||" class='external free' title="ftp://|x||" rel="nofollow">ftp://|x</td><td></a>" onmouseover="alert(document.cookie)">test |
| 1049 | +<td><a href="ftp://|x||" class='external autonumber' title="ftp://|x||" rel="nofollow">[1]</td><td></a>" onmouseover="alert(document.cookie)">test |
1050 | 1050 | </td> |
1051 | 1051 | </tr> |
1052 | 1052 | </table> |
— | — | @@ -3949,6 +3949,27 @@ |
3950 | 3950 | |
3951 | 3951 | !! end |
3952 | 3952 | |
| 3953 | +!!test |
| 3954 | +bug 5918: autonumbering |
| 3955 | +!! input |
| 3956 | +[http://first/] [http://second] [ftp://ftp] |
| 3957 | + |
| 3958 | +ftp://inlineftp |
| 3959 | + |
| 3960 | +[mailto:enclosed@mail.tld With target] |
| 3961 | + |
| 3962 | +[mailto:enclosed@mail.tld] |
| 3963 | + |
| 3964 | +mailto:inline@mail.tld |
| 3965 | +!! result |
| 3966 | +<p><a href="http://first/" class='external autonumber' title="http://first/" rel="nofollow">[1]</a> <a href="http://second" class='external autonumber' title="http://second" rel="nofollow">[2]</a> <a href="ftp://ftp" class='external autonumber' title="ftp://ftp" rel="nofollow">[3]</a> |
| 3967 | +</p><p><a href="ftp://inlineftp" class='external free' title="ftp://inlineftp" rel="nofollow">ftp://inlineftp</a> |
| 3968 | +</p><p><a href="mailto:enclosed@mail.tld" class='external text' title="mailto:enclosed@mail.tld" rel="nofollow">With target</a> |
| 3969 | +</p><p><a href="mailto:enclosed@mail.tld" class='external autonumber' title="mailto:enclosed@mail.tld" rel="nofollow">[4]</a> |
| 3970 | +</p><p><a href="mailto:inline@mail.tld" class='external free' title="mailto:inline@mail.tld" rel="nofollow">mailto:inline@mail.tld</a> |
| 3971 | +</p> |
| 3972 | +!! end |
| 3973 | + |
3953 | 3974 | # |
3954 | 3975 | # |
3955 | 3976 | # |
Index: trunk/phase3/includes/Parser.php |
— | — | @@ -1161,8 +1161,8 @@ |
1162 | 1162 | |
1163 | 1163 | # No link text, e.g. [http://domain.tld/some.link] |
1164 | 1164 | if ( $text == '' ) { |
1165 | | - # Autonumber if allowed |
1166 | | - if ( strpos( HTTP_PROTOCOLS, str_replace('/','\/', $protocol) ) !== false ) { |
| 1165 | + # Autonumber if allowed. See bug #5918 |
| 1166 | + if ( strpos( wfUrlProtocols(), substr($protocol, 0, strpos($protocol, ':')) ) !== false ) { |
1167 | 1167 | $text = '[' . ++$this->mAutonumber . ']'; |
1168 | 1168 | $linktype = 'autonumber'; |
1169 | 1169 | } else { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -257,6 +257,7 @@ |
258 | 258 | * (bug 5833) Introduce CURRENTVERSION magic word |
259 | 259 | * (bug 5370) Allow throttling of password reminder requests with the rate limiter |
260 | 260 | * (bug 5683) Respect parser output marked as uncacheable when saving |
| 261 | +* (bug 5918) Links autonumbering now work for all defined protocols |
261 | 262 | |
262 | 263 | == Compatibility == |
263 | 264 | |