Index: trunk/extensions/ReaderFeedback/specialpages/RatingHistory_body.php |
— | — | @@ -474,19 +474,28 @@ |
475 | 475 | # Create the graph |
476 | 476 | @$plot->init(); |
477 | 477 | $plot->drawGraph(); |
478 | | - $plot->polyLine('dave'); |
479 | | - $plot->polyLine('rave'); |
| 478 | + if( !$plot->polyLine('dave') ) { |
| 479 | + throw new MWException( 'Could not generate "dave" line!' ); |
| 480 | + } |
| 481 | + if( !$plot->polyLine('rave') ) { |
| 482 | + throw new MWException( 'Could not generate "rave" line!' ); |
| 483 | + } |
| 484 | + if( !$plot->polyLine('dcount') ) { |
| 485 | + throw new MWException( 'Could not generate "dcount" line!' ); |
| 486 | + } |
480 | 487 | #$plot->line('dcount'); |
481 | | - $plot->polyLine('dcount'); |
482 | 488 | // Render! |
483 | 489 | $plot->generateSVG( "xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'" ); |
484 | 490 | // Write to file for cache |
485 | 491 | $svgPath = $this->getFilePath( $tag, 'svg' ); |
486 | 492 | $svgHandler = new SvgHandler(); |
487 | | - if( @!file_put_contents( $svgPath, $plot->svg ) ) { |
| 493 | + wfSuppressWarnings(); // FS notices possible |
| 494 | + if( !file_put_contents( $svgPath, $plot->svg ) ) { |
488 | 495 | throw new MWException( 'Could not write SVG file!' ); |
| 496 | + wfRestoreWarnings(); |
489 | 497 | return false; |
490 | 498 | } |
| 499 | + wfRestoreWarnings(); |
491 | 500 | // Rasterize due to IE suckage |
492 | 501 | $status = $svgHandler->rasterize( $svgPath, $filePath, 1000, 410 ); |
493 | 502 | if( $status !== true ) { |