Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -253,7 +253,8 @@ |
254 | 254 | * (bug 28719) Do not call mLinkHolders __destruct explicitly |
255 | 255 | * (bug 21196) Article::getContributors() no longer fails on PostgreSQL. |
256 | 256 | * (bug 28752) XCache doesn't work in CLI mode. |
257 | | -* (bug 28076) Thumbnail height limited to 360 pixels on Special:Listfiles |
| 257 | +* (bug 28076) Thumbnail height limited to 360 pixels on Special:Listfiles |
| 258 | +* (bug 22227) Special:Listfiles no longer throws an error on bogus file entries |
258 | 259 | |
259 | 260 | === API changes in 1.18 === |
260 | 261 | * (bug 26339) Throw warning when truncating an overlarge API result. |
Index: trunk/phase3/includes/specials/SpecialListfiles.php |
— | — | @@ -197,11 +197,16 @@ |
198 | 198 | if ( $imgfile === null ) $imgfile = wfMsg( 'imgfile' ); |
199 | 199 | |
200 | 200 | $filePage = Title::makeTitle( NS_FILE, $value ); |
201 | | - $link = $this->getSkin()->linkKnown( $filePage, htmlspecialchars( $filePage->getText() ) ); |
202 | | - $image = wfLocalFile( $value ); |
203 | | - $url = $image->getURL(); |
204 | | - $download = Xml::element('a', array( 'href' => $url ), $imgfile ); |
205 | | - return "$link ($download)"; |
| 201 | + if( $filePage ) { |
| 202 | + $link = $this->getSkin()->linkKnown( $filePage, htmlspecialchars( $filePage->getText() ) ); |
| 203 | + $download = Xml::element( 'a', |
| 204 | + array( 'href' => wfLocalFile( $filePage )->getURL() ), |
| 205 | + $imgfile |
| 206 | + ); |
| 207 | + return "$link ($download)"; |
| 208 | + } else { |
| 209 | + return htmlspecialchars( $value ); |
| 210 | + } |
206 | 211 | case 'img_user_text': |
207 | 212 | if ( $this->mCurrentRow->img_user ) { |
208 | 213 | $link = $this->getSkin()->link( |
— | — | @@ -217,7 +222,7 @@ |
218 | 223 | case 'img_description': |
219 | 224 | return $this->getSkin()->commentBlock( $value, null, false, false ); |
220 | 225 | case 'count': |
221 | | - return intval($value)+1; |
| 226 | + return intval( $value ) + 1; |
222 | 227 | } |
223 | 228 | } |
224 | 229 | |