From: <gi...@ma...> - 2010-10-18 11:58:33
|
The branch, master has been updated via 10557b0434d4d73e3546fc6745b75391229320c7 (commit) from 3bb92717d33dd43afeeb911ec47cd1d8c50cf8ae (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 10557b0434d4d73e3546fc6745b75391229320c7 Author: David Hicks <hic...@op...> Date: Mon Oct 18 22:47:11 2010 +1100 Fix #10995: Correct font paths and error messages for ezGraph We need to return errors as an image so that they appear within an <img> tag within HTML. Furthermore, the function needs to return the full path to the font file in use. This is in contrast to the JpGraph mode where we only need to return the file name of the font file. This discrepancy would be good to avoid in the future if possible. ----------------------------------------------------------------------- Summary of changes: plugins/MantisGraph/core/graph_api.php | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) ----------------------------------------------------------------------- commit 10557b0434d4d73e3546fc6745b75391229320c7 Author: David Hicks <hic...@op...> Date: Mon Oct 18 22:47:11 2010 +1100 Fix #10995: Correct font paths and error messages for ezGraph We need to return errors as an image so that they appear within an <img> tag within HTML. Furthermore, the function needs to return the full path to the font file in use. This is in contrast to the JpGraph mode where we only need to return the file name of the font file. This discrepancy would be good to avoid in the future if possible. diff --git a/plugins/MantisGraph/core/graph_api.php b/plugins/MantisGraph/core/graph_api.php index 1749c17..d920af2 100644 --- a/plugins/MantisGraph/core/graph_api.php +++ b/plugins/MantisGraph/core/graph_api.php @@ -67,10 +67,19 @@ function graph_get_font() { ); if( isset( $t_font_map[$t_font] ) ) { - return $t_font_map[$t_font]; + $t_font = $t_font_map[$t_font]; } else { - return 'arial.ttf'; + $t_font = 'arial.ttf'; + } + $t_font_path = get_font_path(); + if( empty($t_font_path) ) { + error_text('Unable to read/find font', 'Unable to read/find font'); + } + $t_font_file = $t_font_path . $t_font; + if( file_exists($t_font_file) === false || is_readable($t_font_file) === false ) { + error_text('Unable to read/find font', 'Unable to read/find font'); } + return $t_font_file; } else { $t_font_map = array( 'arial' => FF_ARIAL, ----------------------------------------------------------------------- -- Mantis Bug Tracker |