Index: trunk/phase3/includes/Linker.php |
— | — | @@ -686,10 +686,10 @@ |
687 | 687 | * Make a "broken" link to an image |
688 | 688 | * |
689 | 689 | * @param $title Title object |
690 | | - * @param $text String: link label |
| 690 | + * @param $text String: link label in unescaped text form |
691 | 691 | * @param $query String: query string |
692 | | - * @param $trail String: link trail |
693 | | - * @param $prefix String: link prefix |
| 692 | + * @param $trail String: link trail (HTML fragment) |
| 693 | + * @param $prefix String: link prefix (HTML fragment) |
694 | 694 | * @param $time Boolean: a file of a certain timestamp was requested |
695 | 695 | * @return String |
696 | 696 | */ |
— | — | @@ -716,7 +716,7 @@ |
717 | 717 | wfProfileOut( __METHOD__ ); |
718 | 718 | return '<a href="' . htmlspecialchars( $href ) . '" class="new" title="' . |
719 | 719 | htmlspecialchars( $title->getPrefixedText(), ENT_QUOTES ) . '">' . |
720 | | - htmlspecialchars( $prefix . $text . $inside, ENT_NOQUOTES ) . '</a>' . $trail; |
| 720 | + "$prefix$text$inside</a>$trail"; |
721 | 721 | } else { |
722 | 722 | wfProfileOut( __METHOD__ ); |
723 | 723 | return $this->linkKnown( $title, "$prefix$text$inside", array(), $query ) . $trail; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -142,7 +142,10 @@ |
143 | 143 | * (bug 15905) Nostalgia skin could become more usable by including a Talk: |
144 | 144 | link at the top of the page |
145 | 145 | * (bug 27560) Search queries no longer fail in walloon language |
| 146 | +* (bug 27679) Broken embedded files with special characters longer double HTML |
| 147 | + escaped |
146 | 148 | |
| 149 | + |
147 | 150 | === API changes in 1.18 === |
148 | 151 | * (bug 26339) Throw warning when truncating an overlarge API result |
149 | 152 | * (bug 14869) Add API module for accessing QueryPage-based special pages |
Index: trunk/phase3/tests/parser/parserTests.txt |
— | — | @@ -8422,6 +8422,28 @@ |
8423 | 8423 | </p> |
8424 | 8424 | !! end |
8425 | 8425 | |
| 8426 | +!! test |
| 8427 | +Special characters in embedded file links (bug 27679) |
| 8428 | +!! input |
| 8429 | +[[File:Contains & ampersand.jpg]] |
| 8430 | +[[File:Does not exist.jpg|Title with & ampersand]] |
| 8431 | +!! result |
| 8432 | +<p><a href="https://www.mediawiki.org/index.php?title=Special:Upload&wpDestFile=Contains_%26_ampersand.jpg" class="new" title="File:Contains & ampersand.jpg">File:Contains & ampersand.jpg</a> |
| 8433 | +<a href="https://www.mediawiki.org/index.php?title=Special:Upload&wpDestFile=Does_not_exist.jpg" class="new" title="File:Does not exist.jpg">Title with & ampersand</a> |
| 8434 | +</p> |
| 8435 | +!! end |
| 8436 | + |
| 8437 | +!! test |
| 8438 | +Special characters in embedded file links (bug 27679) |
| 8439 | +!! input |
| 8440 | +[[File:Contains & ampersand.jpg]] |
| 8441 | +[[File:Does not exist.jpg|Title with & ampersand]] |
| 8442 | +!! result |
| 8443 | +<p><a href="https://www.mediawiki.org/index.php?title=Special:Upload&wpDestFile=Contains_%26_ampersand.jpg" class="new" title="File:Contains & ampersand.jpg">File:Contains & ampersand.jpg</a> |
| 8444 | +<a href="https://www.mediawiki.org/index.php?title=Special:Upload&wpDestFile=Does_not_exist.jpg" class="new" title="File:Does not exist.jpg">Title with & ampersand</a> |
| 8445 | +</p> |
| 8446 | +!! end |
| 8447 | + |
8426 | 8448 | TODO: |
8427 | 8449 | more images |
8428 | 8450 | more tables |