From 6152bc533682fb2d7e426366d9da5f389d8854a4 Mon Sep 17 00:00:00 2001 From: Roland Becker Date: Sun, 12 Sep 2010 16:11:47 +0200 Subject: [PATCH] Fixed #11654: Excel export does not encode '&' character as entity --- core/excel_api.php | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/core/excel_api.php b/core/excel_api.php index e7cda3e..7db12bb 100644 --- a/core/excel_api.php +++ b/core/excel_api.php @@ -118,13 +118,8 @@ function excel_get_default_filename() { function excel_prepare_string( $p_value ) { $t_type = is_numeric( $p_value ) ? 'Number' : 'String'; - $t_ret = ""; - $t_value = $p_value; - $t_value = str_replace( "\n", ' ', $t_value ); - $t_value = str_replace( '<', '<', $t_value ); - $t_value = str_replace( '>', '>', $t_value ); - $t_ret .= $t_value; - $t_ret .= "\n"; + $t_value = str_replace( array ( '&', "\n", '<', '>'), array ( '&', ' ', '<', '>' ), $p_value ); + $t_ret = "" . $t_value . "\n"; return $t_ret; } -- 1.7.0.2.msysgit.0