From 472a433a07704f40339744954f21d6516a3a8dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Wed, 14 Nov 2001 20:50:23 +0000 Subject: [PATCH] * fixed bug 481593 - interface fonts too big on macs; * taked into account the case when "magic_quotes_sybase" is set in the php configuration file and fixed the js errors. --- libraries/common.lib.php3 | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/libraries/common.lib.php3 b/libraries/common.lib.php3 index 22f7556a1..1605cf945 100644 --- a/libraries/common.lib.php3 +++ b/libraries/common.lib.php3 @@ -780,8 +780,10 @@ if (!defined('__LIB_COMMON__')){ : 'x-small'; $font_smallest = 'x-small'; } - // Mac browsers: need bigger fonts - else if (USR_OS == 'Mac') { + // Mac browsers: need bigger fonts except IE 5+ & NS 6+ + else if (USR_OS == 'Mac' + && ((USR_BROWSER_AGENT != 'IE' && USR_BROWSER_AGENT != 'MOZILLA') + || USR_BROWSER_VER < 5)) { $font_size = 'medium'; $font_bigger = 'x-large '; $font_smaller = 'small'; @@ -839,13 +841,17 @@ if (!defined('__LIB_COMMON__')){ */ function js_format($a_string = '', $add_backquotes = TRUE) { - $a_string = str_replace('"', '"', $a_string); - $a_string = str_replace('#', '\\#', addslashes($a_string)); - $a_string = str_replace("\012", '\\\\n', $a_string); - $a_string = str_replace("\015", '\\\\r', $a_string); + if (is_string($a_string)) { + $a_string = str_replace('"', '"', $a_string); + $a_string = str_replace('\\', '\\\\', $a_string); + $a_string = str_replace('\'', '\\\'', $a_string); + $a_string = str_replace('#', '\\#', $a_string); + $a_string = str_replace("\012", '\\\\n', $a_string); + $a_string = str_replace("\015", '\\\\r', $a_string); + } return (($add_backquotes) ? backquote($a_string) : $a_string); - } // end of the 'sql_addslashes()' function + } // end of the 'js_format()' function /**