Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -4164,7 +4164,7 @@ |
4165 | 4165 | 'vertAlign' => array( 'baseline', 'sub', 'super', 'top', 'text-top', 'middle', |
4166 | 4166 | 'bottom', 'text-bottom' ), |
4167 | 4167 | 'frame' => array( 'thumbnail', 'manualthumb', 'framed', 'frameless', |
4168 | | - 'upright', 'border', 'alt' ), |
| 4168 | + 'upright', 'border' ), |
4169 | 4169 | ); |
4170 | 4170 | static $internalParamMap; |
4171 | 4171 | if ( !$internalParamMap ) { |
— | — | @@ -4200,17 +4200,16 @@ |
4201 | 4201 | function makeImage( $title, $options, $holders = false ) { |
4202 | 4202 | # Check if the options text is of the form "options|alt text" |
4203 | 4203 | # Options are: |
4204 | | - # * thumbnail make a thumbnail with enlarge-icon and caption, alignment depends on lang |
4205 | | - # * left no resizing, just left align. label is used for alt= only |
4206 | | - # * right same, but right aligned |
4207 | | - # * none same, but not aligned |
4208 | | - # * ___px scale to ___ pixels width, no aligning. e.g. use in taxobox |
4209 | | - # * center center the image |
4210 | | - # * framed Keep original image size, no magnify-button. |
4211 | | - # * frameless like 'thumb' but without a frame. Keeps user preferences for width |
4212 | | - # * upright reduce width for upright images, rounded to full __0 px |
4213 | | - # * border draw a 1px border around the image |
4214 | | - # * alt Text for HTML alt attribute (defaults to empty) |
| 4204 | + # * thumbnail make a thumbnail with enlarge-icon and caption, alignment depends on lang |
| 4205 | + # * left no resizing, just left align. label is used for alt= only |
| 4206 | + # * right same, but right aligned |
| 4207 | + # * none same, but not aligned |
| 4208 | + # * ___px scale to ___ pixels width, no aligning. e.g. use in taxobox |
| 4209 | + # * center center the image |
| 4210 | + # * framed Keep original image size, no magnify-button. |
| 4211 | + # * frameless like 'thumb' but without a frame. Keeps user preferences for width |
| 4212 | + # * upright reduce width for upright images, rounded to full __0 px |
| 4213 | + # * border draw a 1px border around the image |
4215 | 4214 | # vertical-align values (no % or length right now): |
4216 | 4215 | # * baseline |
4217 | 4216 | # * sub |
— | — | @@ -4279,8 +4278,7 @@ |
4280 | 4279 | } else { |
4281 | 4280 | # Validate internal parameters |
4282 | 4281 | switch( $paramName ) { |
4283 | | - case 'manualthumb': |
4284 | | - case 'alt': |
| 4282 | + case "manualthumb": |
4285 | 4283 | /// @fixme - possibly check validity here? |
4286 | 4284 | /// downstream behavior seems odd with missing manual thumbs. |
4287 | 4285 | $validated = true; |
— | — | @@ -4309,6 +4307,22 @@ |
4310 | 4308 | $params['frame']['valign'] = key( $params['vertAlign'] ); |
4311 | 4309 | } |
4312 | 4310 | |
| 4311 | + # Strip bad stuff out of the alt text |
| 4312 | + # We can't just use replaceLinkHoldersText() here, because if this function |
| 4313 | + # is called from replaceInternalLinks2(), mLinkHolders won't be up to date. |
| 4314 | + if ( $holders ) { |
| 4315 | + $alt = $holders->replaceText( $caption ); |
| 4316 | + } else { |
| 4317 | + $alt = $this->replaceLinkHoldersText( $caption ); |
| 4318 | + } |
| 4319 | + |
| 4320 | + # make sure there are no placeholders in thumbnail attributes |
| 4321 | + # that are later expanded to html- so expand them now and |
| 4322 | + # remove the tags |
| 4323 | + $alt = $this->mStripState->unstripBoth( $alt ); |
| 4324 | + $alt = Sanitizer::stripAllTags( $alt ); |
| 4325 | + |
| 4326 | + $params['frame']['alt'] = $alt; |
4313 | 4327 | $params['frame']['caption'] = $caption; |
4314 | 4328 | |
4315 | 4329 | wfRunHooks( 'ParserMakeImageParams', array( $title, $file, &$params ) ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -140,8 +140,6 @@ |
141 | 141 | restriction types on the protection form. |
142 | 142 | * (bug 8440) Allow preventing blocked users from editing their talk pages |
143 | 143 | * Improved upload file type detection for OpenDocument formats |
144 | | -* (bug 368) Don't use caption for alt attribute; allow manual specification |
145 | | - using new "alt=" parameter for images |
146 | 144 | |
147 | 145 | |
148 | 146 | === Bug fixes in 1.14 === |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -287,7 +287,6 @@ |
288 | 288 | 'img_middle' => array( 1, 'middle' ), |
289 | 289 | 'img_bottom' => array( 1, 'bottom' ), |
290 | 290 | 'img_text_bottom' => array( 1, 'text-bottom' ), |
291 | | - 'img_alt' => array( 1, 'alt=$1', 'alt $1' ), |
292 | 291 | 'int' => array( 0, 'INT:' ), |
293 | 292 | 'sitename' => array( 1, 'SITENAME' ), |
294 | 293 | 'ns' => array( 0, 'NS:' ), |