From 8f186a2a259fa0878421d548b789c513b52bad90 Mon Sep 17 00:00:00 2001 From: tokul Date: Fri, 7 Jan 2005 18:06:26 +0000 Subject: [PATCH] adding mbstring overloading test and splitting some strings in order to make them readable on smaller screens and don't cause xgettext errors. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8609 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/configtest.php | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/configtest.php b/src/configtest.php index 5e5b1d5a..612b9dfa 100644 --- a/src/configtest.php +++ b/src/configtest.php @@ -96,6 +96,21 @@ if(count($diff)) { echo $IND . "PHP extensions OK.
\n"; +/* dangerous php settings */ +/** + * mbstring.func_overload allows to replace original string and regexp functions + * with their equivalents from php mbstring extension. It causes problems when + * scripts analyse 8bit strings byte after byte or use 8bit strings in regexp tests. + * Setting can be controlled in php.ini (php 4.2.0), webserver config (php 4.2.0) + * and .htaccess files (php 4.3.5). + */ +if (function_exists('mb_internal_encoding') && + check_php_version(4,2,0) && + (int)ini_get('mbstring.func_overload')!=0) { + $mb_error='You have enabled mbstring overloading.' + .' It can cause problems with SquirrelMail scripts that rely on single byte string functions.'; + do_err($mb_error); +} /* checking paths */ @@ -269,15 +284,20 @@ fclose($stream); echo "Checking internationalization (i18n) settings...
\n"; echo "$IND gettext - "; if (function_exists('gettext')) { - echo "Gettext functions are available. You must have appropriate system locales compiled.
\n"; + echo 'Gettext functions are available.' + .' On some systems you must have appropriate system locales compiled.' + ."
\n"; } else { - echo "Gettext functions are unavailable. SquirrelMail will use slower internal gettext functions.
\n"; + echo 'Gettext functions are unavailable.' + .' SquirrelMail will use slower internal gettext functions.' + ."
\n"; } echo "$IND mbstring - "; if (function_exists('mb_detect_encoding')) { echo "Mbstring functions are available.
\n"; } else { - echo "Mbstring functions are unavailable. Japanese translation won't work.
\n"; + echo 'Mbstring functions are unavailable.' + ." Japanese translation won't work.
\n"; } echo "$IND recode - "; if (function_exists('recode')) { @@ -361,9 +381,10 @@ if($addrbook_dsn || $prefs_dsn || $addrbook_global_dsn) { } } } else { - do_err('Required PHP PEAR DB support is not available. Is PEAR installed and is the - include path set correctly to find DB.php? The include path is now: - "' . ini_get('include_path') . '".'); + $db_error='Required PHP PEAR DB support is not available.' + .' Is PEAR installed and is the include path set correctly to find DB.php?' + .' The include path is now:' . ini_get('include_path') . '.'; + do_err($db_error); } } else { echo $IND."not using database functionality.
\n"; -- 2.25.1