Index: trunk/phase3/includes/Linker.php |
— | — | @@ -1222,11 +1222,18 @@ |
1223 | 1223 | $sectionTitle = clone( $title ); |
1224 | 1224 | $sectionTitle->mFragment = $section; |
1225 | 1225 | } |
1226 | | - $link = $this->link( $sectionTitle, |
1227 | | - wfMsgForContent( 'sectionlink' ), array(), array(), |
1228 | | - 'noclasses' ); |
| 1226 | + # FIXME: $sectionTitle should probably always be valid at this |
| 1227 | + # point, but in some scenarios it's not (bug 15351). Is this cor- |
| 1228 | + # rect? |
| 1229 | + if( $title instanceof Title ) { |
| 1230 | + $link = $this->link( $sectionTitle, |
| 1231 | + wfMsgForContent( 'sectionlink' ), array(), array(), |
| 1232 | + 'noclasses' ); |
| 1233 | + } else { |
| 1234 | + $link = ''; |
| 1235 | + } |
1229 | 1236 | } |
1230 | | - $auto = $link . $auto; |
| 1237 | + $auto = "$link$auto"; |
1231 | 1238 | if( $pre ) { |
1232 | 1239 | # written summary $presep autocomment (summary /* section */) |
1233 | 1240 | $auto = wfMsgExt( 'autocomment-prefix', array( 'escapenoentities', 'content' ) ) . $auto; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -157,6 +157,7 @@ |
158 | 158 | namespace in Special:Watchlist |
159 | 159 | * (bug 15172) 'Go' button of Special:Recentchanges now on the same line as the |
160 | 160 | last input element (like Special:Watchlist too) |
| 161 | +* (bug 15351) Fix fatal error for invalid section fragments in autocomments |
161 | 162 | |
162 | 163 | |
163 | 164 | === API changes in 1.14 === |