Index: trunk/extensions/VipsScaler/SpecialVipsTest.php |
— | — | @@ -278,17 +278,15 @@ |
279 | 279 | } |
280 | 280 | } |
281 | 281 | |
| 282 | + |
| 283 | + /** |
| 284 | + * Generates a blank page with given HTTP error code |
| 285 | + * |
| 286 | + * @param $code Integer: HTTP error either 404 or 500 |
| 287 | + */ |
282 | 288 | protected function streamError( $code ) { |
283 | | - $this->getOutput()->disable(); |
284 | | - |
285 | | - if ( $code == 404 ) { |
286 | | - $msg = 'Not Found'; |
287 | | - } elseif ( $code == 500 ) { |
288 | | - $msg = 'Internal Server Error'; |
289 | | - } |
290 | | - header( "HTTP/1.0 $code $msg" ); |
291 | | - echo "<h1>$msg</h1>\r\n"; |
292 | | - |
| 289 | + $this->getOutput()->setStatusCode( $code ); |
| 290 | + $this->getOutput()->setArticleBodyOnly( true ); |
293 | 291 | } |
294 | 292 | |
295 | 293 | } |