Index: trunk/phase3/includes/Parser.php |
— | — | @@ -3173,6 +3173,13 @@ |
3174 | 3174 | $valid = '0123456789-Xx'; |
3175 | 3175 | |
3176 | 3176 | foreach ( $a as $x ) { |
| 3177 | + # hack: don't replace inside thumbnail title/alt |
| 3178 | + # attributes |
| 3179 | + if(preg_match('/<[^>]+(alt|title)="[^">]*$/', $text)) { |
| 3180 | + $text .= "ISBN $x"; |
| 3181 | + continue; |
| 3182 | + } |
| 3183 | + |
3177 | 3184 | $isbn = $blank = '' ; |
3178 | 3185 | while ( ' ' == $x{0} ) { |
3179 | 3186 | $blank .= ' '; |
— | — | @@ -3195,7 +3202,7 @@ |
3196 | 3203 | } else { |
3197 | 3204 | $titleObj = Title::makeTitle( NS_SPECIAL, 'Booksources' ); |
3198 | 3205 | $text .= '<a href="' . |
3199 | | - $titleObj->escapeLocalUrl( 'isbn='.$num ) . |
| 3206 | + $titleObj->escapeLocalUrl( 'isbn='.$num ) . |
3200 | 3207 | "\" class=\"internal\">ISBN $isbn</a>"; |
3201 | 3208 | $text .= $x; |
3202 | 3209 | } |
— | — | @@ -3239,6 +3246,13 @@ |
3240 | 3247 | continue; |
3241 | 3248 | } |
3242 | 3249 | |
| 3250 | + # hack: don't replace inside thumbnail title/alt |
| 3251 | + # attributes |
| 3252 | + if(preg_match('/<[^>]+(alt|title)="[^">]*$/', $text)) { |
| 3253 | + $text .= $keyword . $x; |
| 3254 | + continue; |
| 3255 | + } |
| 3256 | + |
3243 | 3257 | $id = $blank = '' ; |
3244 | 3258 | |
3245 | 3259 | /** remove and save whitespaces in $blank */ |
— | — | @@ -3824,6 +3838,11 @@ |
3825 | 3839 | } |
3826 | 3840 | # Strip bad stuff out of the alt text |
3827 | 3841 | $alt = $this->replaceLinkHoldersText( $caption ); |
| 3842 | + |
| 3843 | + # make sure there are no placeholders in thumbnail attributes |
| 3844 | + # that are later expanded to html- so expand them now and |
| 3845 | + # remove the tags |
| 3846 | + $alt = $this->unstrip($alt, $this->mStripState); |
3828 | 3847 | $alt = Sanitizer::stripAllTags( $alt ); |
3829 | 3848 | |
3830 | 3849 | # Linker does the rest |