Index: trunk/phase3/maintenance/parserTests.txt |
— | — | @@ -3188,8 +3188,26 @@ |
3189 | 3189 | </p> |
3190 | 3190 | !! end |
3191 | 3191 | |
| 3192 | +!! test |
| 3193 | +Image with link parameter (wiki target) and unnamed parameter |
| 3194 | +!! input |
| 3195 | +[[Image:foobar.jpg|link=Target page|Title]] |
| 3196 | +!! result |
| 3197 | +<p><a href="https://www.mediawiki.org/wiki/Target_page" title="Title"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> |
| 3198 | +</p> |
| 3199 | +!! end |
3192 | 3200 | |
| 3201 | +!! test |
| 3202 | +Image with link parameter (URL target) and unnamed parameter |
| 3203 | +!! input |
| 3204 | +[[Image:foobar.jpg|link=http://example.com/|Title]] |
| 3205 | +!! result |
| 3206 | +<p><a href="http://example.com/" title="Title"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> |
| 3207 | +</p> |
| 3208 | +!! end |
3193 | 3209 | |
| 3210 | + |
| 3211 | + |
3194 | 3212 | !! test |
3195 | 3213 | Image with frame and link |
3196 | 3214 | !! input |
Index: trunk/phase3/includes/MediaTransformOutput.php |
— | — | @@ -153,14 +153,18 @@ |
154 | 154 | $alt = empty( $options['alt'] ) ? '' : $options['alt']; |
155 | 155 | # Note: if title is empty and alt is not, make the title empty, don't |
156 | 156 | # use alt; only use alt if title is not set |
157 | | - $title = !isset( $options['title'] ) ? $alt : $options['title']; |
| 157 | + $title = !isset( $options['title'] ) ? $alt : $options['title']; |
158 | 158 | $query = empty($options['desc-query']) ? '' : $options['desc-query']; |
159 | 159 | |
160 | 160 | if ( !empty( $options['custom-url-link'] ) ) { |
161 | 161 | $linkAttribs = array( 'href' => $options['custom-url-link'] ); |
| 162 | + if ( $alt ) { |
| 163 | + $linkAttribs['title'] = $alt; |
| 164 | + } |
162 | 165 | } elseif ( !empty( $options['custom-title-link'] ) ) { |
163 | 166 | $title = $options['custom-title-link']; |
164 | | - $linkAttribs = array( 'href' => $title->getLinkUrl(), 'title' => $title->getFullText() ); |
| 167 | + $linkAttribs = array( 'href' => $title->getLinkUrl(), |
| 168 | + 'title' => empty( $options['alt'] ) ? $title->getFullText() : $alt ); |
165 | 169 | } elseif ( !empty( $options['desc-link'] ) ) { |
166 | 170 | $linkAttribs = $this->getDescLinkAttribs( $title, $query ); |
167 | 171 | } elseif ( !empty( $options['file-link'] ) ) { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -121,6 +121,7 @@ |
122 | 122 | tweaked spacing. |
123 | 123 | * (bug 18656) Use proper directory separators in wfMkdirParents() |
124 | 124 | * (bug 18549) Make Special:Blockip respect $wgEnableUserEmail and $wgSysopEmailBans |
| 125 | +* (bug 16912) Tooltips on images with link= disappear |
125 | 126 | |
126 | 127 | == API changes in 1.16 == |
127 | 128 | |