From 7ca94ea4a3e3bad9bc431a46f2804bd9754ea746 Mon Sep 17 00:00:00 2001 From: tassium Date: Wed, 8 Jan 2003 14:49:59 +0000 Subject: [PATCH] Squelching errors feels wrong, although in this case it's probably harmless. Reworked timezone file code to be E_ALL clean without the use of @ git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4400 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- include/options/personal.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/options/personal.php b/include/options/personal.php index e0b7ad2a..26b3793d 100644 --- a/include/options/personal.php +++ b/include/options/personal.php @@ -121,11 +121,13 @@ function load_optpage_data_personal() { if ( $tzChangeAllowed ) { $TZ_ARRAY[SMPREF_NONE] = _("Same as server"); $tzfile = SM_PATH . 'locale/timezones.cfg'; - if(!$fd = @fopen($tzfile ,'r')) { - $message = _("Error opening timezone config, contact administrator."); - plain_error_message($message, $color); - exit; - } + if ((!is_readable($tzfile)) or (!$fd = fopen($tzfile,'r'))) { + $message = _("Error opening timezone config, contact administrator."); + } + if (isset($message)) { + plain_error_message($message, $color); + exit; + } while (!feof ($fd)) { $zone = fgets($fd, 1024); if( $zone ) { -- 2.25.1